| 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 * | 472 * |
| 473 * Note: the returned shader (if not NULL) will have been ref'd, and it is
the responsibility | 473 * Note: the returned shader (if not NULL) will have been ref'd, and it is
the responsibility |
| 474 * of the caller to balance that with unref() when they are done. | 474 * of the caller to balance that with unref() when they are done. |
| 475 */ | 475 */ |
| 476 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const; | 476 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const; |
| 477 | 477 |
| 478 SK_TO_STRING_VIRT() | 478 SK_TO_STRING_VIRT() |
| 479 SK_DEFINE_FLATTENABLE_TYPE(SkShader) | 479 SK_DEFINE_FLATTENABLE_TYPE(SkShader) |
| 480 | 480 |
| 481 protected: | 481 protected: |
| 482 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING | |
| 483 SkShader(SkReadBuffer& ); | |
| 484 #endif | |
| 485 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 482 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
| 486 | 483 |
| 487 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; | 484 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; |
| 488 | 485 |
| 489 /** | 486 /** |
| 490 * Your subclass must also override contextSize() if it overrides onCreateC
ontext(). | 487 * Your subclass must also override contextSize() if it overrides onCreateC
ontext(). |
| 491 * Base class impl returns NULL. | 488 * Base class impl returns NULL. |
| 492 */ | 489 */ |
| 493 virtual Context* onCreateContext(const ContextRec&, void* storage) const; | 490 virtual Context* onCreateContext(const ContextRec&, void* storage) const; |
| 494 | 491 |
| 495 virtual bool onAsLuminanceColor(SkColor*) const { | 492 virtual bool onAsLuminanceColor(SkColor*) const { |
| 496 return false; | 493 return false; |
| 497 } | 494 } |
| 498 private: | 495 private: |
| 499 // This is essentially const, but not officially so it can be modified in | 496 // This is essentially const, but not officially so it can be modified in |
| 500 // constructors. | 497 // constructors. |
| 501 SkMatrix fLocalMatrix; | 498 SkMatrix fLocalMatrix; |
| 502 | 499 |
| 503 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. | 500 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. |
| 504 friend class SkLocalMatrixShader; | 501 friend class SkLocalMatrixShader; |
| 505 | 502 |
| 506 typedef SkFlattenable INHERITED; | 503 typedef SkFlattenable INHERITED; |
| 507 }; | 504 }; |
| 508 | 505 |
| 509 #endif | 506 #endif |
| OLD | NEW |