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

Unified Diff: src/utils/SkDeferredCanvas.cpp

Issue 196323003: Revert of Revert "De-virtualize SkCanvas save/restore." (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 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 | « src/pipe/SkGPipeWrite.cpp ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkDeferredCanvas.cpp
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index efe750188e7103b190782c537032d9cd6b4f5a47..8b617b30e8f1fcb4ad941ab016bf0fc69e79ce59 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -739,28 +739,25 @@
SkIntToScalar(canvasSize.fWidth), SkIntToScalar(canvasSize.fHeight)));
}
-int SkDeferredCanvas::save(SaveFlags flags) {
+void SkDeferredCanvas::onSave(SaveFlags flags) {
this->drawingCanvas()->save(flags);
- int val = this->INHERITED::save(flags);
- this->recordedDrawCommand();
-
- return val;
-}
-
-int SkDeferredCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint,
- SaveFlags flags) {
+ this->recordedDrawCommand();
+ this->INHERITED::onSave(flags);
+}
+
+bool SkDeferredCanvas::onSaveLayer(const SkRect* bounds, const SkPaint* paint,
+ SaveFlags flags) {
this->drawingCanvas()->saveLayer(bounds, paint, flags);
- int count = this->INHERITED::save(flags);
- this->clipRectBounds(bounds, flags, NULL);
- this->recordedDrawCommand();
-
- return count;
-}
-
-void SkDeferredCanvas::restore() {
+ this->recordedDrawCommand();
+ this->INHERITED::onSaveLayer(bounds, paint, flags);
+ // No need for a full layer.
+ return false;
+}
+
+void SkDeferredCanvas::onRestore() {
this->drawingCanvas()->restore();
- this->INHERITED::restore();
- this->recordedDrawCommand();
+ this->recordedDrawCommand();
+ this->INHERITED::onRestore();
}
bool SkDeferredCanvas::isDrawingToLayer() const {
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698