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

Issue 195843002: Revert of De-virtualize SkCanvas save/restore. (Closed)

Created:
6 years, 9 months ago by hal.canary
Modified:
6 years, 9 months ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Revert of De-virtualize SkCanvas save/restore. (https://codereview.chromium.org/194713008/) Reason for revert: roll fix Original issue's description: > De-virtualize SkCanvas save/restore. > > This moves the state management logic into non-virtual SkCanvas methods, > and turns the virtuals into protected notifiers. > > R=robertphillips@google.com, reed@google.com > > Committed: https://code.google.com/p/skia/source/detail?r=13747 TBR=reed@google.com,robertphillips@google.com,fmalita@chromium.org NOTREECHECKS=true NOTRY=true

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -202 lines) Patch
M experimental/PdfViewer/SkNulCanvas.h View 2 chunks +7 lines, -6 lines 0 comments Download
M include/core/SkCanvas.h View 5 chunks +5 lines, -13 lines 0 comments Download
M include/utils/SkDeferredCanvas.h View 2 chunks +4 lines, -4 lines 0 comments Download
M include/utils/SkDumpCanvas.h View 2 chunks +5 lines, -4 lines 0 comments Download
M include/utils/SkLuaCanvas.h View 2 chunks +5 lines, -4 lines 0 comments Download
M include/utils/SkNWayCanvas.h View 2 chunks +4 lines, -4 lines 0 comments Download
M include/utils/SkProxyCanvas.h View 2 chunks +5 lines, -4 lines 0 comments Download
M src/core/SkBBoxHierarchyRecord.h View 2 chunks +5 lines, -4 lines 0 comments Download
M src/core/SkBBoxHierarchyRecord.cpp View 1 chunk +7 lines, -7 lines 0 comments Download
M src/core/SkCanvas.cpp View 6 chunks +3 lines, -23 lines 0 comments Download
M src/core/SkPictureRecord.h View 2 chunks +3 lines, -5 lines 0 comments Download
M src/core/SkPictureRecord.cpp View 6 chunks +15 lines, -13 lines 0 comments Download
M src/pipe/SkGPipeWrite.cpp View 4 chunks +18 lines, -21 lines 0 comments Download
M src/utils/SkDeferredCanvas.cpp View 1 chunk +19 lines, -16 lines 0 comments Download
M src/utils/SkDumpCanvas.cpp View 2 chunks +11 lines, -11 lines 0 comments Download
M src/utils/SkLuaCanvas.cpp View 2 chunks +11 lines, -14 lines 0 comments Download
M src/utils/SkNWayCanvas.cpp View 1 chunk +11 lines, -15 lines 0 comments Download
M src/utils/SkNoSaveLayerCanvas.h View 1 chunk +13 lines, -5 lines 0 comments Download
M src/utils/SkProxyCanvas.cpp View 1 chunk +6 lines, -11 lines 0 comments Download
M src/utils/debugger/SkDebugCanvas.h View 2 chunks +6 lines, -4 lines 0 comments Download
M src/utils/debugger/SkDebugCanvas.cpp View 2 chunks +11 lines, -14 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
hal.canary
Created Revert of De-virtualize SkCanvas save/restore.
6 years, 9 months ago (2014-03-11 21:45:07 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/halcanary@google.com/195843002/1
6 years, 9 months ago (2014-03-11 21:45:11 UTC) #2
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-11 21:45:37 UTC) #3
commit-bot: I haz the power
6 years, 9 months ago (2014-03-11 21:45:40 UTC) #4
Failed to apply patch for src/core/SkCanvas.cpp:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  patching file src/core/SkCanvas.cpp
  Hunk #5 FAILED at 890.
  Hunk #6 succeeded at 948 (offset 2 lines).
  1 out of 6 hunks FAILED -- saving rejects to file src/core/SkCanvas.cpp.rej

Patch:       src/core/SkCanvas.cpp
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index
85ef7d687699ed039823766aff3ea6262eaf9e53..0888a01fa459615322717b5896d68bed5e0dc229
100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -348,7 +348,7 @@
             SkPaint tmp;
             tmp.setImageFilter(fOrigPaint.getImageFilter());
             (void)canvas->internalSaveLayer(bounds, &tmp,
-                                    SkCanvas::kARGB_ClipLayer_SaveFlag, true,
false);
+                                    SkCanvas::kARGB_ClipLayer_SaveFlag, true);
             // we'll clear the imageFilter for the actual draws in next(), so
             // it will only be applied during the restore().
             fDoClearImageFilter = true;
@@ -806,12 +806,7 @@
     return saveCount;
 }
 
-void SkCanvas::onSave(SaveFlags) {
-    // Do nothing. Subclasses may do something.
-}
-
 int SkCanvas::save(SaveFlags flags) {
-    this->onSave(flags);
     // call shared impl
     return this->internalSave(flags);
 }
@@ -868,16 +863,9 @@
     return true;
 }
 
-bool SkCanvas::onSaveLayer(const SkRect*, const SkPaint*, SaveFlags) {
-    // Do nothing. Subclasses may do something.
-    return true;
-}
-
 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint,
                         SaveFlags flags) {
-    // Overriding classes may return false to signal that we don't need to
create a layer.
-    bool skipLayer = !this->onSaveLayer(bounds, paint, flags);
-    return this->internalSaveLayer(bounds, paint, flags, false, skipLayer);
+    return this->internalSaveLayer(bounds, paint, flags, false);
 }
 
 static SkBaseDevice* createCompatibleDevice(SkCanvas* canvas,
@@ -887,7 +875,7 @@
 }
 
 int SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint,
-                                SaveFlags flags, bool justForImageFilter, bool
skipLayer) {
+                                SaveFlags flags, bool justForImageFilter) {
 #ifndef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
     flags = (SaveFlags)(flags | kClipToLayer_SaveFlag);
 #endif
@@ -902,9 +890,6 @@
     if (!this->clipRectBounds(bounds, flags, &ir, paint ?
paint->getImageFilter() : NULL)) {
         return count;
     }
-
-    if (skipLayer)
-        return count;
 
     // Kill the imagefilter if our device doesn't allow it
     SkLazyPaint lazyP;
@@ -958,14 +943,9 @@
     }
 }
 
-void SkCanvas::onRestore() {
-    // Do nothing. Subclasses may do something.
-}
-
 void SkCanvas::restore() {
     // check for underflow
     if (fMCStack.count() > 1) {
-        this->onRestore();
         this->internalRestore();
     }
 }

Powered by Google App Engine
This is Rietveld 408576698