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 "GrDistanceFieldTextureEffect.h" | 8 #include "GrDistanceFieldTextureEffect.h" |
9 #include "GrInvariantOutput.h" | 9 #include "GrInvariantOutput.h" |
10 #include "GrTexture.h" | 10 #include "GrTexture.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 key |= ComputePosKey(gp.viewMatrix()) << 25; | 178 key |= ComputePosKey(gp.viewMatrix()) << 25; |
179 b->add32(key); | 179 b->add32(key); |
180 } | 180 } |
181 | 181 |
182 private: | 182 private: |
183 GrColor fColor; | 183 GrColor fColor; |
184 UniformHandle fColorUniform; | 184 UniformHandle fColorUniform; |
185 UniformHandle fTextureSizeUni; | 185 UniformHandle fTextureSizeUni; |
186 SkISize fTextureSize; | 186 SkISize fTextureSize; |
187 UniformHandle fLuminanceUni; | 187 UniformHandle fLuminanceUni; |
| 188 #ifdef SK_GAMMA_APPLY_TO_A8 |
188 float fLuminance; | 189 float fLuminance; |
| 190 #endif |
189 | 191 |
190 typedef GrGLGeometryProcessor INHERITED; | 192 typedef GrGLGeometryProcessor INHERITED; |
191 }; | 193 }; |
192 | 194 |
193 /////////////////////////////////////////////////////////////////////////////// | 195 /////////////////////////////////////////////////////////////////////////////// |
194 | 196 |
195 GrDistanceFieldTextureEffect::GrDistanceFieldTextureEffect(GrColor color, | 197 GrDistanceFieldTextureEffect::GrDistanceFieldTextureEffect(GrColor color, |
196 const SkMatrix& viewM
atrix, | 198 const SkMatrix& viewM
atrix, |
197 GrTexture* texture, | 199 GrTexture* texture, |
198 const GrTextureParams
& params, | 200 const GrTextureParams
& params, |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 uint32_t flags = kUseLCD_DistanceFieldEffectFlag; | 873 uint32_t flags = kUseLCD_DistanceFieldEffectFlag; |
872 flags |= random->nextBool() ? kUniformScale_DistanceFieldEffectMask : 0; | 874 flags |= random->nextBool() ? kUniformScale_DistanceFieldEffectMask : 0; |
873 flags |= random->nextBool() ? kBGR_DistanceFieldEffectFlag : 0; | 875 flags |= random->nextBool() ? kBGR_DistanceFieldEffectFlag : 0; |
874 return GrDistanceFieldLCDTextureEffect::Create(GrRandomColor(random), | 876 return GrDistanceFieldLCDTextureEffect::Create(GrRandomColor(random), |
875 GrProcessorUnitTest::TestMatr
ix(random), | 877 GrProcessorUnitTest::TestMatr
ix(random), |
876 textures[texIdx], params, | 878 textures[texIdx], params, |
877 textures[texIdx2], params2, | 879 textures[texIdx2], params2, |
878 textColor, | 880 textColor, |
879 flags); | 881 flags); |
880 } | 882 } |
OLD | NEW |