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

Unified Diff: src/utils/SkDeferredCanvas.cpp

Issue 194923008: 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 8b617b30e8f1fcb4ad941ab016bf0fc69e79ce59..efe750188e7103b190782c537032d9cd6b4f5a47 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -739,25 +739,28 @@ bool SkDeferredCanvas::isFullFrame(const SkRect* rect,
SkIntToScalar(canvasSize.fWidth), SkIntToScalar(canvasSize.fHeight)));
}
-void SkDeferredCanvas::onSave(SaveFlags flags) {
+int SkDeferredCanvas::save(SaveFlags flags) {
this->drawingCanvas()->save(flags);
+ int val = this->INHERITED::save(flags);
this->recordedDrawCommand();
- this->INHERITED::onSave(flags);
+
+ return val;
}
-bool SkDeferredCanvas::onSaveLayer(const SkRect* bounds, const SkPaint* paint,
- SaveFlags flags) {
+int SkDeferredCanvas::saveLayer(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();
- this->INHERITED::onSaveLayer(bounds, paint, flags);
- // No need for a full layer.
- return false;
+
+ return count;
}
-void SkDeferredCanvas::onRestore() {
+void SkDeferredCanvas::restore() {
this->drawingCanvas()->restore();
+ this->INHERITED::restore();
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