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

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: 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: 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..eaa41584366e64d6dbe9c22cd09467be78a472ed 100644
--- a/content/browser/gpu/gpu_process_host.h
+++ b/content/browser/gpu/gpu_process_host.h
@@ -34,6 +34,11 @@ struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params;
struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params;
struct GpuHostMsg_AcceleratedSurfaceRelease_Params;
+namespace gfx {
+struct GpuMemoryBufferHandle;
+struct GpuMemoryBufferParams;
+}
+
namespace IPC {
struct ChannelHandle;
}
@@ -63,6 +68,9 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
typedef base::Callback<void(const gfx::Size)> CreateImageCallback;
+ typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)>
+ AllocateGpuMemoryBufferCallback;
+
static bool gpu_enabled() { return gpu_enabled_; }
// Creates a new GpuProcessHost or gets an existing one, resulting in the
@@ -122,6 +130,9 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
int image_id,
const CreateImageCallback& callback);
+ void AllocateGpuMemoryBuffer(const gfx::GpuMemoryBufferParams& params,
+ const AllocateGpuMemoryBufferCallback& callback);
+
// Tells the GPU process to delete image.
void DeleteImage(int client_id, int image_id, int sync_point);
@@ -159,6 +170,7 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
void OnCommandBufferCreated(bool succeeded);
void OnDestroyCommandBuffer(int32 surface_id);
void OnImageCreated(const gfx::Size size);
+ void OnGpuMemoryBufferAllocated(const gfx::GpuMemoryBufferHandle& handle);
void OnDidCreateOffscreenContext(const GURL& url);
void OnDidLoseContext(bool offscreen,
gpu::error::ContextLostReason reason,
@@ -196,6 +208,9 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
// The pending create image requests we need to reply to.
std::queue<CreateImageCallback> create_image_requests_;
+ // The pending allocate requests we need to reply to.
+ std::queue<AllocateGpuMemoryBufferCallback>
+ allocate_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