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

Unified Diff: src/gpu/GrSoftwarePathRenderer.cpp

Issue 913693002: Clean up clipping code a bit (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix assert Created 5 years, 10 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/GrSoftwarePathRenderer.cpp
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 4fb7538b03f3dce4ed9ba0a6543cb8372ff711fd..364c214a60b46a30c2f92b271b6a023a20422422 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -49,13 +49,11 @@ bool get_path_and_clip_bounds(const GrDrawTarget* target,
if (NULL == rt) {
return false;
}
- *devPathBounds = SkIRect::MakeWH(rt->width(), rt->height());
target->getClip()->getConservativeBounds(rt, devClipBounds);
- // TODO: getConservativeBounds already intersects with the
- // render target's bounding box. Remove this next line
- if (!devPathBounds->intersect(*devClipBounds)) {
+ if (devClipBounds->isEmpty()) {
+ *devPathBounds = SkIRect::MakeWH(rt->width(), rt->height());
return false;
}
@@ -64,6 +62,7 @@ bool get_path_and_clip_bounds(const GrDrawTarget* target,
matrix.mapRect(&pathSBounds, path.getBounds());
SkIRect pathIBounds;
pathSBounds.roundOut(&pathIBounds);
+ *devPathBounds = *devClipBounds;
if (!devPathBounds->intersect(pathIBounds)) {
// set the correct path bounds, as this would be used later.
*devPathBounds = pathIBounds;

Powered by Google App Engine
This is Rietveld 408576698