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

Unified Diff: src/pathops/SkOpTAllocator.h

Issue 853223002: new files for pathops geometric intersection (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove visualizer tool so cl contains only pure adds 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/pathops/SkOpCubicHull.cpp ('k') | src/pathops/SkPathOpsCubicSect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpTAllocator.h
diff --git a/src/pathops/SkOpTAllocator.h b/src/pathops/SkOpTAllocator.h
new file mode 100644
index 0000000000000000000000000000000000000000..c80c12f63b09f9e39219a2495d75e369ae0c21e1
--- /dev/null
+++ b/src/pathops/SkOpTAllocator.h
@@ -0,0 +1,27 @@
+/*
+ * 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 SkOpTAllocator_DEFINED
+#define SkOpTAllocator_DEFINED
+
+#include "SkChunkAlloc.h"
+
+// T is SkOpAngle2, SkOpSpan2, or SkOpSegment2
+template<typename T>
+class SkOpTAllocator {
+public:
+ static T* Allocate(SkChunkAlloc* allocator) {
+ void* ptr = allocator->allocThrow(sizeof(T));
+ T* record = (T*) ptr;
+ return record;
+ }
+
+ static T* New(SkChunkAlloc* allocator) {
+ return new (Allocate(allocator)) T();
+ }
+};
+
+#endif
« no previous file with comments | « src/pathops/SkOpCubicHull.cpp ('k') | src/pathops/SkPathOpsCubicSect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698