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

Unified Diff: include/utils/SkDeferredCanvas.h

Issue 545813002: Picture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: add a test case for SkDeferredCanvas::getCanvasSize into tests/DeferredCanvasTest.cpp Created 6 years, 3 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 | src/utils/SkDeferredCanvas.cpp » ('j') | src/utils/SkDeferredCanvas.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/utils/SkDeferredCanvas.h
diff --git a/include/utils/SkDeferredCanvas.h b/include/utils/SkDeferredCanvas.h
index 907cb91575043b1cfba2f16c1b27e4d6982c0516..35e6d6f55bd6e5759d81b912dfa5fc07a36fe2fe 100644
--- a/include/utils/SkDeferredCanvas.h
+++ b/include/utils/SkDeferredCanvas.h
@@ -89,6 +89,11 @@ public:
bool isFreshFrame() const;
/**
+ * Returns canvas's size.
+ */
+ SkISize getCanvasSize();
+
+ /**
* Returns true if the canvas has recorded draw commands that have
* not yet been played back.
*/
@@ -243,12 +248,14 @@ private:
void recordedDrawCommand();
SkCanvas* drawingCanvas() const;
SkCanvas* immediateCanvas() const;
- bool isFullFrame(const SkRect*, const SkPaint*) const;
+ bool isFullFrame(const SkRect*, const SkPaint*);
void validate() const;
void init();
- size_t fBitmapSizeThreshold;
- bool fDeferredDrawing;
+ size_t fBitmapSizeThreshold;
+ bool fDeferredDrawing;
+ bool fCanvasSizeChanged;
+ SkISize fCanvasSize;
friend class SkDeferredCanvasTester; // for unit testing
typedef SkCanvas INHERITED;
« no previous file with comments | « no previous file | src/utils/SkDeferredCanvas.cpp » ('j') | src/utils/SkDeferredCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698