OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "GrCustomCoordsTextureEffect.h" | 8 #include "GrCustomCoordsTextureEffect.h" |
9 #include "gl/builders/GrGLFullProgramBuilder.h" | 9 #include "gl/builders/GrGLFullProgramBuilder.h" |
10 #include "gl/GrGLProcessor.h" | 10 #include "gl/GrGLProcessor.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 kVec2f_GrSLType, | 65 kVec2f_GrSLType, |
66 GrShaderVar::kAttribute
_TypeModifier))) { | 66 GrShaderVar::kAttribute
_TypeModifier))) { |
67 this->addTextureAccess(&fTextureAccess); | 67 this->addTextureAccess(&fTextureAccess); |
68 } | 68 } |
69 | 69 |
70 bool GrCustomCoordsTextureEffect::onIsEqual(const GrProcessor& other) const { | 70 bool GrCustomCoordsTextureEffect::onIsEqual(const GrProcessor& other) const { |
71 const GrCustomCoordsTextureEffect& cte = other.cast<GrCustomCoordsTextureEff
ect>(); | 71 const GrCustomCoordsTextureEffect& cte = other.cast<GrCustomCoordsTextureEff
ect>(); |
72 return fTextureAccess == cte.fTextureAccess; | 72 return fTextureAccess == cte.fTextureAccess; |
73 } | 73 } |
74 | 74 |
75 void GrCustomCoordsTextureEffect::getConstantColorComponents(GrColor* color, | 75 void GrCustomCoordsTextureEffect::onGetConstantColorComponents(GrColor* color, u
int32_t* validFlags, |
76 uint32_t* validFlag
s) const { | 76 bool* isSingleCom
ponent) const { |
77 if ((*validFlags & kA_GrColorComponentFlag) && 0xFF == GrColorUnpackA(*color
) && | 77 if ((*validFlags & kA_GrColorComponentFlag) && 0xFF == GrColorUnpackA(*color
) && |
78 GrPixelConfigIsOpaque(this->texture(0)->config())) { | 78 GrPixelConfigIsOpaque(this->texture(0)->config())) { |
79 *validFlags = kA_GrColorComponentFlag; | 79 *validFlags = kA_GrColorComponentFlag; |
80 } else { | 80 } else { |
81 *validFlags = 0; | 81 *validFlags = 0; |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 const GrBackendGeometryProcessorFactory& GrCustomCoordsTextureEffect::getFactory
() const { | 85 const GrBackendGeometryProcessorFactory& GrCustomCoordsTextureEffect::getFactory
() const { |
86 return GrTBackendGeometryProcessorFactory<GrCustomCoordsTextureEffect>::getI
nstance(); | 86 return GrTBackendGeometryProcessorFactory<GrCustomCoordsTextureEffect>::getI
nstance(); |
(...skipping 16 matching lines...) Expand all Loading... |
103 }; | 103 }; |
104 SkShader::TileMode tileModes[] = { | 104 SkShader::TileMode tileModes[] = { |
105 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 105 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
106 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 106 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
107 }; | 107 }; |
108 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : | 108 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : |
109 GrTextureParams::kNon
e_FilterMode); | 109 GrTextureParams::kNon
e_FilterMode); |
110 | 110 |
111 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); | 111 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); |
112 } | 112 } |
OLD | NEW |