blob: 1f6441b5a4aab3ecd0ea10f303bd6ad836a69407 [file] [log] [blame]
/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkRadialGradient_DEFINED
#define SkRadialGradient_DEFINED
#include "SkGradientShaderPriv.h"
class SkRadialGradient final : public SkGradientShaderBase {
public:
SkRadialGradient(const SkPoint& center, SkScalar radius, const Descriptor&);
GradientType asAGradient(GradientInfo* info) const override;
#if SK_SUPPORT_GPU
std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const AsFPArgs&) const override;
#endif
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkRadialGradient)
protected:
SkRadialGradient(SkReadBuffer& buffer);
void flatten(SkWriteBuffer& buffer) const override;
sk_sp<SkShader> onMakeColorSpace(SkColorSpaceXformer* xformer) const override;
void appendGradientStages(SkArenaAlloc* alloc, SkRasterPipeline* tPipeline,
SkRasterPipeline* postPipeline) const override;
bool onIsRasterPipelineOnly(const SkMatrix&) const override { return true; }
private:
const SkPoint fCenter;
const SkScalar fRadius;
friend class SkGradientShader;
typedef SkGradientShaderBase INHERITED;
};
#endif