| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2007 The Android Open Source Project | 3 * Copyright 2007 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkColorShader_DEFINED | 10 #ifndef SkColorShader_DEFINED |
| 11 #define SkColorShader_DEFINED | 11 #define SkColorShader_DEFINED |
| 12 | 12 |
| 13 #include "SkShader.h" | 13 #include "SkShader.h" |
| 14 | 14 |
| 15 /** \class SkColorShader | 15 /** \class SkColorShader |
| 16 A Shader that represents a single color. In general, this effect can be | 16 A Shader that represents a single color. In general, this effect can be |
| 17 accomplished by just using the color field on the paint, but if an | 17 accomplished by just using the color field on the paint, but if an |
| 18 actual shader object is needed, this provides that feature. | 18 actual shader object is needed, this provides that feature. |
| 19 */ | 19 */ |
| 20 class SK_API SkColorShader : public SkShader { | 20 class SK_API SkColorShader : public SkShader { |
| 21 typedef SkShader INHERITED; |
| 22 |
| 21 public: | 23 public: |
| 22 /** Create a ColorShader that will inherit its color from the Paint | 24 /** Create a ColorShader that will inherit its color from the Paint |
| 23 at draw time. | 25 at draw time. |
| 24 */ | 26 */ |
| 25 SkColorShader(); | 27 SkColorShader(); |
| 26 | 28 |
| 27 /** Create a ColorShader that ignores the color in the paint, and uses the | 29 /** Create a ColorShader that ignores the color in the paint, and uses the |
| 28 specified color. Note: like all shaders, at draw time the paint's alpha | 30 specified color. Note: like all shaders, at draw time the paint's alpha |
| 29 will be respected, and is applied to the specified color. | 31 will be respected, and is applied to the specified color. |
| 30 */ | 32 */ |
| (...skipping 24 matching lines...) Expand all Loading... |
| 55 SkColorShader(SkFlattenableReadBuffer&); | 57 SkColorShader(SkFlattenableReadBuffer&); |
| 56 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; | 58 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
| 57 | 59 |
| 58 private: | 60 private: |
| 59 | 61 |
| 60 SkColor fColor; // ignored if fInheritColor is true | 62 SkColor fColor; // ignored if fInheritColor is true |
| 61 SkPMColor fPMColor; // cached after setContext() | 63 SkPMColor fPMColor; // cached after setContext() |
| 62 uint32_t fFlags; // cached after setContext() | 64 uint32_t fFlags; // cached after setContext() |
| 63 uint16_t fColor16; // cached after setContext() | 65 uint16_t fColor16; // cached after setContext() |
| 64 SkBool8 fInheritColor; | 66 SkBool8 fInheritColor; |
| 65 | |
| 66 typedef SkShader INHERITED; | |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 #endif | 69 #endif |
| OLD | NEW |