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

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

Issue 2802663002: GpuProcessHost: setup ipc to propagate supported GpuMemoryBufferAttribs
Patch Set: check for pending calls, rename get_supported_gpu_memory_buffer_attribs_requests_ Created 3 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
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7749da464a4d2790cbd2bc3fd6cb9055163779f8..fceea4588da4445d95d2d3088efb781c44c5c2d7 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -717,6 +717,22 @@ void GpuProcessHost::CreateGpuMemoryBuffer(
weak_ptr_factory_.GetWeakPtr()));
}
+void GpuProcessHost::GetGpuMemoryBufferAttribs(
+ const GetGpuMemoryBufferAttribsCallback& callback) {
+ TRACE_EVENT0("gpu", "GpuProcessHost::GetGpuMemoryBufferAttribs");
+
+ DCHECK(CalledOnValidThread());
+
+ get_gpu_memory_buffer_attribs_requests_.push(callback);
+
+ if (get_gpu_memory_buffer_attribs_requests_.size() > 1)
+ return;
+
+ gpu_service_ptr_->GetGpuMemoryBufferAttribs(
+ base::Bind(&GpuProcessHost::OnGpuMemoryBufferAttribsReceived,
+ weak_ptr_factory_.GetWeakPtr()));
+}
+
void GpuProcessHost::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
int client_id,
const gpu::SyncToken& sync_token) {
@@ -780,6 +796,17 @@ void GpuProcessHost::OnDestroyingVideoSurfaceAck() {
}
#endif
+void GpuProcessHost::OnGpuMemoryBufferAttribsReceived(
+ const gfx::GpuMemoryBufferAttribVector& supported_attribs) {
+ TRACE_EVENT0("gpu", "GpuProcessHost::OnGpuMemoryBufferAttribsReceived");
+
+ while (!get_gpu_memory_buffer_attribs_requests_.empty()) {
+ auto callback = get_gpu_memory_buffer_attribs_requests_.front();
+ get_gpu_memory_buffer_attribs_requests_.pop();
+ callback.Run(supported_attribs);
+ }
+}
+
void GpuProcessHost::OnProcessLaunched() {
UMA_HISTOGRAM_TIMES("GPU.GPUProcessLaunchTime",
base::TimeTicks::Now() - init_start_time_);
@@ -1058,6 +1085,12 @@ void GpuProcessHost::SendOutstandingReplies() {
BufferCreationStatus::GPU_HOST_INVALID);
}
+ while (!get_gpu_memory_buffer_attribs_requests_.empty()) {
+ auto callback = get_gpu_memory_buffer_attribs_requests_.front();
+ get_gpu_memory_buffer_attribs_requests_.pop();
+ callback.Run(gfx::GpuMemoryBufferAttribVector());
+ }
+
if (!send_destroying_video_surface_done_cb_.is_null())
base::ResetAndReturn(&send_destroying_video_surface_done_cb_).Run();
}
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698