aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkCanvas.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-12-11 07:07:37 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-11 07:07:38 -0800
commit2ff1fcede1e9525285c5de1f35fb2dcb0fab32bd (patch)
treed031604a9c76281aa645c56a94ada8422b5b291d /include/core/SkCanvas.h
parent8da8e9d7511c2f60855c2e3334ae0fe27365bc96 (diff)
Defer saves() until they're needed
patch from issue 759443006 at patchset 40001 (http://crrev.com/759443006#ps40001) BUG=skia: Review URL: https://codereview.chromium.org/767333002
Diffstat (limited to 'include/core/SkCanvas.h')
-rw-r--r--include/core/SkCanvas.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index c4ec76aee4..d28336f715 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -1265,6 +1265,7 @@ private:
const SkSurfaceProps fProps;
+ int fSaveCount; // value returned by getSaveCount()
int fSaveLayerCount; // number of successful saveLayer calls
int fCullCount; // number of active culls
@@ -1281,6 +1282,9 @@ private:
bool fDeviceCMDirty; // cleared by updateDeviceCMCache()
void updateDeviceCMCache();
+ void doSave();
+ void checkForDeferredSave();
+
friend class SkDrawIter; // needs setupDrawForLayerDevice()
friend class AutoDrawLooper;
friend class SkLua; // needs top layer size and offset
@@ -1334,12 +1338,12 @@ private:
void internalDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint);
void internalDrawPaint(const SkPaint& paint);
- int internalSaveLayer(const SkRect* bounds, const SkPaint* paint,
- SaveFlags, bool justForImageFilter, SaveLayerStrategy strategy);
+ void internalSaveLayer(const SkRect* bounds, const SkPaint* paint,
+ SaveFlags, bool justForImageFilter, SaveLayerStrategy strategy);
void internalDrawDevice(SkBaseDevice*, int x, int y, const SkPaint*);
// shared by save() and saveLayer()
- int internalSave();
+ void internalSave();
void internalRestore();
static void DrawRect(const SkDraw& draw, const SkPaint& paint,
const SkRect& r, SkScalar textSize);