From 6968428f44e8cc42edee7e3238b37e3b3a46106f Mon Sep 17 00:00:00 2001 From: joshualitt Date: Mon, 13 Jul 2015 13:29:13 -0700 Subject: Revert of Another trivial cleanup (patchset #6 id:100001 of https://codereview.chromium.org/1229303003/) Reason for revert: breaking things Original issue's description: > Another trivial cleanup > > TBR=bsalomon@google.com > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/52e7657cd850f95e66eb23c6d138ee45149a1039 TBR=robertphillips@google.com,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1233853004 --- include/gpu/GrFragmentStage.h | 34 ++++++++++++++++++++++++++++++++++ include/gpu/GrPaint.h | 2 +- include/gpu/GrStagedProcessor.h | 41 ----------------------------------------- 3 files changed, 35 insertions(+), 42 deletions(-) create mode 100644 include/gpu/GrFragmentStage.h delete mode 100644 include/gpu/GrStagedProcessor.h (limited to 'include/gpu') diff --git a/include/gpu/GrFragmentStage.h b/include/gpu/GrFragmentStage.h new file mode 100644 index 0000000000..ca3be8a0f7 --- /dev/null +++ b/include/gpu/GrFragmentStage.h @@ -0,0 +1,34 @@ +/* + * Copyright 2010 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef GrFragmentStage_DEFINED +#define GrFragmentStage_DEFINED + +#include "GrFragmentProcessor.h" + +/** + * Wraps a GrFragmentProcessor, basically a copyable SkAutoTUnref + */ +class GrFragmentStage { +public: + explicit GrFragmentStage(const GrFragmentProcessor* proc) : fProc(SkRef(proc)) {} + + GrFragmentStage(const GrFragmentStage& other) { fProc.reset(SkRef(other.fProc.get())); } + + const GrFragmentProcessor* processor() const { return fProc.get(); } + + bool operator==(const GrFragmentStage& that) const { + return this->processor() == that.processor(); + } + + bool operator!=(const GrFragmentStage& that) const { return !(*this == that); } + +protected: + SkAutoTUnref fProc; +}; + +#endif diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h index efb3010286..22951f94a2 100644 --- a/include/gpu/GrPaint.h +++ b/include/gpu/GrPaint.h @@ -11,7 +11,7 @@ #define GrPaint_DEFINED #include "GrColor.h" -#include "GrStagedProcessor.h" +#include "GrFragmentStage.h" #include "GrProcessorDataManager.h" #include "GrXferProcessor.h" #include "effects/GrPorterDuffXferProcessor.h" diff --git a/include/gpu/GrStagedProcessor.h b/include/gpu/GrStagedProcessor.h deleted file mode 100644 index fcbc5b2992..0000000000 --- a/include/gpu/GrStagedProcessor.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2015 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef GrStagedProcessorStage_DEFINED -#define GrStagedProcessorStage_DEFINED - -#include "GrFragmentProcessor.h" -#include "SkRefCnt.h" - -/** - * Wraps a GrFragmentProcessor, basically a copyable SkAutoTUnref - * Templatized based on the ref type so backends can use the same wrapper - */ -template class T> -class GrStagedProcessor { -public: - explicit GrStagedProcessor(const GrFragmentProcessor* proc) : fProc(SkRef(proc)) {} - - GrStagedProcessor(const GrStagedProcessor& other) { fProc.reset(SkRef(other.fProc.get())); } - - const GrFragmentProcessor* processor() const { return fProc.get(); } - - bool operator==(const GrStagedProcessor& that) const { - return this->processor() == that.processor(); - } - - bool operator!=(const GrStagedProcessor& that) const { return !(*this == that); } - - const char* name() const { return fProc->name(); } - -protected: - T fProc; -}; - -typedef GrStagedProcessor GrFragmentStage; - -#endif -- cgit v1.2.3