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