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

Unified Diff: src/core/SkCanvas.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/core/SkBBoxHierarchyRecord.cpp ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index bd75f7dbdea0f37fc3351bbe180ebd48d40e2277..0888a01fa459615322717b5896d68bed5e0dc229 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -348,7 +348,7 @@ public:
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 @@ int SkCanvas::internalSave(SaveFlags flags) {
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 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveFlags flags,
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 @@ static SkBaseDevice* createCompatibleDevice(SkCanvas* canvas,
}
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
@@ -903,11 +891,6 @@ int SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint,
return count;
}
- // FIXME: do onSaveLayer() overriders returning false really care about the clipRectBounds()
- // call above?
- if (skipLayer)
- return count;
-
// Kill the imagefilter if our device doesn't allow it
SkLazyPaint lazyP;
if (paint && paint->getImageFilter()) {
@@ -960,14 +943,9 @@ int SkCanvas::saveLayerAlpha(const SkRect* bounds, U8CPU alpha,
}
}
-void SkCanvas::onRestore() {
- // Do nothing. Subclasses may do something.
-}
-
void SkCanvas::restore() {
// check for underflow
if (fMCStack.count() > 1) {
- this->onRestore();
this->internalRestore();
}
}
« no previous file with comments | « src/core/SkBBoxHierarchyRecord.cpp ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698