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

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') | skia/ext/skia_utils_mac.mm » ('J')
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:
Nico 2011/05/16 15:13:00 indent 1
_cary 2011/05/16 15:58:02 Done.
+ explicit SkiaBitLocker(SkCanvas* canvas);
+ ~SkiaBitLocker();
+ CGContextRef cgContext();
+
+private:
Nico 2011/05/16 15:13:00 indent 1
_cary 2011/05/16 15:58:02 Done.
+ void releaseIfNeeded();
+ SkCanvas* m_canvas;
Nico 2011/05/16 15:13:00 we name members canvas_, not m_canvas. same in the
_cary 2011/05/16 15:58:02 Done.
+ CGContextRef m_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') | skia/ext/skia_utils_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698