From b17e63938fdd466e43c8f15ae19b051f3f2679bf Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Fri, 28 Jul 2017 13:41:51 -0400 Subject: Add clone methods to unit test GrFragmentProcessor classes Also adds testing of copying ImageStorageAccess and ref counts of proxies held by cloned FPs. Change-Id: Ia23220bf65b4df83d1c874b46d8525cc3540f716 Reviewed-on: https://skia-review.googlesource.com/28004 Commit-Queue: Brian Salomon Reviewed-by: Robert Phillips --- tests/GLProgramsTest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/GLProgramsTest.cpp') diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index 8b07568fdc..aca548cdf8 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -75,6 +75,8 @@ public: return new GLBigKeyProcessor; } + sk_sp clone() const override { return Make(); } + private: BigKeyProcessor() : INHERITED(kNone_OptimizationFlags) { this->initClassID(); } virtual void onGetGLSLProcessorKey(const GrShaderCaps& caps, @@ -108,6 +110,11 @@ public: GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { return new GLFP; } + sk_sp clone() const override { + auto child = this->childProcessor(0).clone(); + return child ? Make(std::move(child)) : nullptr; + } + private: class GLFP : public GrGLSLFragmentProcessor { public: -- cgit v1.2.3