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