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

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 1878103002: Plumb a Browser->GPU surface destruction message for Android VDAs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing ifdefs 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/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index c16a63968238191fc66a1ee016bd165350eb6e6c..e42db69957219fd5cc5c4f6ce5ce1a347a4c2fa2 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -616,6 +616,10 @@ bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(GpuHostMsg_ChannelEstablished, OnChannelEstablished)
IPC_MESSAGE_HANDLER(GpuHostMsg_GpuMemoryBufferCreated,
OnGpuMemoryBufferCreated)
+#if defined(OS_ANDROID)
+ IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyingVideoSurfaceHandled,
+ OnDestroyingVideoSurfaceHandled)
+#endif
IPC_MESSAGE_HANDLER(GpuHostMsg_DidCreateOffscreenContext,
OnDidCreateOffscreenContext)
IPC_MESSAGE_HANDLER(GpuHostMsg_DidLoseContext, OnDidLoseContext)
@@ -788,6 +792,18 @@ void GpuProcessHost::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
Send(new GpuMsg_DestroyGpuMemoryBuffer(id, client_id, sync_token));
}
+#if defined(OS_ANDROID)
+void GpuProcessHost::DestroyingVideoSurface(int surface_id,
+ const base::Closure& done_cb) {
+ TRACE_EVENT0("gpu", "GpuProcessHost::DestroyingVideoSurface");
no sievers 2016/04/19 23:30:17 DCHECK(destroying_video_surface_request_.is_null()
watk 2016/04/22 02:48:55 Done.
+ if (Send(new GpuMsg_DestroyingVideoSurface(surface_id))) {
+ destroying_video_surface_request_ = done_cb;
+ } else {
+ done_cb.Run();
+ }
+}
+#endif
+
void GpuProcessHost::OnInitialized(bool result, const gpu::GPUInfo& gpu_info) {
UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", result);
initialized_ = result;
@@ -841,6 +857,14 @@ void GpuProcessHost::OnGpuMemoryBufferCreated(
callback.Run(handle);
}
+#if defined(OS_ANDROID)
+void GpuProcessHost::OnDestroyingVideoSurfaceHandled(int surface_id) {
+ TRACE_EVENT0("gpu", "GpuProcessHost::OnDestroyingVideoSurfaceHandled");
+ if (!destroying_video_surface_request_.is_null())
+ base::ResetAndReturn(&destroying_video_surface_request_).Run();
+}
+#endif
+
void GpuProcessHost::OnDidCreateOffscreenContext(const GURL& url) {
urls_with_live_offscreen_contexts_.insert(url);
}
@@ -1044,6 +1068,9 @@ void GpuProcessHost::SendOutstandingReplies() {
create_gpu_memory_buffer_requests_.pop();
callback.Run(gfx::GpuMemoryBufferHandle());
}
+
+ if (!destroying_video_surface_request_.is_null())
+ base::ResetAndReturn(&destroying_video_surface_request_).Run();
}
void GpuProcessHost::BlockLiveOffscreenContexts() {

Powered by Google App Engine
This is Rietveld 408576698