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

Unified Diff: skia/ext/bitmap_platform_device_mac.cc

Issue 108040: Send array of paint rects and bitmaps as opposed to a Union (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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: skia/ext/bitmap_platform_device_mac.cc
===================================================================
--- skia/ext/bitmap_platform_device_mac.cc (revision 17347)
+++ skia/ext/bitmap_platform_device_mac.cc (working copy)
@@ -114,6 +114,9 @@
clip_region_ = SkRegion(rect);
transform_.reset();
CGContextRetain(bitmap_context_);
+ // We must save the state once so that we can use the restore/save trick
+ // in LoadConfig().
+ CGContextSaveGState(bitmap_context_);
}
void BitmapPlatformDeviceMac::BitmapPlatformDeviceMacData::SetMatrixClip(
@@ -131,6 +134,15 @@
// Transform.
SkMatrix t(transform_);
+
+ // We must restore and then save the state of the graphics context since the
+ // calls to Load the clipping region to the context are strictly cummulative,
+ // i.e., you can't replace a clip rect, other than with a save/restore.
+ // But this implies that no other changes to the state are done elsewhere.
+ // If we ever get to need to change this, then we must replace the clip rect
+ // calls in LoadClippingRegionToCGContext() with an image mask instead.
+ CGContextRestoreGState(bitmap_context_);
+ CGContextSaveGState(bitmap_context_);
LoadTransformToCGContext(bitmap_context_, t);
t.setTranslateX(-t.getTranslateX());
t.setTranslateY(-t.getTranslateY());
« chrome/browser/renderer_host/render_widget_host.cc ('K') | « chrome/renderer/render_widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698