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

Unified Diff: gpu/command_buffer/client/share_group.cc

Issue 169403005: command_buffer: Implement path rendering functions for CHROMIUM_path_rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nv-pr-02-texgen
Patch Set: rebase and cleanup ids Created 6 years, 2 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: gpu/command_buffer/client/share_group.cc
diff --git a/gpu/command_buffer/client/share_group.cc b/gpu/command_buffer/client/share_group.cc
index 96ab8d181be01ab52edda453043ad4bbd451bf78..692dfc25e1db5065e40a8237369e7e2288ee5bdc 100644
--- a/gpu/command_buffer/client/share_group.cc
+++ b/gpu/command_buffer/client/share_group.cc
@@ -227,6 +227,35 @@ class NonReusedIdHandler : public IdHandlerInterface {
GLuint last_id_;
};
+class RangeIdHandler : public RangeIdHandlerInterface {
+ public:
+ RangeIdHandler() {}
+ virtual ~RangeIdHandler() {}
+
+ virtual void MakeIdRange(GLES2Implementation* /*gl_impl*/,
+ GLsizei n,
+ GLuint* first_id) override {
+ base::AutoLock auto_lock(lock_);
+ *first_id = id_allocator_.AllocateIDRange(n);
+ }
+
+ virtual void FreeIdRange(GLES2Implementation* gl_impl,
+ const GLuint first_id,
+ GLsizei range,
+ DeleteRangeFn delete_fn) override {
+ DCHECK(range > 0);
+ id_allocator_.FreeIDRange(first_id, range);
+ (gl_impl->*delete_fn)(first_id, range);
+ gl_impl->helper()->CommandBufferHelper::Flush();
+ }
+
+ virtual void FreeContext(GLES2Implementation* gl_impl) override {}
+
+ private:
+ base::Lock lock_;
+ IdAllocator id_allocator_;
+};
+
ShareGroup::ShareGroup(bool bind_generates_resource)
: bind_generates_resource_(bind_generates_resource) {
if (bind_generates_resource) {
@@ -246,6 +275,9 @@ ShareGroup::ShareGroup(bool bind_generates_resource)
}
}
}
+ for (auto& range_id_handler : range_id_handlers_) {
+ range_id_handler.reset(new RangeIdHandler());
+ }
program_info_manager_.reset(ProgramInfoManager::Create(false));
}

Powered by Google App Engine
This is Rietveld 408576698