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

Unified Diff: src/gpu/effects/GrTextureDomain.cpp

Issue 421823003: Fix for texture domain on imagination gpus (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: removing tabs 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrTextureDomain.cpp
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index 8c5ff0019d615b308a329b859a2449da1a545820..2bad5e8fc52e4c8b95c0529fb3175027eea06ccd 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -96,11 +96,13 @@ void GrTextureDomain::GLDomain::sampleTexture(GrGLShaderBuilder* builder,
builder->fsAppendTextureLookupAndModulate(inModulateColor, sampler,
inCoords.c_str());
builder->fsCodeAppend(";\n");
+ builder->fsCodeAppendf("\tfloat x = (%s).x;\n", inCoords.c_str());
+ builder->fsCodeAppendf("\tfloat y = (%s).y;\n", inCoords.c_str());
- builder->fsCodeAppendf("\tfloat x = abs(2.0*(%s.x - %s.x)/(%s.z - %s.x) - 1.0);\n",
- inCoords.c_str(), domain, domain, domain);
- builder->fsCodeAppendf("\tfloat y = abs(2.0*(%s.y - %s.y)/(%s.w - %s.y) - 1.0);\n",
- inCoords.c_str(), domain, domain, domain);
+ builder->fsCodeAppendf("\tx = abs(2.0*(x - %s.x)/(%s.z - %s.x) - 1.0);\n",
+ domain, domain, domain);
+ builder->fsCodeAppendf("\ty = abs(2.0*(y - %s.y)/(%s.w - %s.y) - 1.0);\n",
+ domain, domain, domain);
builder->fsCodeAppend("\tfloat blend = step(1.0, max(x, y));\n");
builder->fsCodeAppendf("\t%s = mix(inside, outside, blend);\n", outColor);
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698