From 6ca763f362f25500ffeee0cc0b5dd2b58e9f2a79 Mon Sep 17 00:00:00 2001 From: fmalita Date: Tue, 17 Jun 2014 13:52:18 -0700 Subject: [PATCH] More SaveFlags removal twiddling. This is a follow up to https://codereview.chromium.org/338913002/. More tweaks to allow migrating clients to the new API. 1) switch the shim call direction willSave(SaveFlags) -> willSave() (internal users are still using the former, so external overriders of the latter will not be notified otherwise - doh) 2) ensure willSave() stays visible in SkProxyCanvas (Chromium's TimingCanvas attempts to call it explicitly). BUG=skia:2297 R=reed@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/334393008 --- include/core/SkCanvas.h | 4 ++-- include/utils/SkProxyCanvas.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 738408bf51..a08e82800c 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -1201,9 +1201,9 @@ protected: }; // Transitional, pending external clients cleanup. - virtual void willSave(SaveFlags) {} + virtual void willSave(SaveFlags) { this->willSave(); } - virtual void willSave() { this->willSave(kMatrixClip_SaveFlag); } + virtual void willSave() {} virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) { return kFullLayer_SaveLayerStrategy; } diff --git a/include/utils/SkProxyCanvas.h b/include/utils/SkProxyCanvas.h index 09bf37578b..32f103cd26 100644 --- a/include/utils/SkProxyCanvas.h +++ b/include/utils/SkProxyCanvas.h @@ -55,6 +55,9 @@ public: virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) SK_OVERRIDE; + // Transitional, to facilitate migrating subclasses to the new willSave API. + using SkCanvas::willSave; + protected: virtual void willSave(SaveFlags) SK_OVERRIDE; virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;