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

Unified Diff: content/browser/gpu/gpu_process_host.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/gpu_process_host.h
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h
index 17adefc088953cf37899020f9c98658d352b8cfa..079b549a597bf93024f3e52ca2ee6b923cf0251e 100644
--- a/content/browser/gpu/gpu_process_host.h
+++ b/content/browser/gpu/gpu_process_host.h
@@ -34,6 +34,10 @@ struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params;
struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params;
struct GpuHostMsg_AcceleratedSurfaceRelease_Params;
+namespace gfx {
+struct GpuMemoryBufferHandle;
+}
+
namespace IPC {
struct ChannelHandle;
}
@@ -63,6 +67,9 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
typedef base::Callback<void(const gfx::Size)> CreateImageCallback;
+ typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)>
+ CreateGpuMemoryBufferCallback;
+
static bool gpu_enabled() { return gpu_enabled_; }
// Creates a new GpuProcessHost or gets an existing one, resulting in the
@@ -125,6 +132,14 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
// Tells the GPU process to delete image.
void DeleteImage(int client_id, int image_id, int sync_point);
+ void CreateGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle,
+ const gfx::Size& size,
+ unsigned internalformat,
+ unsigned usage,
+ const CreateGpuMemoryBufferCallback& callback);
+ void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle,
+ int sync_point);
+
// What kind of GPU process, e.g. sandboxed or unsandboxed.
GpuProcessKind kind();
@@ -159,6 +174,7 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
void OnCommandBufferCreated(bool succeeded);
void OnDestroyCommandBuffer(int32 surface_id);
void OnImageCreated(const gfx::Size size);
+ void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle);
void OnDidCreateOffscreenContext(const GURL& url);
void OnDidLoseContext(bool offscreen,
gpu::error::ContextLostReason reason,
@@ -196,6 +212,8 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
// The pending create image requests we need to reply to.
std::queue<CreateImageCallback> create_image_requests_;
+ // The pending create gpu memory buffer requests we need to reply to.
+ std::queue<CreateGpuMemoryBufferCallback> create_gpu_memory_buffer_requests_;
// Qeueud messages to send when the process launches.
std::queue<IPC::Message*> queued_messages_;

Powered by Google App Engine
This is Rietveld 408576698