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

Side by Side Diff: src/effects/gradients/SkLinearGradient.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
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkLinearGradient_DEFINED 8 #ifndef SkLinearGradient_DEFINED
9 #define SkLinearGradient_DEFINED 9 #define SkLinearGradient_DEFINED
10 10
(...skipping 15 matching lines...) Expand all
26 26
27 class SkLinearGradient : public SkGradientShaderBase { 27 class SkLinearGradient : public SkGradientShaderBase {
28 public: 28 public:
29 enum { 29 enum {
30 // Temp flag for testing the 4f impl. 30 // Temp flag for testing the 4f impl.
31 kForce4fContext_PrivateFlag = 1 << 7, 31 kForce4fContext_PrivateFlag = 1 << 7,
32 }; 32 };
33 33
34 SkLinearGradient(const SkPoint pts[2], const Descriptor&); 34 SkLinearGradient(const SkPoint pts[2], const Descriptor&);
35 35
36 size_t contextSize(const ContextRec&) const override;
37
38 class LinearGradientContext : public SkGradientShaderBase::GradientShaderBas eContext { 36 class LinearGradientContext : public SkGradientShaderBase::GradientShaderBas eContext {
39 public: 37 public:
40 LinearGradientContext(const SkLinearGradient&, const ContextRec&); 38 LinearGradientContext(const SkLinearGradient&, const ContextRec&);
41 39
42 void shadeSpan(int x, int y, SkPMColor dstC[], int count) override; 40 void shadeSpan(int x, int y, SkPMColor dstC[], int count) override;
43 41
44 struct Rec { 42 struct Rec {
45 Sk4fStorage fColor; 43 Sk4fStorage fColor;
46 float fPos; 44 float fPos;
47 float fPosScale; 45 float fPosScale;
(...skipping 16 matching lines...) Expand all
64 const SkMatrix*, 62 const SkMatrix*,
65 SkFilterQuality) const overri de; 63 SkFilterQuality) const overri de;
66 #endif 64 #endif
67 65
68 SK_TO_STRING_OVERRIDE() 66 SK_TO_STRING_OVERRIDE()
69 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLinearGradient) 67 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLinearGradient)
70 68
71 protected: 69 protected:
72 SkLinearGradient(SkReadBuffer& buffer); 70 SkLinearGradient(SkReadBuffer& buffer);
73 void flatten(SkWriteBuffer& buffer) const override; 71 void flatten(SkWriteBuffer& buffer) const override;
72 size_t onContextSize(const ContextRec&) const override;
74 Context* onCreateContext(const ContextRec&, void* storage) const override; 73 Context* onCreateContext(const ContextRec&, void* storage) const override;
75 74
76 private: 75 private:
77 class LinearGradient4fContext; 76 class LinearGradient4fContext;
78 77
79 friend class SkGradientShader; 78 friend class SkGradientShader;
80 typedef SkGradientShaderBase INHERITED; 79 typedef SkGradientShaderBase INHERITED;
81 const SkPoint fStart; 80 const SkPoint fStart;
82 const SkPoint fEnd; 81 const SkPoint fEnd;
83 }; 82 };
84 83
85 #endif 84 #endif
OLDNEW
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698