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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.h

Issue 302603004: Plumb GpuMemoryBuffer allocation to GPU process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years, 6 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/browser/gpu/browser_gpu_channel_host_factory.h
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.h b/content/browser/gpu/browser_gpu_channel_host_factory.h
index c2637f033cc3ca00ce518c353f8c9e901037f68e..a85fd1dcd35d8f3fb7f6ef599065dc3dab20f4c6 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.h
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.h
@@ -10,12 +10,14 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/common/gpu/client/gpu_channel_host.h"
+#include "content/common/gpu/client/gpu_memory_buffer_factory_host.h"
#include "ipc/message_filter.h"
namespace content {
class CONTENT_EXPORT BrowserGpuChannelHostFactory
- : public GpuChannelHostFactory {
+ : public GpuChannelHostFactory,
+ public GpuMemoryBufferFactoryHost {
public:
static void Initialize(bool establish_gpu_channel);
static void Terminate();
@@ -42,6 +44,16 @@ class CONTENT_EXPORT BrowserGpuChannelHostFactory
unsigned internalformat,
unsigned usage) OVERRIDE;
+ // GpuMemoryBufferFactoryHost implementation.
+ virtual void CreateGpuMemoryBuffer(
+ const gfx::GpuMemoryBufferHandle& handle,
+ const gfx::Size& size,
+ unsigned internalformat,
+ unsigned usage,
+ const CreateGpuMemoryBufferCallback& callback) OVERRIDE;
+ virtual void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle,
+ int32 sync_point) OVERRIDE;
+
// Specify a task runner and callback to be used for a set of messages. The
// callback will be set up on the current GpuProcessHost, identified by
// GpuProcessHostId().
@@ -86,6 +98,20 @@ class CONTENT_EXPORT BrowserGpuChannelHostFactory
static void AddFilterOnIO(int gpu_host_id,
scoped_refptr<IPC::MessageFilter> filter);
+ void CreateGpuMemoryBufferOnIO(const gfx::GpuMemoryBufferHandle& handle,
+ const gfx::Size& size,
+ unsigned internalformat,
+ unsigned usage,
+ int32 request_id);
+ void GpuMemoryBufferCreatedOnIO(
+ int32 request_id,
+ const gfx::GpuMemoryBufferHandle& handle);
+ void OnGpuMemoryBufferCreated(
+ int32 request_id,
+ const gfx::GpuMemoryBufferHandle& handle);
+ void DestroyGpuMemoryBufferOnIO(const gfx::GpuMemoryBufferHandle& handle,
+ int32 sync_point);
+
const int gpu_client_id_;
scoped_ptr<base::WaitableEvent> shutdown_event_;
scoped_refptr<GpuChannelHost> gpu_channel_;
@@ -93,6 +119,11 @@ class CONTENT_EXPORT BrowserGpuChannelHostFactory
scoped_refptr<EstablishRequest> pending_request_;
std::vector<base::Closure> established_callbacks_;
+ uint32 next_create_gpu_memory_buffer_request_id_;
+ typedef std::map<int32, CreateGpuMemoryBufferCallback>
reveman 2014/06/11 14:52:09 uint32 here too
alexst (slow to review) 2014/06/11 15:36:47 Done.
+ CreateGpuMemoryBufferCallbackMap;
+ CreateGpuMemoryBufferCallbackMap create_gpu_memory_buffer_requests_;
+
static BrowserGpuChannelHostFactory* instance_;
DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory);

Powered by Google App Engine
This is Rietveld 408576698