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_ |