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

Unified Diff: src/utils/SkNWayCanvas.cpp

Issue 194713008: De-virtualize SkCanvas save/restore. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Rebased 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/utils/SkLuaCanvas.cpp ('k') | src/utils/SkNoSaveLayerCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkNWayCanvas.cpp
diff --git a/src/utils/SkNWayCanvas.cpp b/src/utils/SkNWayCanvas.cpp
index a9543f9c02f4d4ad04c769d0a1e7fa6f1cab602c..58b5e6ef80d13f345d0c1a432e418f8a8043e949 100644
--- a/src/utils/SkNWayCanvas.cpp
+++ b/src/utils/SkNWayCanvas.cpp
@@ -57,29 +57,33 @@ private:
SkCanvas* fCanvas;
};
-int SkNWayCanvas::save(SaveFlags flags) {
+void SkNWayCanvas::willSave(SaveFlags flags) {
Iter iter(fList);
while (iter.next()) {
iter->save(flags);
}
- return this->INHERITED::save(flags);
+
+ this->INHERITED::willSave(flags);
}
-int SkNWayCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint,
- SaveFlags flags) {
+SkCanvas::SaveLayerStrategy SkNWayCanvas::willSaveLayer(const SkRect* bounds, const SkPaint* paint,
+ SaveFlags flags) {
Iter iter(fList);
while (iter.next()) {
iter->saveLayer(bounds, paint, flags);
}
- return this->INHERITED::saveLayer(bounds, paint, flags);
+
+ this->INHERITED::willSaveLayer(bounds, paint, flags);
+ // No need for a layer.
+ return kNoLayer_SaveLayerStrategy;
}
-void SkNWayCanvas::restore() {
+void SkNWayCanvas::willRestore() {
Iter iter(fList);
while (iter.next()) {
iter->restore();
}
- this->INHERITED::restore();
+ this->INHERITED::willRestore();
}
bool SkNWayCanvas::translate(SkScalar dx, SkScalar dy) {
« no previous file with comments | « src/utils/SkLuaCanvas.cpp ('k') | src/utils/SkNoSaveLayerCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698