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/GrGLProgramBuilder.h" | 9 #include "gl/builders/GrGLProgramBuilder.h" |
10 #include "gl/GrGLProcessor.h" | 10 #include "gl/GrGLProcessor.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 GrCustomCoordsTextureEffect::GrCustomCoordsTextureEffect(GrTexture* texture, | 61 GrCustomCoordsTextureEffect::GrCustomCoordsTextureEffect(GrTexture* texture, |
62 const GrTextureParams&
params) | 62 const GrTextureParams&
params) |
63 : fTextureAccess(texture, params) | 63 : fTextureAccess(texture, params) |
64 , fInTextureCoords(this->addVertexAttrib(GrShaderVar("inTextureCoords", | 64 , fInTextureCoords(this->addVertexAttrib(GrShaderVar("inTextureCoords", |
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 GrGeometryProcessor& other) co
nst { |
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::onComputeInvariantOutput(InvariantOutput* inou
t) const { | 75 void GrCustomCoordsTextureEffect::onComputeInvariantOutput(InvariantOutput* inou
t) const { |
76 if (GrPixelConfigIsOpaque(this->texture(0)->config())) { | 76 if (GrPixelConfigIsOpaque(this->texture(0)->config())) { |
77 inout->mulByUnknownOpaqueColor(); | 77 inout->mulByUnknownOpaqueColor(); |
78 } else { | 78 } else { |
79 inout->mulByUnknownColor(); | 79 inout->mulByUnknownColor(); |
80 } | 80 } |
(...skipping 20 matching lines...) Expand all Loading... |
101 }; | 101 }; |
102 SkShader::TileMode tileModes[] = { | 102 SkShader::TileMode tileModes[] = { |
103 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 103 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
104 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 104 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
105 }; | 105 }; |
106 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : | 106 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : |
107 GrTextureParams::kNon
e_FilterMode); | 107 GrTextureParams::kNon
e_FilterMode); |
108 | 108 |
109 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); | 109 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); |
110 } | 110 } |
OLD | NEW |