From d5148e331436b69e3de1a35d4bfa8492e89b3cce Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Mon, 16 Jul 2018 17:44:06 -0400 Subject: Move SkNoncopyable to include/private. Change-Id: I62f60ea52faeebddecacf03d9429ac3f7c516b8e Reviewed-on: https://skia-review.googlesource.com/141823 Commit-Queue: Ben Wagner Reviewed-by: Ben Wagner --- modules/skottie/include/Skottie.h | 5 ++++- modules/skottie/src/SkottieTool.cpp | 6 +++--- modules/sksg/include/SkSGInvalidationController.h | 6 +++--- modules/sksg/include/SkSGScene.h | 13 ++++++------- 4 files changed, 16 insertions(+), 14 deletions(-) (limited to 'modules') diff --git a/modules/skottie/include/Skottie.h b/modules/skottie/include/Skottie.h index 54f293c849..428a3a6de0 100644 --- a/modules/skottie/include/Skottie.h +++ b/modules/skottie/include/Skottie.h @@ -24,9 +24,12 @@ namespace sksg { class Scene; } namespace skottie { -class SK_API ResourceProvider : public SkNoncopyable { +class SK_API ResourceProvider { public: + ResourceProvider() = default; virtual ~ResourceProvider() = default; + ResourceProvider(const ResourceProvider&) = delete; + ResourceProvider& operator=(const ResourceProvider&) = delete; virtual std::unique_ptr openStream(const char resource[]) const = 0; }; diff --git a/modules/skottie/src/SkottieTool.cpp b/modules/skottie/src/SkottieTool.cpp index 5e819b17e9..b62102ab42 100644 --- a/modules/skottie/src/SkottieTool.cpp +++ b/modules/skottie/src/SkottieTool.cpp @@ -32,9 +32,11 @@ DEFINE_int32(height, 600, "Render height."); namespace { -class Sink : public SkNoncopyable { +class Sink { public: virtual ~Sink() = default; + Sink(const Sink&) = delete; + Sink& operator=(const Sink&) = delete; bool handleFrame(const sk_sp& anim, size_t idx) const { const auto frame_file = SkStringPrintf("0%06d.%s", idx, fExtension.c_str()); @@ -56,8 +58,6 @@ protected: private: const SkString fExtension; - - using INHERITED = SkNoncopyable; }; class PNGSink final : public Sink { diff --git a/modules/sksg/include/SkSGInvalidationController.h b/modules/sksg/include/SkSGInvalidationController.h index df3857c1fe..d6f7bd3019 100644 --- a/modules/sksg/include/SkSGInvalidationController.h +++ b/modules/sksg/include/SkSGInvalidationController.h @@ -21,9 +21,11 @@ namespace sksg { * * Tracks dirty regions for repaint. */ -class InvalidationController : public SkNoncopyable { +class InvalidationController { public: InvalidationController(); + InvalidationController(const InvalidationController&) = delete; + InvalidationController& operator=(const InvalidationController&) = delete; void inval(const SkRect&, const SkMatrix& ctm = SkMatrix::I()); @@ -34,8 +36,6 @@ public: private: SkTDArray fRects; SkRect fBounds; - - typedef SkNoncopyable INHERITED; }; } // namespace sksg diff --git a/modules/sksg/include/SkSGScene.h b/modules/sksg/include/SkSGScene.h index 2081c1d747..95bee3029b 100644 --- a/modules/sksg/include/SkSGScene.h +++ b/modules/sksg/include/SkSGScene.h @@ -24,9 +24,11 @@ class RenderNode; * Base class for animators. * */ -class Animator : public SkNoncopyable { +class Animator { public: virtual ~Animator(); + Animator(const Animator&) = delete; + Animator& operator=(const Animator&) = delete; void tick(float t); @@ -34,9 +36,6 @@ protected: Animator(); virtual void onTick(float t) = 0; - -private: - using INHERITED = SkNoncopyable; }; using AnimatorList = std::vector>; @@ -59,10 +58,12 @@ private: * Provides high-level mehods for driving rendering and animations. * */ -class Scene final : SkNoncopyable { +class Scene final { public: static std::unique_ptr Make(sk_sp root, AnimatorList&& animators); ~Scene(); + Scene(const Scene&) = delete; + Scene& operator=(const Scene&) = delete; void render(SkCanvas*) const; void animate(float t); @@ -76,8 +77,6 @@ private: const AnimatorList fAnimators; bool fShowInval = false; - - using INHERITED = SkNoncopyable; }; } // namespace sksg -- cgit v1.2.3