diff options
Diffstat (limited to 'skia/ext/skia_utils_mac.mm')
-rw-r--r-- | skia/ext/skia_utils_mac.mm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm index 6781a93..d639460 100644 --- a/skia/ext/skia_utils_mac.mm +++ b/skia/ext/skia_utils_mac.mm @@ -14,7 +14,6 @@ #include "skia/ext/bitmap_platform_device_mac.h" #include "third_party/skia/include/core/SkRegion.h" #include "third_party/skia/include/utils/mac/SkCGUtils.h" -#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" // 10.6 API that we use if available. #if !defined(MAC_OS_X_VERSION_10_6) || \ @@ -76,7 +75,8 @@ SkBitmap NSImageOrNSImageRepToSkBitmap( DCHECK(context); // Save the current graphics context so that we can restore it later. - gfx::ScopedNSGraphicsContextSaveGState scoped_g_state; + NSGraphicsContext* old_context = [NSGraphicsContext currentContext]; + [NSGraphicsContext saveGraphicsState]; // Dummy context that we will draw into. NSGraphicsContext* context_cocoa = @@ -110,6 +110,10 @@ SkBitmap NSImageOrNSImageRepToSkBitmap( } } + [NSGraphicsContext restoreGraphicsState]; + if (!old_context && base::mac::IsOSLeopardOrEarlier()) + [NSGraphicsContext setCurrentContext:nil]; + return bitmap; } |