Index: src/effects/gradients/SkTwoPointConicalGradient.h |
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.h b/src/effects/gradients/SkTwoPointConicalGradient.h |
index 4c049172d3131fcce3303df03f0f96c9b4305f3b..041f8b8be44cd74e9c75c3da046e44a419689e7a 100644 |
--- a/src/effects/gradients/SkTwoPointConicalGradient.h |
+++ b/src/effects/gradients/SkTwoPointConicalGradient.h |
@@ -11,8 +11,6 @@ |
#include "SkGradientShaderPriv.h" |
-// TODO(dominikg): Worth making it truly immutable (i.e. set values in constructor)? |
-// Should only be initialized once via init(). Immutable afterwards. |
struct TwoPtRadial { |
enum { |
kDontDrawT = 0x80000000 |
@@ -29,6 +27,13 @@ |
void init(const SkPoint& center0, SkScalar rad0, |
const SkPoint& center1, SkScalar rad1); |
+ // used by setup and nextT |
+ float fRelX, fRelY, fIncX, fIncY; |
+ float fB, fDB; |
+ |
+ void setup(SkScalar fx, SkScalar fy, SkScalar dfx, SkScalar dfy); |
+ SkFixed nextT(); |
+ |
static bool DontDrawT(SkFixed t) { |
return kDontDrawT == (uint32_t)t; |
} |
@@ -44,24 +49,11 @@ |
const SkPoint& end, SkScalar endRadius, |
const Descriptor&); |
- |
- virtual SkShader::Context* createContext(const SkBitmap&, const SkPaint&, const SkMatrix&, |
- void* storage) const SK_OVERRIDE; |
- virtual size_t contextSize() const SK_OVERRIDE; |
- |
- class TwoPointConicalGradientContext : public SkGradientShaderBase::GradientShaderBaseContext { |
- public: |
- TwoPointConicalGradientContext(const SkTwoPointConicalGradient& shader, |
- const SkBitmap& device, |
- const SkPaint& paint, |
- const SkMatrix& matrix); |
- ~TwoPointConicalGradientContext() {} |
- |
- virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRIDE; |
- |
- private: |
- typedef SkGradientShaderBase::GradientShaderBaseContext INHERITED; |
- }; |
+ virtual void shadeSpan(int x, int y, SkPMColor* dstCParam, |
+ int count) SK_OVERRIDE; |
+ virtual bool setContext(const SkBitmap& device, |
+ const SkPaint& paint, |
+ const SkMatrix& matrix) SK_OVERRIDE; |
virtual BitmapType asABitmap(SkBitmap* bitmap, |
SkMatrix* matrix, |
@@ -85,12 +77,11 @@ |
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; |
private: |
+ typedef SkGradientShaderBase INHERITED; |
const SkPoint fCenter1; |
const SkPoint fCenter2; |
const SkScalar fRadius1; |
const SkScalar fRadius2; |
- |
- typedef SkGradientShaderBase INHERITED; |
}; |
#endif |