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

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

Issue 62163004: Added support for Chrome's gpu command buffer extension BindUniformLocation. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fixed compile error on the bots + feedback. Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.cpp ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "GrTextureDomainEffect.h" 8 #include "GrTextureDomainEffect.h"
9 #include "GrSimpleTextureEffect.h" 9 #include "GrSimpleTextureEffect.h"
10 #include "GrTBackendEffectFactory.h" 10 #include "GrTBackendEffectFactory.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 }; 106 };
107 // vertical flip if necessary 107 // vertical flip if necessary
108 if (kBottomLeft_GrSurfaceOrigin == texDom.texture(0)->origin()) { 108 if (kBottomLeft_GrSurfaceOrigin == texDom.texture(0)->origin()) {
109 values[1] = 1.0f - values[1]; 109 values[1] = 1.0f - values[1];
110 values[3] = 1.0f - values[3]; 110 values[3] = 1.0f - values[3];
111 // The top and bottom were just flipped, so correct the ordering 111 // The top and bottom were just flipped, so correct the ordering
112 // of elements so that values = (l, t, r, b). 112 // of elements so that values = (l, t, r, b).
113 SkTSwap(values[1], values[3]); 113 SkTSwap(values[1], values[3]);
114 } 114 }
115 if (0 != memcmp(values, fPrevDomain, 4 * sizeof(GrGLfloat))) { 115 if (0 != memcmp(values, fPrevDomain, 4 * sizeof(GrGLfloat))) {
116 uman.set4fv(fNameUni, 0, 1, values); 116 uman.set4fv(fNameUni, 1, values);
117 memcpy(fPrevDomain, values, 4 * sizeof(GrGLfloat)); 117 memcpy(fPrevDomain, values, 4 * sizeof(GrGLfloat));
118 } 118 }
119 } 119 }
120 120
121 GrGLEffect::EffectKey GrGLTextureDomainEffect::GenKey(const GrDrawEffect& drawEf fect, 121 GrGLEffect::EffectKey GrGLTextureDomainEffect::GenKey(const GrDrawEffect& drawEf fect,
122 const GrGLCaps&) { 122 const GrGLCaps&) {
123 return drawEffect.castEffect<GrTextureDomainEffect>().wrapMode(); 123 return drawEffect.castEffect<GrTextureDomainEffect>().wrapMode();
124 } 124 }
125 125
126 126
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); 212 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random);
213 bool bilerp = random->nextBool(); 213 bool bilerp = random->nextBool();
214 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo rdSet; 214 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo rdSet;
215 return GrTextureDomainEffect::Create(textures[texIdx], 215 return GrTextureDomainEffect::Create(textures[texIdx],
216 matrix, 216 matrix,
217 domain, 217 domain,
218 wrapMode, 218 wrapMode,
219 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode, 219 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode,
220 coords); 220 coords);
221 } 221 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.cpp ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698