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

Unified Diff: include/gpu/GrFragmentStage.h

Issue 1233853004: Revert of Another trivial cleanup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 | « gyp/gpu.gypi ('k') | include/gpu/GrPaint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrFragmentStage.h
diff --git a/include/gpu/GrFragmentStage.h b/include/gpu/GrFragmentStage.h
new file mode 100644
index 0000000000000000000000000000000000000000..ca3be8a0f7f56c9a732f02753954166f3ccc01cf
--- /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<const GrFragmentProcessor> fProc;
+};
+
+#endif
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/GrPaint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698