OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 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 | 8 |
9 #ifndef SkShader_DEFINED | 9 #ifndef SkShader_DEFINED |
10 #define SkShader_DEFINED | 10 #define SkShader_DEFINED |
(...skipping 12 matching lines...) Expand all Loading... |
23 * | 23 * |
24 * Shaders specify the source color(s) for what is being drawn. If a paint | 24 * Shaders specify the source color(s) for what is being drawn. If a paint |
25 * has no shader, then the paint's color is used. If the paint has a | 25 * has no shader, then the paint's color is used. If the paint has a |
26 * shader, then the shader's color(s) are use instead, but they are | 26 * shader, then the shader's color(s) are use instead, but they are |
27 * modulated by the paint's alpha. This makes it easy to create a shader | 27 * modulated by the paint's alpha. This makes it easy to create a shader |
28 * once (e.g. bitmap tiling or gradient) and then change its transparency | 28 * once (e.g. bitmap tiling or gradient) and then change its transparency |
29 * w/o having to modify the original shader... only the paint's alpha needs | 29 * w/o having to modify the original shader... only the paint's alpha needs |
30 * to be modified. | 30 * to be modified. |
31 */ | 31 */ |
32 class SK_API SkShader : public SkFlattenable { | 32 class SK_API SkShader : public SkFlattenable { |
| 33 typedef SkFlattenable INHERITED; |
| 34 |
33 public: | 35 public: |
34 SK_DECLARE_INST_COUNT(SkShader) | 36 SK_DECLARE_INST_COUNT(SkShader) |
35 | 37 |
36 SkShader(); | 38 SkShader(); |
37 virtual ~SkShader(); | 39 virtual ~SkShader(); |
38 | 40 |
39 /** | 41 /** |
40 * Returns true if the local matrix is not an identity matrix. | 42 * Returns true if the local matrix is not an identity matrix. |
41 */ | 43 */ |
42 bool hasLocalMatrix() const { return !fLocalMatrix.isIdentity(); } | 44 bool hasLocalMatrix() const { return !fLocalMatrix.isIdentity(); } |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 SkMatrix fTotalInverse; | 367 SkMatrix fTotalInverse; |
366 uint8_t fPaintAlpha; | 368 uint8_t fPaintAlpha; |
367 uint8_t fDeviceConfig; | 369 uint8_t fDeviceConfig; |
368 uint8_t fTotalInverseClass; | 370 uint8_t fTotalInverseClass; |
369 SkDEBUGCODE(SkBool8 fInSetContext;) | 371 SkDEBUGCODE(SkBool8 fInSetContext;) |
370 | 372 |
371 static SkShader* CreateBitmapShader(const SkBitmap& src, | 373 static SkShader* CreateBitmapShader(const SkBitmap& src, |
372 TileMode, TileMode, | 374 TileMode, TileMode, |
373 void* storage, size_t storageSize); | 375 void* storage, size_t storageSize); |
374 friend class SkAutoBitmapShaderInstall; | 376 friend class SkAutoBitmapShaderInstall; |
375 typedef SkFlattenable INHERITED; | |
376 }; | 377 }; |
377 | 378 |
378 #endif | 379 #endif |
OLD | NEW |