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

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

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 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/SkColorMatrixFilterRowMajor255.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 const GrFragmentProcessor* asFragmentProcessor(GrContext*, const SkMatrix& v iewM, 52 sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext*, const SkMatrix& v iewM,
53 const SkMatrix*, SkFilterQual ity, 53 const SkMatrix*, SkFilterQual ity,
54 SkSourceGammaTreatment) const override; 54 SkSourceGammaTreatment) const override;
55 #endif 55 #endif
56 56
57 SK_TO_STRING_OVERRIDE() 57 SK_TO_STRING_OVERRIDE()
58 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) 58 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader)
59 59
60 protected: 60 protected:
61 SkColorShader(SkReadBuffer&); 61 SkColorShader(SkReadBuffer&);
62 void flatten(SkWriteBuffer&) const override; 62 void flatten(SkWriteBuffer&) const override;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 SkPM4f fPM4f; 97 SkPM4f fPM4f;
98 SkPMColor fPMColor; 98 SkPMColor fPMColor;
99 uint32_t fFlags; 99 uint32_t fFlags;
100 100
101 typedef SkShader::Context INHERITED; 101 typedef SkShader::Context INHERITED;
102 }; 102 };
103 103
104 GradientType asAGradient(GradientInfo* info) const override; 104 GradientType asAGradient(GradientInfo* info) const override;
105 105
106 #if SK_SUPPORT_GPU 106 #if SK_SUPPORT_GPU
107 const GrFragmentProcessor* asFragmentProcessor(GrContext*, const SkMatrix& v iewM, 107 sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext*, const SkMatrix& v iewM,
108 const SkMatrix*, SkFilterQual ity, 108 const SkMatrix*, SkFilterQual ity,
109 SkSourceGammaTreatment) const override; 109 SkSourceGammaTreatment) const override;
110 #endif 110 #endif
111 111
112 SK_TO_STRING_OVERRIDE() 112 SK_TO_STRING_OVERRIDE()
113 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) 113 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader)
114 114
115 protected: 115 protected:
116 SkColor4Shader(SkReadBuffer&); 116 SkColor4Shader(SkReadBuffer&);
117 void flatten(SkWriteBuffer&) const override; 117 void flatten(SkWriteBuffer&) const override;
118 Context* onCreateContext(const ContextRec&, void* storage) const override; 118 Context* onCreateContext(const ContextRec&, void* storage) const override;
119 size_t onContextSize(const ContextRec&) const override { return sizeof(Color 4Context); } 119 size_t onContextSize(const ContextRec&) const override { return sizeof(Color 4Context); }
120 bool onAsLuminanceColor(SkColor* lum) const override { 120 bool onAsLuminanceColor(SkColor* lum) const override {
121 *lum = fCachedByteColor; 121 *lum = fCachedByteColor;
122 return true; 122 return true;
123 } 123 }
124 124
125 private: 125 private:
126 sk_sp<SkColorSpace> fColorSpace; 126 sk_sp<SkColorSpace> fColorSpace;
127 const SkColor4f fColor4; 127 const SkColor4f fColor4;
128 const SkColor fCachedByteColor; 128 const SkColor fCachedByteColor;
129 129
130 typedef SkShader INHERITED; 130 typedef SkShader INHERITED;
131 }; 131 };
132 132
133 #endif 133 #endif
OLDNEW
« no previous file with comments | « src/core/SkColorMatrixFilterRowMajor255.cpp ('k') | src/core/SkColorShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698