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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 * | 454 * |
455 * Note: the returned shader (if not NULL) will have been ref'd, and it is
the responsibility | 455 * Note: the returned shader (if not NULL) will have been ref'd, and it is
the responsibility |
456 * of the caller to balance that with unref() when they are done. | 456 * of the caller to balance that with unref() when they are done. |
457 */ | 457 */ |
458 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const; | 458 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const; |
459 | 459 |
460 SK_TO_STRING_VIRT() | 460 SK_TO_STRING_VIRT() |
461 SK_DEFINE_FLATTENABLE_TYPE(SkShader) | 461 SK_DEFINE_FLATTENABLE_TYPE(SkShader) |
462 | 462 |
463 protected: | 463 protected: |
| 464 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
464 SkShader(SkReadBuffer& ); | 465 SkShader(SkReadBuffer& ); |
| 466 #endif |
465 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 467 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
466 | 468 |
467 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; | 469 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; |
468 | 470 |
469 /** | 471 /** |
470 * Your subclass must also override contextSize() if it overrides onCreateC
ontext(). | 472 * Your subclass must also override contextSize() if it overrides onCreateC
ontext(). |
471 * Base class impl returns NULL. | 473 * Base class impl returns NULL. |
472 */ | 474 */ |
473 virtual Context* onCreateContext(const ContextRec&, void* storage) const; | 475 virtual Context* onCreateContext(const ContextRec&, void* storage) const; |
474 | 476 |
475 private: | 477 private: |
476 // This is essentially const, but not officially so it can be modified in | 478 // This is essentially const, but not officially so it can be modified in |
477 // constructors. | 479 // constructors. |
478 SkMatrix fLocalMatrix; | 480 SkMatrix fLocalMatrix; |
479 | 481 |
480 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. | 482 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. |
481 friend class SkLocalMatrixShader; | 483 friend class SkLocalMatrixShader; |
482 | 484 |
483 typedef SkFlattenable INHERITED; | 485 typedef SkFlattenable INHERITED; |
484 }; | 486 }; |
485 | 487 |
486 #endif | 488 #endif |
OLD | NEW |