blob: 7773903188c845f0d530841f065fd24af361d1f1 [file] [log] [blame]
* Copyright 2023 Google LLC
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#ifndef SkSweepGradientShader_DEFINED
#define SkSweepGradientShader_DEFINED
#include "include/core/SkFlattenable.h"
#include "include/core/SkPoint.h"
#include "include/core/SkScalar.h"
#include "src/shaders/gradients/SkGradientBaseShader.h"
class SkArenaAlloc;
class SkMatrix;
class SkRasterPipeline;
class SkReadBuffer;
class SkWriteBuffer;
class SkSweepGradient final : public SkGradientBaseShader {
SkSweepGradient(const SkPoint& center, SkScalar t0, SkScalar t1, const Descriptor&);
GradientType asGradient(GradientInfo* info, SkMatrix* localMatrix) const override;
const SkPoint& center() const { return fCenter; }
SkScalar tBias() const { return fTBias; }
SkScalar tScale() const { return fTScale; }
void flatten(SkWriteBuffer& buffer) const override;
void appendGradientStages(SkArenaAlloc* alloc,
SkRasterPipeline* tPipeline,
SkRasterPipeline* postPipeline) const override;
friend void ::SkRegisterSweepGradientShaderFlattenable();
const SkPoint fCenter;
const SkScalar fTBias;
const SkScalar fTScale;