| 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 /** | 445 /** |
| 446 * If this shader can be represented by another shader + a localMatrix, ret
urn that shader | 446 * If this shader can be represented by another shader + a localMatrix, ret
urn that shader |
| 447 * and, if not NULL, the localMatrix. If not, return NULL and ignore the lo
calMatrix parameter. | 447 * and, if not NULL, the localMatrix. If not, return NULL and ignore the lo
calMatrix parameter. |
| 448 * | 448 * |
| 449 * Note: the returned shader (if not NULL) will have been ref'd, and it is
the responsibility | 449 * Note: the returned shader (if not NULL) will have been ref'd, and it is
the responsibility |
| 450 * of the caller to balance that with unref() when they are done. | 450 * of the caller to balance that with unref() when they are done. |
| 451 */ | 451 */ |
| 452 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const; | 452 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const; |
| 453 | 453 |
| 454 SK_TO_STRING_VIRT() | 454 SK_TO_STRING_VIRT() |
| 455 SK_DEFINE_FLATTENABLE_TYPE(SkShader) | |
| 456 | 455 |
| 457 protected: | 456 protected: |
| 458 void flatten(SkWriteBuffer&) const override; | 457 void flatten(SkWriteBuffer&) const override; |
| 459 | 458 |
| 460 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; | 459 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; |
| 461 | 460 |
| 462 /** | 461 /** |
| 463 * Your subclass must also override contextSize() if it overrides onCreateC
ontext(). | 462 * Your subclass must also override contextSize() if it overrides onCreateC
ontext(). |
| 464 * Base class impl returns NULL. | 463 * Base class impl returns NULL. |
| 465 */ | 464 */ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 485 SkMatrix fLocalMatrix; | 484 SkMatrix fLocalMatrix; |
| 486 | 485 |
| 487 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. | 486 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. |
| 488 friend class SkLocalMatrixShader; | 487 friend class SkLocalMatrixShader; |
| 489 friend class SkBitmapProcShader; // for computeTotalInverse() | 488 friend class SkBitmapProcShader; // for computeTotalInverse() |
| 490 | 489 |
| 491 typedef SkFlattenable INHERITED; | 490 typedef SkFlattenable INHERITED; |
| 492 }; | 491 }; |
| 493 | 492 |
| 494 #endif | 493 #endif |
| OLD | NEW |