| OLD | NEW |
| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 const GrFragmentProcessor* asFragmentProcessor(GrContext*, const SkMatrix& v
iewM, |
| 53 const SkMatrix*, SkFilterQual
ity) const override; | 53 const SkMatrix*, SkFilterQual
ity, |
| 54 SkSourceGammaTreatment) const
override; |
| 54 #endif | 55 #endif |
| 55 | 56 |
| 56 SK_TO_STRING_OVERRIDE() | 57 SK_TO_STRING_OVERRIDE() |
| 57 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) | 58 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) |
| 58 | 59 |
| 59 protected: | 60 protected: |
| 60 SkColorShader(SkReadBuffer&); | 61 SkColorShader(SkReadBuffer&); |
| 61 void flatten(SkWriteBuffer&) const override; | 62 void flatten(SkWriteBuffer&) const override; |
| 62 Context* onCreateContext(const ContextRec&, void* storage) const override; | 63 Context* onCreateContext(const ContextRec&, void* storage) const override; |
| 63 size_t onContextSize(const ContextRec&) const override { return sizeof(Color
ShaderContext); } | 64 size_t onContextSize(const ContextRec&) const override { return sizeof(Color
ShaderContext); } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 SkPMColor fPMColor; | 98 SkPMColor fPMColor; |
| 98 uint32_t fFlags; | 99 uint32_t fFlags; |
| 99 | 100 |
| 100 typedef SkShader::Context INHERITED; | 101 typedef SkShader::Context INHERITED; |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 GradientType asAGradient(GradientInfo* info) const override; | 104 GradientType asAGradient(GradientInfo* info) const override; |
| 104 | 105 |
| 105 #if SK_SUPPORT_GPU | 106 #if SK_SUPPORT_GPU |
| 106 const GrFragmentProcessor* asFragmentProcessor(GrContext*, const SkMatrix& v
iewM, | 107 const GrFragmentProcessor* asFragmentProcessor(GrContext*, const SkMatrix& v
iewM, |
| 107 const SkMatrix*, SkFilterQual
ity) const override; | 108 const SkMatrix*, SkFilterQual
ity, |
| 109 SkSourceGammaTreatment) const
override; |
| 108 #endif | 110 #endif |
| 109 | 111 |
| 110 SK_TO_STRING_OVERRIDE() | 112 SK_TO_STRING_OVERRIDE() |
| 111 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) | 113 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) |
| 112 | 114 |
| 113 protected: | 115 protected: |
| 114 SkColor4Shader(SkReadBuffer&); | 116 SkColor4Shader(SkReadBuffer&); |
| 115 void flatten(SkWriteBuffer&) const override; | 117 void flatten(SkWriteBuffer&) const override; |
| 116 Context* onCreateContext(const ContextRec&, void* storage) const override; | 118 Context* onCreateContext(const ContextRec&, void* storage) const override; |
| 117 size_t onContextSize(const ContextRec&) const override { return sizeof(Color
4Context); } | 119 size_t onContextSize(const ContextRec&) const override { return sizeof(Color
4Context); } |
| 118 bool onAsLuminanceColor(SkColor* lum) const override { | 120 bool onAsLuminanceColor(SkColor* lum) const override { |
| 119 *lum = fCachedByteColor; | 121 *lum = fCachedByteColor; |
| 120 return true; | 122 return true; |
| 121 } | 123 } |
| 122 | 124 |
| 123 private: | 125 private: |
| 124 sk_sp<SkColorSpace> fColorSpace; | 126 sk_sp<SkColorSpace> fColorSpace; |
| 125 const SkColor4f fColor4; | 127 const SkColor4f fColor4; |
| 126 const SkColor fCachedByteColor; | 128 const SkColor fCachedByteColor; |
| 127 | 129 |
| 128 typedef SkShader INHERITED; | 130 typedef SkShader INHERITED; |
| 129 }; | 131 }; |
| 130 | 132 |
| 131 #endif | 133 #endif |
| OLD | NEW |