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 "GrInvariantOutput.h" | 9 #include "GrInvariantOutput.h" |
10 #include "GrSimpleTextureEffect.h" | 10 #include "GrSimpleTextureEffect.h" |
11 #include "SkFloatingPoint.h" | 11 #include "SkFloatingPoint.h" |
12 #include "gl/GrGLProcessor.h" | 12 #include "gl/GrGLFragmentProcessor.h" |
13 #include "gl/builders/GrGLProgramBuilder.h" | 13 #include "gl/builders/GrGLProgramBuilder.h" |
14 | 14 |
15 GrTextureDomain::GrTextureDomain(const SkRect& domain, Mode mode, int index) | 15 GrTextureDomain::GrTextureDomain(const SkRect& domain, Mode mode, int index) |
16 : fIndex(index) { | 16 : fIndex(index) { |
17 | 17 |
18 static const SkRect kFullRect = {0, 0, SK_Scalar1, SK_Scalar1}; | 18 static const SkRect kFullRect = {0, 0, SK_Scalar1, SK_Scalar1}; |
19 if (domain.contains(kFullRect) && kClamp_Mode == mode) { | 19 if (domain.contains(kFullRect) && kClamp_Mode == mode) { |
20 fMode = kIgnore_Mode; | 20 fMode = kIgnore_Mode; |
21 } else { | 21 } else { |
22 fMode = mode; | 22 fMode = mode; |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool()
: false; | 303 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool()
: false; |
304 GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrC
oordSet; | 304 GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrC
oordSet; |
305 return GrTextureDomainEffect::Create(d->fProcDataManager, | 305 return GrTextureDomainEffect::Create(d->fProcDataManager, |
306 d->fTextures[texIdx], | 306 d->fTextures[texIdx], |
307 matrix, | 307 matrix, |
308 domain, | 308 domain, |
309 mode, | 309 mode, |
310 bilerp ? GrTextureParams::kBilerp_Filte
rMode : GrTextureParams::kNone_FilterMode, | 310 bilerp ? GrTextureParams::kBilerp_Filte
rMode : GrTextureParams::kNone_FilterMode, |
311 coords); | 311 coords); |
312 } | 312 } |
OLD | NEW |