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

Side by Side Diff: src/core/SkColorShader.h

Issue 2175563003: Bundle SkShader::asFragmentProcessor arguments in a struct (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix indentation to be less arbitrary Created 4 years, 5 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/core/SkColorFilterShader.cpp ('k') | src/core/SkColorShader.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 2007 The Android Open Source Project 2 * Copyright 2007 The Android Open Source Project
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 SkColorShader_DEFINED 8 #ifndef SkColorShader_DEFINED
9 #define SkColorShader_DEFINED 9 #define SkColorShader_DEFINED
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 SkPM4f fPM4f; 42 SkPM4f fPM4f;
43 SkPMColor fPMColor; 43 SkPMColor fPMColor;
44 uint32_t fFlags; 44 uint32_t fFlags;
45 45
46 typedef SkShader::Context INHERITED; 46 typedef SkShader::Context INHERITED;
47 }; 47 };
48 48
49 GradientType asAGradient(GradientInfo* info) const override; 49 GradientType asAGradient(GradientInfo* info) const override;
50 50
51 #if SK_SUPPORT_GPU 51 #if SK_SUPPORT_GPU
52 sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext*, const SkMatrix& v iewM, 52 sk_sp<GrFragmentProcessor> asFragmentProcessor(const AsFPArgs&) const overri de;
53 const SkMatrix*, SkFilterQual ity,
54 SkSourceGammaTreatment) const override;
55 #endif 53 #endif
56 54
57 SK_TO_STRING_OVERRIDE() 55 SK_TO_STRING_OVERRIDE()
58 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) 56 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader)
59 57
60 protected: 58 protected:
61 SkColorShader(SkReadBuffer&); 59 SkColorShader(SkReadBuffer&);
62 void flatten(SkWriteBuffer&) const override; 60 void flatten(SkWriteBuffer&) const override;
63 Context* onCreateContext(const ContextRec&, void* storage) const override; 61 Context* onCreateContext(const ContextRec&, void* storage) const override;
64 size_t onContextSize(const ContextRec&) const override { return sizeof(Color ShaderContext); } 62 size_t onContextSize(const ContextRec&) const override { return sizeof(Color ShaderContext); }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 SkPM4f fPM4f; 95 SkPM4f fPM4f;
98 SkPMColor fPMColor; 96 SkPMColor fPMColor;
99 uint32_t fFlags; 97 uint32_t fFlags;
100 98
101 typedef SkShader::Context INHERITED; 99 typedef SkShader::Context INHERITED;
102 }; 100 };
103 101
104 GradientType asAGradient(GradientInfo* info) const override; 102 GradientType asAGradient(GradientInfo* info) const override;
105 103
106 #if SK_SUPPORT_GPU 104 #if SK_SUPPORT_GPU
107 sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext*, const SkMatrix& v iewM, 105 sk_sp<GrFragmentProcessor> asFragmentProcessor(const AsFPArgs&) const overri de;
108 const SkMatrix*, SkFilterQual ity,
109 SkSourceGammaTreatment) const override;
110 #endif 106 #endif
111 107
112 SK_TO_STRING_OVERRIDE() 108 SK_TO_STRING_OVERRIDE()
113 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) 109 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader)
114 110
115 protected: 111 protected:
116 SkColor4Shader(SkReadBuffer&); 112 SkColor4Shader(SkReadBuffer&);
117 void flatten(SkWriteBuffer&) const override; 113 void flatten(SkWriteBuffer&) const override;
118 Context* onCreateContext(const ContextRec&, void* storage) const override; 114 Context* onCreateContext(const ContextRec&, void* storage) const override;
119 size_t onContextSize(const ContextRec&) const override { return sizeof(Color 4Context); } 115 size_t onContextSize(const ContextRec&) const override { return sizeof(Color 4Context); }
120 bool onAsLuminanceColor(SkColor* lum) const override { 116 bool onAsLuminanceColor(SkColor* lum) const override {
121 *lum = fCachedByteColor; 117 *lum = fCachedByteColor;
122 return true; 118 return true;
123 } 119 }
124 120
125 private: 121 private:
126 sk_sp<SkColorSpace> fColorSpace; 122 sk_sp<SkColorSpace> fColorSpace;
127 const SkColor4f fColor4; 123 const SkColor4f fColor4;
128 const SkColor fCachedByteColor; 124 const SkColor fCachedByteColor;
129 125
130 typedef SkShader INHERITED; 126 typedef SkShader INHERITED;
131 }; 127 };
132 128
133 #endif 129 #endif
OLDNEW
« no previous file with comments | « src/core/SkColorFilterShader.cpp ('k') | src/core/SkColorShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698