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