| 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 #ifndef SkShader_DEFINED | 8 #ifndef SkShader_DEFINED |
| 9 #define SkShader_DEFINED | 9 #define SkShader_DEFINED |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * Shaders specify the source color(s) for what is being drawn. If a paint | 26 * Shaders specify the source color(s) for what is being drawn. If a paint |
| 27 * has no shader, then the paint's color is used. If the paint has a | 27 * has no shader, then the paint's color is used. If the paint has a |
| 28 * shader, then the shader's color(s) are use instead, but they are | 28 * shader, then the shader's color(s) are use instead, but they are |
| 29 * modulated by the paint's alpha. This makes it easy to create a shader | 29 * modulated by the paint's alpha. This makes it easy to create a shader |
| 30 * once (e.g. bitmap tiling or gradient) and then change its transparency | 30 * once (e.g. bitmap tiling or gradient) and then change its transparency |
| 31 * w/o having to modify the original shader... only the paint's alpha needs | 31 * w/o having to modify the original shader... only the paint's alpha needs |
| 32 * to be modified. | 32 * to be modified. |
| 33 */ | 33 */ |
| 34 class SK_API SkShader : public SkFlattenable { | 34 class SK_API SkShader : public SkFlattenable { |
| 35 public: | 35 public: |
| 36 SK_DECLARE_INST_COUNT(SkShader) | |
| 37 | |
| 38 SkShader(const SkMatrix* localMatrix = NULL); | 36 SkShader(const SkMatrix* localMatrix = NULL); |
| 39 virtual ~SkShader(); | 37 virtual ~SkShader(); |
| 40 | 38 |
| 41 /** | 39 /** |
| 42 * Returns the local matrix. | 40 * Returns the local matrix. |
| 43 * | 41 * |
| 44 * FIXME: This can be incorrect for a Shader with its own local matrix | 42 * FIXME: This can be incorrect for a Shader with its own local matrix |
| 45 * that is also wrapped via CreateLocalMatrixShader. | 43 * that is also wrapped via CreateLocalMatrixShader. |
| 46 */ | 44 */ |
| 47 const SkMatrix& getLocalMatrix() const { return fLocalMatrix; } | 45 const SkMatrix& getLocalMatrix() const { return fLocalMatrix; } |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 // constructors. | 474 // constructors. |
| 477 SkMatrix fLocalMatrix; | 475 SkMatrix fLocalMatrix; |
| 478 | 476 |
| 479 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. | 477 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. |
| 480 friend class SkLocalMatrixShader; | 478 friend class SkLocalMatrixShader; |
| 481 | 479 |
| 482 typedef SkFlattenable INHERITED; | 480 typedef SkFlattenable INHERITED; |
| 483 }; | 481 }; |
| 484 | 482 |
| 485 #endif | 483 #endif |
| OLD | NEW |