Chromium Code Reviews| 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 425 virtual Context* onCreateContext(const ContextRec&, void* storage) const; | 425 virtual Context* onCreateContext(const ContextRec&, void* storage) const; |
| 426 | 426 |
| 427 virtual bool onAsLuminanceColor(SkColor*) const { | 427 virtual bool onAsLuminanceColor(SkColor*) const { |
| 428 return false; | 428 return false; |
| 429 } | 429 } |
| 430 | 430 |
| 431 virtual bool onIsABitmap(SkBitmap*, SkMatrix*, TileMode[2]) const { | 431 virtual bool onIsABitmap(SkBitmap*, SkMatrix*, TileMode[2]) const { |
| 432 return false; | 432 return false; |
| 433 } | 433 } |
| 434 | 434 |
| 435 /** | |
| 436 * A helper for asFragmentProcessor() implementations. Many implementations want to compute | |
| 437 * a color in a FP and then multiply that color by the incoming color's (us ually paint color's) | |
| 438 * alpha, ignoring the incoming r,g,b. This wraps a FP in a parent FP that does exactly that. | |
| 439 * There will be no input color to the wrapped FP. | |
| 440 */ | |
| 441 static const GrFragmentProcessor* MulFragmentProcesorOuputByInputAlpha( | |
|
reed1
2015/09/16 13:34:27
Curious why this is on shader, and not on GrFragme
bsalomon
2015/09/21 15:29:50
Done.
| |
| 442 const GrFragmentProcessor*); | |
| 443 | |
| 435 private: | 444 private: |
| 436 // This is essentially const, but not officially so it can be modified in | 445 // This is essentially const, but not officially so it can be modified in |
| 437 // constructors. | 446 // constructors. |
| 438 SkMatrix fLocalMatrix; | 447 SkMatrix fLocalMatrix; |
| 439 | 448 |
| 440 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor. | 449 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor. |
| 441 friend class SkLocalMatrixShader; | 450 friend class SkLocalMatrixShader; |
| 442 friend class SkBitmapProcShader; // for computeTotalInverse() | 451 friend class SkBitmapProcShader; // for computeTotalInverse() |
| 443 | 452 |
| 444 typedef SkFlattenable INHERITED; | 453 typedef SkFlattenable INHERITED; |
| 445 }; | 454 }; |
| 446 | 455 |
| 447 #endif | 456 #endif |
| OLD | NEW |