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

Unified Diff: include/core/SkCanvas.h

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 | « experimental/PdfViewer/SkNulCanvas.h ('k') | include/utils/SkDeferredCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 50d319c7721f56ce5f4c240290ac1f40f578fe3b..773df89d789843ee4ef5b042403c57136afb94e6 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -358,7 +358,7 @@ public:
by calls to save/restore.
@return The value to pass to restoreToCount() to balance this save()
*/
- int save(SaveFlags flags = kMatrixClip_SaveFlag);
+ virtual int save(SaveFlags flags = kMatrixClip_SaveFlag);
/** This behaves the same as save(), but in addition it allocates an
offscreen bitmap. All drawing calls are directed there, and only when
@@ -373,8 +373,8 @@ public:
@param flags LayerFlags
@return The value to pass to restoreToCount() to balance this save()
*/
- int saveLayer(const SkRect* bounds, const SkPaint* paint,
- SaveFlags flags = kARGB_ClipLayer_SaveFlag);
+ virtual int saveLayer(const SkRect* bounds, const SkPaint* paint,
+ SaveFlags flags = kARGB_ClipLayer_SaveFlag);
/** This behaves the same as save(), but in addition it allocates an
offscreen bitmap. All drawing calls are directed there, and only when
@@ -396,7 +396,7 @@ public:
call.
It is an error to call restore() more times than save() was called.
*/
- void restore();
+ virtual void restore();
/** Returns the number of matrix/clip states on the SkCanvas' private stack.
This will equal # save() calls - # restore() calls + 1. The save count on
@@ -1178,14 +1178,6 @@ protected:
// default impl defers to its device
virtual const void* onPeekPixels(SkImageInfo*, size_t* rowBytes);
- // Subclass save/restore notifiers. These are called *before* updating the canvas state.
- // Overriders should call the corresponding INHERITED method up the inheritance chain.
- // For onSaveLayer(), returning false suppresses full layer allocation (and forces
- // the base impl to only perform a state save + bounds clip).
- virtual void onSave(SaveFlags);
- virtual bool onSaveLayer(const SkRect*, const SkPaint*, SaveFlags);
- virtual void onRestore();
-
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&);
enum ClipEdgeStyle {
@@ -1285,7 +1277,7 @@ private:
const SkRect& dst, const SkPaint* paint);
void internalDrawPaint(const SkPaint& paint);
int internalSaveLayer(const SkRect* bounds, const SkPaint* paint,
- SaveFlags, bool justForImageFilter, bool skipLayer);
+ SaveFlags, bool justForImageFilter);
void internalDrawDevice(SkBaseDevice*, int x, int y, const SkPaint*);
// shared by save() and saveLayer()
« no previous file with comments | « experimental/PdfViewer/SkNulCanvas.h ('k') | include/utils/SkDeferredCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698