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

Unified Diff: skia/ext/skia_utils_mac.mm

Issue 9578010: Remove implicit dependency from 'skia' on 'ui'. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 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
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm
index 6781a93f120df52c358ec6de5eccb60d97817190..d6394602985f3ed98b8c191181314e255fff8576 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())
Robert Sesek 2012/03/05 15:49:46 Remove this condition; it's logic that would only
Nico 2012/03/05 15:58:35 Why's that? -currentContext could return nil, coul
Robert Sesek 2012/03/05 17:23:58 Because we're in a drawing context. The scoper is
Nico 2012/03/05 17:33:00 I don't understand, can you expand a bit? Why is -
Robert Sesek 2012/03/05 17:40:04 DAMN YOU RIETEVELD. I thought this was in |-drawRe
+ [NSGraphicsContext setCurrentContext:nil];
+
return bitmap;
}
« 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