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

Unified Diff: src/gpu/gl/GrGLNameAllocator.h

Issue 304403003: Generate path names on the client side (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 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
Index: src/gpu/gl/GrGLNameAllocator.h
diff --git a/src/gpu/gl/GrGLNameAllocator.h b/src/gpu/gl/GrGLNameAllocator.h
new file mode 100644
index 0000000000000000000000000000000000000000..bb71d4583c21a23ec103a05ffa452adfe5cebe92
--- /dev/null
+++ b/src/gpu/gl/GrGLNameAllocator.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 GrGLNameAllocator_DEFINED
+#define GrGLNameAllocator_DEFINED
+
+#include "SkRefCnt.h"
+#include "gl/GrGLFunctions.h"
bsalomon 2014/05/30 18:09:11 Is this for the GrGL data types?
Chris Dalton 2014/05/30 21:39:41 Yeah - GrGLuint. Would you prefer to use a more ge
bsalomon 2014/06/02 15:14:43 I was mostly just curious. But maybe we could sepa
+
+/**
+ * This class takes ownership of a range of OpenGL object names and manages
+ * allocations within that range. This allows the app to generate new objects
+ * on the client side without having to make round trips to the GL server.
+ */
+
+class GrGLNameAllocator {
+ class SparseNameRange;
bsalomon 2014/05/30 18:09:11 Can you move these down to the explicit private se
+ class SparseNameTree;
+ class ContiguousNameRange;
+
+public:
+ GrGLNameAllocator(GrGLuint names, GrGLuint range);
+ ~GrGLNameAllocator();
+
+ GrGLuint names() const { return fNames; }
bsalomon 2014/05/30 18:09:11 some docs here would useful
+ GrGLuint range() const { return fRange; }
+
+ GrGLuint allocateName();
+ void freeName(GrGLuint name);
+
+private:
+ const GrGLuint fNames;
+ const GrGLuint fRange;
+ SkAutoTUnref<SparseNameRange> fAllocatedNames;
+};
+
+#endif
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/gl/GrGLNameAllocator.cpp » ('j') | src/gpu/gl/GrGLNameAllocator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698