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

Unified Diff: skia/ext/skia_utils_mac.mm

Issue 9104010: Set CG clip to empty explicitly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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: skia/ext/skia_utils_mac.mm
===================================================================
--- skia/ext/skia_utils_mac.mm (revision 119710)
+++ skia/ext/skia_utils_mac.mm (working copy)
@@ -333,7 +333,15 @@
// Apply clip in device coordinates.
CGMutablePathRef clipPath = CGPathCreateMutable();
- SkRegion::Iterator iter(canvas_->getTotalClip());
+ const SkRegion& clipRgn = canvas_->getTotalClip();
+ if (clipRgn.isEmpty()) {
+ // CoreGraphics does not consider a newly created path to be empty.
+ // Explicitly set it to empty so the subsequent drawing is clipped out.
+ // It would be better to make the CGContext hidden if there was a CG call
+ // that does that.
+ CGPathAddRect(clipPath, 0, CGRectMake(0, 0, 0, 0));
+ }
+ SkRegion::Iterator iter(clipRgn);
const SkIPoint& pt = device->getOrigin();
for (; !iter.done(); iter.next()) {
SkIRect skRect = iter.rect();
« 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