Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: src/gpu/effects/GrTextureDomain.cpp

Issue 356513003: Step towards variable length effect keys. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak comment Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698