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

Unified Diff: Source/platform/graphics/paint/DrawingRecorder.cpp

Issue 1168093003: Expand the clip rect for cull rect verification. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clip rect modification only Created 5 years, 6 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: Source/platform/graphics/paint/DrawingRecorder.cpp
diff --git a/Source/platform/graphics/paint/DrawingRecorder.cpp b/Source/platform/graphics/paint/DrawingRecorder.cpp
index 7395b4e971e71726c817aee7b481945d5fcd16bc..34b43b3b99dd704803043d5ba30baaffd5a1f975 100644
--- a/Source/platform/graphics/paint/DrawingRecorder.cpp
+++ b/Source/platform/graphics/paint/DrawingRecorder.cpp
@@ -54,7 +54,13 @@ DrawingRecorder::DrawingRecorder(GraphicsContext& context, const DisplayItemClie
// cull rect clipping is enabled, make this explicit. This allows us to identify potential
// incorrect cull rects that might otherwise be masked due to Skia internal optimizations.
context.save();
- context.clipRect(enclosingIntRect(cullRect), NotAntiAliased, SkRegion::kIntersect_Op);
+ IntRect verificationClip = enclosingIntRect(cullRect);
+ // Expand the verification clip by one pixel to account for Skia's SkCanvas::getClipBounds()
+ // expansion, used in testing cull rects.
+ // TODO(schenney) This is not the best place to do this. Ideally, we would expand by one pixel
+ // in device (pixel) space, but to do that we would need to add the verification mode to Skia.
+ verificationClip.inflate(1);
+ context.clipRect(verificationClip, NotAntiAliased, SkRegion::kIntersect_Op);
}
#endif
}
« 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