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 #include "GrTextureDomain.h" | 8 #include "GrTextureDomain.h" |
9 #include "GrSimpleTextureEffect.h" | 9 #include "GrSimpleTextureEffect.h" |
10 #include "GrTBackendEffectFactory.h" | 10 #include "GrTBackendEffectFactory.h" |
11 #include "gl/GrGLEffect.h" | 11 #include "gl/GrGLEffect.h" |
| 12 #include "gl/GrGLShaderBuilder.h" |
12 #include "SkFloatingPoint.h" | 13 #include "SkFloatingPoint.h" |
13 | 14 |
14 | 15 |
15 GrTextureDomain::GrTextureDomain(const SkRect& domain, Mode mode, int index) | 16 GrTextureDomain::GrTextureDomain(const SkRect& domain, Mode mode, int index) |
16 : fIndex(index) { | 17 : fIndex(index) { |
17 | 18 |
18 static const SkRect kFullRect = {0, 0, SK_Scalar1, SK_Scalar1}; | 19 static const SkRect kFullRect = {0, 0, SK_Scalar1, SK_Scalar1}; |
19 if (domain.contains(kFullRect) && kClamp_Mode == mode) { | 20 if (domain.contains(kFullRect) && kClamp_Mode == mode) { |
20 fMode = kIgnore_Mode; | 21 fMode = kIgnore_Mode; |
21 } else { | 22 } else { |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); | 270 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); |
270 bool bilerp = random->nextBool(); | 271 bool bilerp = random->nextBool(); |
271 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo
rdSet; | 272 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo
rdSet; |
272 return GrTextureDomainEffect::Create(textures[texIdx], | 273 return GrTextureDomainEffect::Create(textures[texIdx], |
273 matrix, | 274 matrix, |
274 domain, | 275 domain, |
275 mode, | 276 mode, |
276 bilerp ? GrTextureParams::kBilerp_Filte
rMode : GrTextureParams::kNone_FilterMode, | 277 bilerp ? GrTextureParams::kBilerp_Filte
rMode : GrTextureParams::kNone_FilterMode, |
277 coords); | 278 coords); |
278 } | 279 } |
OLD | NEW |