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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 typedef SkShader::Context INHERITED; | 47 typedef SkShader::Context INHERITED; |
48 }; | 48 }; |
49 | 49 |
50 // we return false for this, use asAGradient | 50 // we return false for this, use asAGradient |
51 virtual BitmapType asABitmap(SkBitmap* outTexture, | 51 virtual BitmapType asABitmap(SkBitmap* outTexture, |
52 SkMatrix* outMatrix, | 52 SkMatrix* outMatrix, |
53 TileMode xy[2]) const override; | 53 TileMode xy[2]) const override; |
54 | 54 |
55 GradientType asAGradient(GradientInfo* info) const override; | 55 GradientType asAGradient(GradientInfo* info) const override; |
56 | 56 |
57 virtual bool asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix&
viewM, | 57 bool asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix& viewM, |
58 const SkMatrix*, GrColor*, | 58 const SkMatrix*, GrColor*, |
59 GrFragmentProcessor**) const override; | 59 GrFragmentProcessor**) const override; |
60 | 60 |
61 SK_TO_STRING_OVERRIDE() | 61 SK_TO_STRING_OVERRIDE() |
62 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) | 62 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) |
63 | 63 |
64 protected: | 64 protected: |
65 SkColorShader(SkReadBuffer&); | 65 SkColorShader(SkReadBuffer&); |
66 void flatten(SkWriteBuffer&) const override; | 66 void flatten(SkWriteBuffer&) const override; |
67 Context* onCreateContext(const ContextRec&, void* storage) const override; | 67 Context* onCreateContext(const ContextRec&, void* storage) const override; |
68 bool onAsLuminanceColor(SkColor* lum) const override { | 68 bool onAsLuminanceColor(SkColor* lum) const override { |
69 *lum = fColor; | 69 *lum = fColor; |
70 return true; | 70 return true; |
71 } | 71 } |
72 | 72 |
73 private: | 73 private: |
74 SkColor fColor; | 74 SkColor fColor; |
75 | 75 |
76 typedef SkShader INHERITED; | 76 typedef SkShader INHERITED; |
77 }; | 77 }; |
78 | 78 |
79 #endif | 79 #endif |
OLD | NEW |