X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fskia%2Fext%2Fskia_utils_mac.h;h=e087867ffb483e4cb3b230d7adf2d9aa59a71a5e;hb=3545e9f2671f595d2a2f3ee75ca0393b01e35ef6;hp=6a0efdebfab60b78999e51e845cbf936b49e0e5a;hpb=7d210d4c7e9ba36e635eabc5b5780495f8a63292;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/skia/ext/skia_utils_mac.h b/src/skia/ext/skia_utils_mac.h index 6a0efde..e087867 100644 --- a/src/skia/ext/skia_utils_mac.h +++ b/src/skia/ext/skia_utils_mac.h @@ -109,16 +109,36 @@ SK_API NSImage* SkBitmapToNSImage(const SkBitmap& icon); class SK_API SkiaBitLocker { public: explicit SkiaBitLocker(SkCanvas* canvas); + SkiaBitLocker(SkCanvas* canvas, const SkIRect& userClipRect); ~SkiaBitLocker(); CGContextRef cgContext(); + bool hasEmptyClipRegion() const; private: void releaseIfNeeded(); + SkIRect computeDirtyRect(); + SkCanvas* canvas_; + + // If the user specified a clip rect it would draw into then the locker may + // skip the step of searching for a rect bounding the pixels that the user + // has drawn into. + bool userClipRectSpecified_; + CGContextRef cgContext_; SkBitmap bitmap_; SkIPoint bitmapOffset_; + + // True if we are drawing to |canvas_|'s SkBaseDevice's bits directly through + // |bitmap_|. Otherwise, the bits in |bitmap_| are our allocation and need to + // be copied over to |canvas_|. bool useDeviceBits_; + + // True if |bitmap_| is a dummy 1x1 bitmap allocated for the sake of creating + // a non-NULL CGContext (it is invalid to use a NULL CGContext), and will not + // be copied to |canvas_|. This will happen if |canvas_|'s clip region is + // empty. + bool bitmapIsDummy_; };