| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 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 GrSingleTextureEffect_DEFINED | 8 #ifndef GrSingleTextureEffect_DEFINED |
| 9 #define GrSingleTextureEffect_DEFINED | 9 #define GrSingleTextureEffect_DEFINED |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 this->getMatrix().cheapEqualTo(other.getMatrix()) && | 47 this->getMatrix().cheapEqualTo(other.getMatrix()) && |
| 48 fCoordsType == other.fCoordsType; | 48 fCoordsType == other.fCoordsType; |
| 49 } | 49 } |
| 50 | 50 |
| 51 /** | 51 /** |
| 52 * Can be used as a helper to implement subclass getConstantColorComponents(
). It assumes that | 52 * Can be used as a helper to implement subclass getConstantColorComponents(
). It assumes that |
| 53 * the subclass output color will be a modulation of the input color with a
value read from the | 53 * the subclass output color will be a modulation of the input color with a
value read from the |
| 54 * texture. | 54 * texture. |
| 55 */ | 55 */ |
| 56 void updateConstantColorComponentsForModulation(GrColor* color, uint32_t* va
lidFlags) const { | 56 void updateConstantColorComponentsForModulation(GrColor* color, uint32_t* va
lidFlags) const { |
| 57 if ((*validFlags & kA_ValidComponentFlag) && 0xFF == GrColorUnpackA(*col
or) && | 57 if ((*validFlags & kA_GrColorComponentFlag) && 0xFF == GrColorUnpackA(*c
olor) && |
| 58 GrPixelConfigIsOpaque(this->texture(0)->config())) { | 58 GrPixelConfigIsOpaque(this->texture(0)->config())) { |
| 59 *validFlags = kA_ValidComponentFlag; | 59 *validFlags = kA_GrColorComponentFlag; |
| 60 } else { | 60 } else { |
| 61 *validFlags = 0; | 61 *validFlags = 0; |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 GrTextureAccess fTextureAccess; | 66 GrTextureAccess fTextureAccess; |
| 67 SkMatrix fMatrix; | 67 SkMatrix fMatrix; |
| 68 CoordsType fCoordsType; | 68 CoordsType fCoordsType; |
| 69 | 69 |
| 70 typedef GrEffect INHERITED; | 70 typedef GrEffect INHERITED; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 #endif | 73 #endif |
| OLD | NEW |