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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 * If this shader can be represented by another shader + a localMatrix, ret
urn that shader | 492 * If this shader can be represented by another shader + a localMatrix, ret
urn that shader |
493 * and, if not NULL, the localMatrix. If not, return NULL and ignore the lo
calMatrix parameter. | 493 * and, if not NULL, the localMatrix. If not, return NULL and ignore the lo
calMatrix parameter. |
494 * | 494 * |
495 * Note: the returned shader (if not NULL) will have been ref'd, and it is
the responsibility | 495 * Note: the returned shader (if not NULL) will have been ref'd, and it is
the responsibility |
496 * of the caller to balance that with unref() when they are done. | 496 * of the caller to balance that with unref() when they are done. |
497 */ | 497 */ |
498 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const; | 498 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const; |
499 | 499 |
500 SK_TO_STRING_VIRT() | 500 SK_TO_STRING_VIRT() |
501 SK_DEFINE_FLATTENABLE_TYPE(SkShader) | 501 SK_DEFINE_FLATTENABLE_TYPE(SkShader) |
| 502 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
502 | 503 |
503 protected: | 504 protected: |
504 void flatten(SkWriteBuffer&) const override; | 505 void flatten(SkWriteBuffer&) const override; |
505 | 506 |
506 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; | 507 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; |
507 | 508 |
508 /** | 509 /** |
509 * Your subclass must also override contextSize() if it overrides onCreateC
ontext(). | 510 * Your subclass must also override contextSize() if it overrides onCreateC
ontext(). |
510 * Base class impl returns NULL. | 511 * Base class impl returns NULL. |
511 */ | 512 */ |
(...skipping 17 matching lines...) Expand all Loading... |
529 return nullptr; | 530 return nullptr; |
530 } | 531 } |
531 | 532 |
532 private: | 533 private: |
533 // This is essentially const, but not officially so it can be modified in | 534 // This is essentially const, but not officially so it can be modified in |
534 // constructors. | 535 // constructors. |
535 SkMatrix fLocalMatrix; | 536 SkMatrix fLocalMatrix; |
536 | 537 |
537 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. | 538 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. |
538 friend class SkLocalMatrixShader; | 539 friend class SkLocalMatrixShader; |
539 friend class SkBitmapProcShader; // for computeTotalInverse() | 540 friend class SkBitmapProcLegacyShader; // for computeTotalInverse() |
540 | 541 |
541 typedef SkFlattenable INHERITED; | 542 typedef SkFlattenable INHERITED; |
542 }; | 543 }; |
543 | 544 |
544 #endif | 545 #endif |
OLD | NEW |