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 "GrInvariantOutput.h" | 9 #include "GrInvariantOutput.h" |
10 #include "gl/builders/GrGLProgramBuilder.h" | 10 #include "gl/builders/GrGLProgramBuilder.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 kVec2f_GrSLType, | 61 kVec2f_GrSLType, |
62 GrShaderVar::kAttribute
_TypeModifier))) { | 62 GrShaderVar::kAttribute
_TypeModifier))) { |
63 this->addTextureAccess(&fTextureAccess); | 63 this->addTextureAccess(&fTextureAccess); |
64 } | 64 } |
65 | 65 |
66 bool GrCustomCoordsTextureEffect::onIsEqual(const GrGeometryProcessor& other) co
nst { | 66 bool GrCustomCoordsTextureEffect::onIsEqual(const GrGeometryProcessor& other) co
nst { |
67 return true; | 67 return true; |
68 } | 68 } |
69 | 69 |
70 void GrCustomCoordsTextureEffect::onComputeInvariantOutput(GrInvariantOutput* in
out) const { | 70 void GrCustomCoordsTextureEffect::onComputeInvariantOutput(GrInvariantOutput* in
out) const { |
71 if (GrPixelConfigIsOpaque(this->texture(0)->config())) { | 71 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) { |
| 72 inout->mulByUnknownAlpha(); |
| 73 } else if (GrPixelConfigIsOpaque(this->texture(0)->config())) { |
72 inout->mulByUnknownOpaqueColor(); | 74 inout->mulByUnknownOpaqueColor(); |
73 } else { | 75 } else { |
74 inout->mulByUnknownColor(); | 76 inout->mulByUnknownColor(); |
75 } | 77 } |
76 } | 78 } |
77 | 79 |
78 const GrBackendGeometryProcessorFactory& GrCustomCoordsTextureEffect::getFactory
() const { | 80 const GrBackendGeometryProcessorFactory& GrCustomCoordsTextureEffect::getFactory
() const { |
79 return GrTBackendGeometryProcessorFactory<GrCustomCoordsTextureEffect>::getI
nstance(); | 81 return GrTBackendGeometryProcessorFactory<GrCustomCoordsTextureEffect>::getI
nstance(); |
80 } | 82 } |
81 | 83 |
(...skipping 14 matching lines...) Expand all Loading... |
96 }; | 98 }; |
97 SkShader::TileMode tileModes[] = { | 99 SkShader::TileMode tileModes[] = { |
98 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 100 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
99 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 101 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
100 }; | 102 }; |
101 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : | 103 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : |
102 GrTextureParams::kNon
e_FilterMode); | 104 GrTextureParams::kNon
e_FilterMode); |
103 | 105 |
104 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); | 106 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); |
105 } | 107 } |
OLD | NEW |