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

Unified Diff: skia/ext/skia_utils_mac.h

Issue 7031006: Add utility for converting SkCanvas to CGContext (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 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
« no previous file with comments | « no previous file | skia/ext/skia_utils_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/skia_utils_mac.h
===================================================================
--- skia/ext/skia_utils_mac.h (revision 85477)
+++ skia/ext/skia_utils_mac.h (working copy)
@@ -15,6 +15,7 @@
struct SkPoint;
struct SkRect;
class SkBitmap;
+class SkCanvas;
class SkMatrix;
#ifdef __LP64__
typedef CGSize NSSize;
@@ -86,6 +87,20 @@
// Returns |[NSImage imageNamed:@"NSApplicationIcon"]| as SkBitmap.
SkBitmap AppplicationIconAtSize(int size);
+// Converts a SkCanvas temporarily to a CGContext
+class SkiaBitLocker {
+ public:
+ explicit SkiaBitLocker(SkCanvas* canvas);
+ ~SkiaBitLocker();
+ CGContextRef cgContext();
+
+ private:
+ void releaseIfNeeded();
+ SkCanvas* canvas_;
+ CGContextRef cgContext_;
+};
+
+
} // namespace gfx
#endif // SKIA_EXT_SKIA_UTILS_MAC_H_
« no previous file with comments | « no previous file | skia/ext/skia_utils_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698