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

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

Issue 2802663002: GpuProcessHost: setup ipc to propagate supported GpuMemoryBufferAttribs
Patch Set: GpuProcessHost: setup ipc to propagate supported GpuMemoryBufferAttribs 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..d91fccf757da49c284a59d947d3513ab24d4e1c3 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -717,6 +717,18 @@ void GpuProcessHost::CreateGpuMemoryBuffer(
weak_ptr_factory_.GetWeakPtr()));
}
+void GpuProcessHost::GetGpuMemoryBufferAttribs(
+ const GetGpuMemoryBufferAttribsCallback& callback) {
+ TRACE_EVENT0("gpu", "GpuProcessHost::GetGpuMemoryBufferAttribs");
+
+ DCHECK(CalledOnValidThread());
+
+ get_supported_gpu_memory_buffer_attribs_requests_.push(callback);
+ gpu_service_ptr_->GetGpuMemoryBufferAttribs(
sadrul 2017/04/19 21:45:46 Maybe not make another request when a request is a
varad 2017/04/21 13:03:59 Done.
+ base::Bind(&GpuProcessHost::OnGpuMemoryBufferAttribsReceived,
+ weak_ptr_factory_.GetWeakPtr()));
+}
+
void GpuProcessHost::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
int client_id,
const gpu::SyncToken& sync_token) {
@@ -780,6 +792,15 @@ void GpuProcessHost::OnDestroyingVideoSurfaceAck() {
}
#endif
+void GpuProcessHost::OnGpuMemoryBufferAttribsReceived(
+ const gfx::GpuMemoryBufferAttribVector& supported_attribs) {
+ TRACE_EVENT0("gpu", "GpuProcessHost::OnGpuMemoryBufferAttribsReceived");
+ DCHECK(!get_supported_gpu_memory_buffer_attribs_requests_.empty());
+ auto callback = get_supported_gpu_memory_buffer_attribs_requests_.front();
+ get_supported_gpu_memory_buffer_attribs_requests_.pop();
sadrul 2017/04/19 21:45:46 With the change suggested above, this would need t
varad 2017/04/21 13:03:59 Done.
+ callback.Run(supported_attribs);
+}
+
void GpuProcessHost::OnProcessLaunched() {
UMA_HISTOGRAM_TIMES("GPU.GPUProcessLaunchTime",
base::TimeTicks::Now() - init_start_time_);
« 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