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

Unified Diff: content/common/gpu/client/context_provider_command_buffer.h

Issue 1916923004: Request context sharing via content::ContextProviderCommandBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sharegroup: . Created 4 years, 8 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: content/common/gpu/client/context_provider_command_buffer.h
diff --git a/content/common/gpu/client/context_provider_command_buffer.h b/content/common/gpu/client/context_provider_command_buffer.h
index dc490a304cc292ea6db7c6791830432481f5f284..216f9ac9b7f6967191db3ecdae642988b0e3ecda 100644
--- a/content/common/gpu/client/context_provider_command_buffer.h
+++ b/content/common/gpu/client/context_provider_command_buffer.h
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <memory>
+#include <vector>
#include "base/compiler_specific.h"
#include "base/synchronization/lock.h"
@@ -40,6 +41,7 @@ class CONTENT_EXPORT ContextProviderCommandBuffer
ContextProviderCommandBuffer(
std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d,
const gpu::SharedMemoryLimits& memory_limits,
+ ContextProviderCommandBuffer* shared_context_provider,
CommandBufferContextType type);
gpu::CommandBufferProxyImpl* GetCommandBufferProxy();
@@ -67,9 +69,22 @@ class CONTENT_EXPORT ContextProviderCommandBuffer
void OnLostContext();
private:
+ struct SharedProviders : public base::RefCountedThreadSafe<SharedProviders> {
+ base::Lock lock;
+ std::vector<ContextProviderCommandBuffer*> list;
+
+ SharedProviders();
+
+ private:
+ friend class base::RefCountedThreadSafe<SharedProviders>;
+ ~SharedProviders();
+ };
+
base::ThreadChecker main_thread_checker_;
base::ThreadChecker context_thread_checker_;
+ scoped_refptr<SharedProviders> shared_providers_;
+
std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_;
std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_;
std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_;

Powered by Google App Engine
This is Rietveld 408576698