Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/effects/gradients/SkTwoPointConicalGradient.h

Issue 207683004: Extract most of the mutable state of SkShader into a separate Context object. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: scroggo's comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef SkTwoPointConicalGradient_DEFINED 9 #ifndef SkTwoPointConicalGradient_DEFINED
10 #define SkTwoPointConicalGradient_DEFINED 10 #define SkTwoPointConicalGradient_DEFINED
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 class SkTwoPointConicalGradient : public SkGradientShaderBase { 43 class SkTwoPointConicalGradient : public SkGradientShaderBase {
44 TwoPtRadial fRec; 44 TwoPtRadial fRec;
45 void init(); 45 void init();
46 46
47 public: 47 public:
48 SkTwoPointConicalGradient(const SkPoint& start, SkScalar startRadius, 48 SkTwoPointConicalGradient(const SkPoint& start, SkScalar startRadius,
49 const SkPoint& end, SkScalar endRadius, 49 const SkPoint& end, SkScalar endRadius,
50 const Descriptor&); 50 const Descriptor&);
51 51
52 #if 0
52 virtual void shadeSpan(int x, int y, SkPMColor* dstCParam, 53 virtual void shadeSpan(int x, int y, SkPMColor* dstCParam,
53 int count) SK_OVERRIDE; 54 int count) SK_OVERRIDE;
54 virtual bool setContext(const SkBitmap& device, 55 virtual bool setContext(const SkBitmap& device,
55 const SkPaint& paint, 56 const SkPaint& paint,
56 const SkMatrix& matrix) SK_OVERRIDE; 57 const SkMatrix& matrix) SK_OVERRIDE;
58 #endif
57 59
58 virtual BitmapType asABitmap(SkBitmap* bitmap, 60 virtual BitmapType asABitmap(SkBitmap* bitmap,
59 SkMatrix* matrix, 61 SkMatrix* matrix,
60 TileMode* xy) const; 62 TileMode* xy) const;
61 virtual SkShader::GradientType asAGradient(GradientInfo* info) const SK_OVE RRIDE; 63 virtual SkShader::GradientType asAGradient(GradientInfo* info) const SK_OVE RRIDE;
62 virtual GrEffectRef* asNewEffect(GrContext* context, const SkPaint& paint) c onst SK_OVERRIDE; 64 virtual GrEffectRef* asNewEffect(GrContext* context, const SkPaint& paint) c onst SK_OVERRIDE;
63 virtual bool isOpaque() const SK_OVERRIDE; 65 virtual bool isOpaque() const SK_OVERRIDE;
64 66
65 SkScalar getCenterX1() const { return SkPoint::Distance(fCenter1, fCenter2); } 67 SkScalar getCenterX1() const { return SkPoint::Distance(fCenter1, fCenter2); }
66 SkScalar getStartRadius() const { return fRadius1; } 68 SkScalar getStartRadius() const { return fRadius1; }
67 SkScalar getDiffRadius() const { return fRadius2 - fRadius1; } 69 SkScalar getDiffRadius() const { return fRadius2 - fRadius1; }
68 70
69 SK_DEVELOPER_TO_STRING() 71 SK_DEVELOPER_TO_STRING()
70 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradien t) 72 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradien t)
71 73
72 protected: 74 protected:
73 SkTwoPointConicalGradient(SkReadBuffer& buffer); 75 SkTwoPointConicalGradient(SkReadBuffer& buffer);
74 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; 76 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE;
75 77
76 private: 78 private:
77 typedef SkGradientShaderBase INHERITED; 79 typedef SkGradientShaderBase INHERITED;
78 const SkPoint fCenter1; 80 const SkPoint fCenter1;
79 const SkPoint fCenter2; 81 const SkPoint fCenter2;
80 const SkScalar fRadius1; 82 const SkScalar fRadius1;
81 const SkScalar fRadius2; 83 const SkScalar fRadius2;
82 }; 84 };
83 85
84 #endif 86 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698