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 #ifndef SkShader_DEFINED | 8 #ifndef SkShader_DEFINED |
9 #define SkShader_DEFINED | 9 #define SkShader_DEFINED |
10 | 10 |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
406 * and, if not NULL, the localMatrix. If not, return NULL and ignore the lo calMatrix parameter. | 406 * and, if not NULL, the localMatrix. If not, return NULL and ignore the lo calMatrix parameter. |
407 * | 407 * |
408 * Note: the returned shader (if not NULL) will have been ref'd, and it is the responsibility | 408 * Note: the returned shader (if not NULL) will have been ref'd, and it is the responsibility |
409 * of the caller to balance that with unref() when they are done. | 409 * of the caller to balance that with unref() when they are done. |
410 */ | 410 */ |
411 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const; | 411 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const; |
412 | 412 |
413 SK_TO_STRING_VIRT() | 413 SK_TO_STRING_VIRT() |
414 SK_DEFINE_FLATTENABLE_TYPE(SkShader) | 414 SK_DEFINE_FLATTENABLE_TYPE(SkShader) |
415 | 415 |
416 // Should be protected, but sometimes a subclass needs to call it on another shader | |
417 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; | |
f(malita)
2015/09/15 15:01:41
Befriend SkBitmapProcShader instead?
| |
418 | |
416 protected: | 419 protected: |
417 void flatten(SkWriteBuffer&) const override; | 420 void flatten(SkWriteBuffer&) const override; |
418 | 421 |
419 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; | |
420 | |
421 /** | 422 /** |
422 * Your subclass must also override contextSize() if it overrides onCreateC ontext(). | 423 * Your subclass must also override contextSize() if it overrides onCreateC ontext(). |
423 * Base class impl returns NULL. | 424 * Base class impl returns NULL. |
424 */ | 425 */ |
425 virtual Context* onCreateContext(const ContextRec&, void* storage) const; | 426 virtual Context* onCreateContext(const ContextRec&, void* storage) const; |
426 | 427 |
427 virtual bool onAsLuminanceColor(SkColor*) const { | 428 virtual bool onAsLuminanceColor(SkColor*) const { |
428 return false; | 429 return false; |
429 } | 430 } |
430 | 431 |
431 virtual bool onIsABitmap(SkBitmap*, SkMatrix*, TileMode[2]) const { | 432 virtual bool onIsABitmap(SkBitmap*, SkMatrix*, TileMode[2]) const { |
432 return false; | 433 return false; |
433 } | 434 } |
434 | 435 |
435 private: | 436 private: |
436 // This is essentially const, but not officially so it can be modified in | 437 // This is essentially const, but not officially so it can be modified in |
437 // constructors. | 438 // constructors. |
438 SkMatrix fLocalMatrix; | 439 SkMatrix fLocalMatrix; |
439 | 440 |
440 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor. | 441 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor. |
441 friend class SkLocalMatrixShader; | 442 friend class SkLocalMatrixShader; |
442 | 443 |
443 typedef SkFlattenable INHERITED; | 444 typedef SkFlattenable INHERITED; |
444 }; | 445 }; |
445 | 446 |
446 #endif | 447 #endif |
OLD | NEW |