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

Unified Diff: src/gpu/GrGeometryData.h

Issue 862823004: Revert of GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: Created 5 years, 11 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 | « src/gpu/GrFlushToGpuDrawTarget.h ('k') | src/gpu/GrGeometryProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGeometryData.h
diff --git a/src/gpu/GrGeometryData.h b/src/gpu/GrGeometryData.h
new file mode 100644
index 0000000000000000000000000000000000000000..a4e9fe6871165d09f41156b5891e5275948bb174
--- /dev/null
+++ b/src/gpu/GrGeometryData.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrGeometryData_DEFINED
+#define GrGeometryData_DEFINED
+
+#include <new>
+#include "SkTypes.h"
+
+/*
+ * A super lightweight base class for GeometryProcessor's to use to store draw data in a reorderable
+ * fashion. Its most important feature is a pool allocator. Its virtual, but only so subclasses
+ * will have their destructors called.
+ */
+
+class GrGeometryData : SkNoncopyable {
+public:
+ virtual ~GrGeometryData() {}
+
+ /**
+ * Helper for down-casting to a GrGeometryData subclass
+ */
+ template <typename T> const T& cast() const { return *static_cast<const T*>(this); }
+
+ void* operator new(size_t size);
+
+ void operator delete(void* target);
+
+ void* operator new(size_t size, void* placement) {
+ return ::operator new(size, placement);
+ }
+
+ void operator delete(void* target, void* placement) {
+ ::operator delete(target, placement);
+ }
+};
+
+#endif
« no previous file with comments | « src/gpu/GrFlushToGpuDrawTarget.h ('k') | src/gpu/GrGeometryProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698