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

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

Issue 1759653004: enforce 16byte alignment in shader contexts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 27 matching lines...) Expand all
38 }; 38 };
39 39
40 40
41 class SkTwoPointConicalGradient : public SkGradientShaderBase { 41 class SkTwoPointConicalGradient : public SkGradientShaderBase {
42 TwoPtRadial fRec; 42 TwoPtRadial fRec;
43 public: 43 public:
44 SkTwoPointConicalGradient(const SkPoint& start, SkScalar startRadius, 44 SkTwoPointConicalGradient(const SkPoint& start, SkScalar startRadius,
45 const SkPoint& end, SkScalar endRadius, 45 const SkPoint& end, SkScalar endRadius,
46 bool flippedGrad, const Descriptor&); 46 bool flippedGrad, const Descriptor&);
47 47
48
49 size_t contextSize(const ContextRec&) const override;
50
51 class TwoPointConicalGradientContext : public SkGradientShaderBase::Gradient ShaderBaseContext { 48 class TwoPointConicalGradientContext : public SkGradientShaderBase::Gradient ShaderBaseContext {
52 public: 49 public:
53 TwoPointConicalGradientContext(const SkTwoPointConicalGradient&, const C ontextRec&); 50 TwoPointConicalGradientContext(const SkTwoPointConicalGradient&, const C ontextRec&);
54 ~TwoPointConicalGradientContext() {} 51 ~TwoPointConicalGradientContext() {}
55 52
56 void shadeSpan(int x, int y, SkPMColor dstC[], int count) override; 53 void shadeSpan(int x, int y, SkPMColor dstC[], int count) override;
57 54
58 private: 55 private:
59 typedef SkGradientShaderBase::GradientShaderBaseContext INHERITED; 56 typedef SkGradientShaderBase::GradientShaderBaseContext INHERITED;
60 }; 57 };
(...skipping 14 matching lines...) Expand all
75 const SkPoint& getEndCenter() const { return fCenter2; } 72 const SkPoint& getEndCenter() const { return fCenter2; }
76 SkScalar getEndRadius() const { return fRadius2; } 73 SkScalar getEndRadius() const { return fRadius2; }
77 bool isFlippedGrad() const { return fFlippedGrad; } 74 bool isFlippedGrad() const { return fFlippedGrad; }
78 75
79 SK_TO_STRING_OVERRIDE() 76 SK_TO_STRING_OVERRIDE()
80 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradien t) 77 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradien t)
81 78
82 protected: 79 protected:
83 SkTwoPointConicalGradient(SkReadBuffer& buffer); 80 SkTwoPointConicalGradient(SkReadBuffer& buffer);
84 void flatten(SkWriteBuffer& buffer) const override; 81 void flatten(SkWriteBuffer& buffer) const override;
82 size_t onContextSize(const ContextRec&) const override;
85 Context* onCreateContext(const ContextRec&, void* storage) const override; 83 Context* onCreateContext(const ContextRec&, void* storage) const override;
86 84
87 private: 85 private:
88 SkPoint fCenter1; 86 SkPoint fCenter1;
89 SkPoint fCenter2; 87 SkPoint fCenter2;
90 SkScalar fRadius1; 88 SkScalar fRadius1;
91 SkScalar fRadius2; 89 SkScalar fRadius2;
92 bool fFlippedGrad; 90 bool fFlippedGrad;
93 91
94 friend class SkGradientShader; 92 friend class SkGradientShader;
95 typedef SkGradientShaderBase INHERITED; 93 typedef SkGradientShaderBase INHERITED;
96 }; 94 };
97 95
98 #endif 96 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkSweepGradient.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698