michael@0: michael@0: /* michael@0: * Copyright 2012 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef SkSweepGradient_DEFINED michael@0: #define SkSweepGradient_DEFINED michael@0: michael@0: #include "SkGradientShaderPriv.h" michael@0: michael@0: class SkSweepGradient : public SkGradientShaderBase { michael@0: public: michael@0: SkSweepGradient(SkScalar cx, SkScalar cy, const Descriptor&); michael@0: virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRIDE; michael@0: virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRIDE; michael@0: michael@0: virtual BitmapType asABitmap(SkBitmap* bitmap, michael@0: SkMatrix* matrix, michael@0: TileMode* xy) const SK_OVERRIDE; michael@0: michael@0: virtual GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE; michael@0: michael@0: virtual GrEffectRef* asNewEffect(GrContext* context, const SkPaint&) const SK_OVERRIDE; michael@0: michael@0: SK_TO_STRING_OVERRIDE() michael@0: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSweepGradient) michael@0: michael@0: protected: michael@0: SkSweepGradient(SkReadBuffer& buffer); michael@0: virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; michael@0: michael@0: private: michael@0: typedef SkGradientShaderBase INHERITED; michael@0: const SkPoint fCenter; michael@0: }; michael@0: michael@0: #endif