summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authormad@google.com <mad@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 21:41:54 +0000
committermad@google.com <mad@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 21:41:54 +0000
commit87ef8484fbd915ac4e527fb566422002f4d612ab (patch)
treee6180d206b0723ab073985ec5f2016a14f459127 /skia
parent9aefecc973faa549046389937bd526f00fb26b5f (diff)
downloadchromium_src-87ef8484fbd915ac4e527fb566422002f4d612ab.zip
chromium_src-87ef8484fbd915ac4e527fb566422002f4d612ab.tar.gz
chromium_src-87ef8484fbd915ac4e527fb566422002f4d612ab.tar.bz2
To help resolve the performance issue introduced when enabling the resize corner, we now keep all non-intersecting rects separately and send an array of invalidation bitmaps via IPC as opposed to a single unionized rect :-)
Review URL: http://codereview.chromium.org/108040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18090 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/bitmap_platform_device_mac.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc
index 668f4f0..41458c1 100644
--- a/skia/ext/bitmap_platform_device_mac.cc
+++ b/skia/ext/bitmap_platform_device_mac.cc
@@ -114,6 +114,9 @@ BitmapPlatformDeviceMac::\
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 @@ void BitmapPlatformDeviceMac::BitmapPlatformDeviceMacData::LoadConfig() {
// 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());