| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 const SkMatrix*, SkFilterQual
ity) const override; | 50 const SkMatrix*, SkFilterQual
ity) const override; |
| 51 #endif | 51 #endif |
| 52 | 52 |
| 53 SK_TO_STRING_OVERRIDE() | 53 SK_TO_STRING_OVERRIDE() |
| 54 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) | 54 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) |
| 55 | 55 |
| 56 protected: | 56 protected: |
| 57 SkColorShader(SkReadBuffer&); | 57 SkColorShader(SkReadBuffer&); |
| 58 void flatten(SkWriteBuffer&) const override; | 58 void flatten(SkWriteBuffer&) const override; |
| 59 Context* onCreateContext(const ContextRec&, void* storage) const override; | 59 Context* onCreateContext(const ContextRec&, void* storage) const override; |
| 60 size_t onContextSize(const ContextRec&) const override { | 60 size_t onContextSize(const ContextRec&) const override { return sizeof(Color
ShaderContext); } |
| 61 return SkAlign16(sizeof(ColorShaderContext)); | |
| 62 } | |
| 63 bool onAsLuminanceColor(SkColor* lum) const override { | 61 bool onAsLuminanceColor(SkColor* lum) const override { |
| 64 *lum = fColor; | 62 *lum = fColor; |
| 65 return true; | 63 return true; |
| 66 } | 64 } |
| 67 | 65 |
| 68 private: | 66 private: |
| 69 SkColor fColor; | 67 SkColor fColor; |
| 70 | 68 |
| 71 typedef SkShader INHERITED; | 69 typedef SkShader INHERITED; |
| 72 }; | 70 }; |
| 73 | 71 |
| 74 #endif | 72 #endif |
| OLD | NEW |