diff options
author | paul@chromium.org <paul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-04 21:14:49 +0000 |
---|---|---|
committer | paul@chromium.org <paul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-04 21:14:49 +0000 |
commit | fc9d1979e38d323d4c036b470a71ae96eb1a931d (patch) | |
tree | 46200a431a5d7e9fec3467c9e886546fd3a62b52 /skia/ext | |
parent | 2563936473f3959210f7908c30c82bf6ec25039e (diff) | |
download | chromium_src-fc9d1979e38d323d4c036b470a71ae96eb1a931d.zip chromium_src-fc9d1979e38d323d4c036b470a71ae96eb1a931d.tar.gz chromium_src-fc9d1979e38d323d4c036b470a71ae96eb1a931d.tar.bz2 |
Fix a bug where the old graphics context was released when we were
actually trying to save it for later use.
TEST=Set download items to auto open a specific file type (eg .gz) and
repeatedly download items of that type, noticing that we no longer
crash.
BUG=17571 (http://crbug.com/17571)
Review URL: http://codereview.chromium.org/160602
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext')
-rw-r--r-- | skia/ext/skia_utils_mac.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm index 6bb0a96..7d0c23c 100644 --- a/skia/ext/skia_utils_mac.mm +++ b/skia/ext/skia_utils_mac.mm @@ -148,7 +148,7 @@ SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque) { DCHECK(context != NULL); // Save the current graphics context so that we can restore it later. - NSGraphicsContext* current_context = [NSGraphicsContext currentContext]; + [NSGraphicsContext saveGraphicsState]; // Dummy context that we will draw into. NSGraphicsContext* context_cocoa = @@ -162,7 +162,7 @@ SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque) { fraction:1.0]; // Done drawing, restore context. - [NSGraphicsContext setCurrentContext:current_context]; + [NSGraphicsContext restoreGraphicsState]; return bitmap; } |