aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-01-30 14:44:22 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-30 14:44:22 -0800
commit7f14c9bbf1954a88226a0b56f1abb1a17f31534c (patch)
treeed293be50c7e7130b96a2ea0bd2fe121b7b1af14 /src/gpu/effects
parentedc93bc74003e2c19219ba0b30383868b5371a96 (diff)
Revert of Add device space "nudge" to gpu draws (patchset #6 id:90001 of https://codereview.chromium.org/877473005/)
Reason for revert: Blink layout tests this time :( Original issue's description: > Add device space "nudge" to gpu draws > > This CL nudges all the GPU draws and clips slightly to match raster's round behavior for BW draws. We assume the effect will be negligible and do it for AA draws too. > > BUG=423834 > > Committed: https://skia.googlesource.com/skia/+/2d55d07501c56310f97d2092d789a2bc9fa01b78 > > Committed: https://skia.googlesource.com/skia/+/b9329991426d0b77ea194a380d72d73fb855308a TBR=bsalomon@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=423834 Review URL: https://codereview.chromium.org/886153002
Diffstat (limited to 'src/gpu/effects')
-rw-r--r--src/gpu/effects/GrConvexPolyEffect.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index 615c341ef2..7035094fa6 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -137,14 +137,10 @@ void GLAARectEffect::emitCode(GrGLFPBuilder* builder,
fsBuilder->codeAppendf("\t\tfloat alpha = (1.0 + max(xSub, -1.0)) * (1.0 + max(ySub, -1.0));\n");
} else {
fsBuilder->codeAppendf("\t\tfloat alpha = 1.0;\n");
- fsBuilder->codeAppendf("\t\talpha *= (%s.x - %s.x) > -0.5 ? 1.0 : 0.0;\n",
- fragmentPos, rectName);
- fsBuilder->codeAppendf("\t\talpha *= (%s.z - %s.x) > -0.5 ? 1.0 : 0.0;\n",
- rectName, fragmentPos);
- fsBuilder->codeAppendf("\t\talpha *= (%s.y - %s.y) > -0.5 ? 1.0 : 0.0;\n",
- fragmentPos, rectName);
- fsBuilder->codeAppendf("\t\talpha *= (%s.w - %s.y) > -0.5 ? 1.0 : 0.0;\n",
- rectName, fragmentPos);
+ fsBuilder->codeAppendf("\t\talpha *= (%s.x - %s.x) > -0.5 ? 1.0 : 0.0;\n", fragmentPos, rectName);
+ fsBuilder->codeAppendf("\t\talpha *= (%s.z - %s.x) > -0.5 ? 1.0 : 0.0;\n", rectName, fragmentPos);
+ fsBuilder->codeAppendf("\t\talpha *= (%s.y - %s.y) > -0.5 ? 1.0 : 0.0;\n", fragmentPos, rectName);
+ fsBuilder->codeAppendf("\t\talpha *= (%s.w - %s.y) > -0.5 ? 1.0 : 0.0;\n", rectName, fragmentPos);
}
if (GrProcessorEdgeTypeIsInverseFill(aare.getEdgeType())) {
@@ -158,10 +154,8 @@ void GLAARectEffect::setData(const GrGLProgramDataManager& pdman, const GrProces
const AARectEffect& aare = processor.cast<AARectEffect>();
const SkRect& rect = aare.getRect();
if (rect != fPrevRect) {
- // Add a device space "nudge" of 0.05f, 0.05f to match raster's rounding behavior for
- // BW clipping/drawing
- pdman.set4f(fRectUniform, rect.fLeft + 0.55f, rect.fTop + 0.55f,
- rect.fRight - 0.45f, rect.fBottom - 0.45f);
+ pdman.set4f(fRectUniform, rect.fLeft + 0.5f, rect.fTop + 0.5f,
+ rect.fRight - 0.5f, rect.fBottom - 0.5f);
fPrevRect = rect;
}
}
@@ -227,10 +221,7 @@ void GrGLConvexPolyEffect::emitCode(GrGLFPBuilder* builder,
fsBuilder->codeAppend("\t\tfloat edge;\n");
const char* fragmentPos = fsBuilder->fragmentPosition();
for (int i = 0; i < cpe.getEdgeCount(); ++i) {
- // Add a device space "nudge" of 0.05f, 0.05f to match raster's rounding behavior for
- // BW clipping/drawing. Since we are "nudging" fragment positions we have to go in
- // the opposite direction.
- fsBuilder->codeAppendf("\t\tedge = dot(%s[%d], vec3(%s.x - 0.05, %s.y - 0.05, 1));\n",
+ fsBuilder->codeAppendf("\t\tedge = dot(%s[%d], vec3(%s.x, %s.y, 1));\n",
edgeArrayName, i, fragmentPos, fragmentPos);
if (GrProcessorEdgeTypeIsAA(cpe.getEdgeType())) {
fsBuilder->codeAppend("\t\tedge = clamp(edge, 0.0, 1.0);\n");