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

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 2489673002: added constant folding & branch elimination to skslc (Closed)
Patch Set: textureProj on rectangle textures now working Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/glsl/GrGLSLShaderBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index d585e097f962135130404cf90d67fa1c38aed1bb..7665c2a4ee022a6c608af47129c8006b0a12dc17 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -4005,20 +4005,17 @@ bool GrGLGpu::copySurfaceAsDraw(GrSurface* dst,
GrGLfloat sx1 = (GrGLfloat)(srcRect.fLeft + w);
GrGLfloat sy0 = (GrGLfloat)srcRect.fTop;
GrGLfloat sy1 = (GrGLfloat)(srcRect.fTop + h);
+ int sw = src->width();
int sh = src->height();
if (kBottomLeft_GrSurfaceOrigin == src->origin()) {
sy0 = sh - sy0;
sy1 = sh - sy1;
}
- // src rect edges in normalized texture space (0 to 1) unless we're using a RECTANGLE texture.
- GrGLenum srcTarget = srcTex->target();
- if (GR_GL_TEXTURE_RECTANGLE != srcTarget) {
- int sw = src->width();
- sx0 /= sw;
- sx1 /= sw;
- sy0 /= sh;
- sy1 /= sh;
- }
+ // src rect edges in normalized texture space (0 to 1)
+ sx0 /= sw;
+ sx1 /= sw;
+ sy0 /= sh;
+ sy1 /= sh;
GL_CALL(Uniform4f(fCopyPrograms[progIdx].fPosXformUniform, dx1 - dx0, dy1 - dy0, dx0, dy0));
GL_CALL(Uniform4f(fCopyPrograms[progIdx].fTexCoordXformUniform,
« no previous file with comments | « no previous file | src/gpu/glsl/GrGLSLShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698