| 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 25 matching lines...) Expand all Loading... |
| 36 SK_DECLARE_INST_COUNT(SkShader) | 36 SK_DECLARE_INST_COUNT(SkShader) |
| 37 | 37 |
| 38 SkShader(const SkMatrix* localMatrix = NULL); | 38 SkShader(const SkMatrix* localMatrix = NULL); |
| 39 virtual ~SkShader(); | 39 virtual ~SkShader(); |
| 40 | 40 |
| 41 /** | 41 /** |
| 42 * Returns the local matrix. | 42 * Returns the local matrix. |
| 43 */ | 43 */ |
| 44 const SkMatrix& getLocalMatrix() const { return fLocalMatrix; } | 44 const SkMatrix& getLocalMatrix() const { return fLocalMatrix; } |
| 45 | 45 |
| 46 #ifdef SK_SUPPORT_LEGACY_SHADER_LOCALMATRIX | |
| 47 /** | 46 /** |
| 48 * Returns true if the local matrix is not an identity matrix. | 47 * Returns true if the local matrix is not an identity matrix. |
| 49 */ | 48 */ |
| 50 bool hasLocalMatrix() const { return !fLocalMatrix.isIdentity(); } | 49 bool hasLocalMatrix() const { return !fLocalMatrix.isIdentity(); } |
| 51 | 50 |
| 51 #ifdef SK_SUPPORT_LEGACY_SHADER_LOCALMATRIX |
| 52 /** | 52 /** |
| 53 * Set the shader's local matrix. | 53 * Set the shader's local matrix. |
| 54 * @param localM The shader's new local matrix. | 54 * @param localM The shader's new local matrix. |
| 55 */ | 55 */ |
| 56 void setLocalMatrix(const SkMatrix& localM) { fLocalMatrix = localM; } | 56 void setLocalMatrix(const SkMatrix& localM) { fLocalMatrix = localM; } |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * Reset the shader's local matrix to identity. | 59 * Reset the shader's local matrix to identity. |
| 60 */ | 60 */ |
| 61 void resetLocalMatrix() { fLocalMatrix.reset(); } | 61 void resetLocalMatrix() { fLocalMatrix.reset(); } |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 */ | 461 */ |
| 462 virtual Context* onCreateContext(const ContextRec&, void* storage) const; | 462 virtual Context* onCreateContext(const ContextRec&, void* storage) const; |
| 463 | 463 |
| 464 private: | 464 private: |
| 465 SkMatrix fLocalMatrix; | 465 SkMatrix fLocalMatrix; |
| 466 | 466 |
| 467 typedef SkFlattenable INHERITED; | 467 typedef SkFlattenable INHERITED; |
| 468 }; | 468 }; |
| 469 | 469 |
| 470 #endif | 470 #endif |
| OLD | NEW |