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

Unified Diff: src/gpu/GrDefaultPathRenderer.cpp

Issue 15465005: Reland path bounds change with correct bounds for convex and hairline path renderers. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: tighter tolerances Created 7 years, 7 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
Index: src/gpu/GrDefaultPathRenderer.cpp
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index 43809ed6a34b25cd586dbd35e62057e3cdeec9d4..87deb9c4068c418a7c0ab5bac4a64b9504dea3be 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -445,7 +445,9 @@ bool GrDefaultPathRenderer::internalDrawPath(const SkPath& path,
}
}
- {
+ SkRect devBounds;
+ GetPathDevBounds(path, drawState->getRenderTarget(), viewM, &devBounds);
+
for (int p = 0; p < passCount; ++p) {
drawState->setDrawFace(drawFace[p]);
if (NULL != passes[p]) {
@@ -460,10 +462,8 @@ bool GrDefaultPathRenderer::internalDrawPath(const SkPath& path,
GrDrawState::AutoDeviceCoordDraw adcd;
if (reverse) {
GrAssert(NULL != drawState->getRenderTarget());
- // draw over the whole world.
- bounds.setLTRB(0, 0,
- SkIntToScalar(drawState->getRenderTarget()->width()),
- SkIntToScalar(drawState->getRenderTarget()->height()));
+ // draw over the dev bounds (which will be the whole dst surface for inv fill).
+ bounds = devBounds;
SkMatrix vmi;
// mapRect through persp matrix may not be correct
if (!drawState->getViewMatrix().hasPerspective() &&
@@ -483,13 +483,12 @@ bool GrDefaultPathRenderer::internalDrawPath(const SkPath& path,
}
if (indexCnt) {
target->drawIndexed(primType, 0, 0,
- vertexCnt, indexCnt);
+ vertexCnt, indexCnt, &devBounds);
} else {
- target->drawNonIndexed(primType, 0, vertexCnt);
+ target->drawNonIndexed(primType, 0, vertexCnt, &devBounds);
}
}
}
- }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698