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