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

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

Issue 1451353002: Implement GpuArcVideoService for arc video accelerator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and addressed luis's comments Created 5 years 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 dfe06a8f232c6bf00720d4b6e17c8203bb341c40..ae1d60b6832fc1a9a46dcab8cf89d52919ff1c97 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -621,6 +621,8 @@ bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
OnGpuMemoryBufferCreated)
IPC_MESSAGE_HANDLER(GpuHostMsg_DidCreateOffscreenContext,
OnDidCreateOffscreenContext)
+ IPC_MESSAGE_HANDLER(GpuHostMsg_ArcVideoAcceleratorChannelCreated,
+ OnArcVideoAcceleratorChannelCreated)
IPC_MESSAGE_HANDLER(GpuHostMsg_DidLoseContext, OnDidLoseContext)
IPC_MESSAGE_HANDLER(GpuHostMsg_DidDestroyOffscreenContext,
OnDidDestroyOffscreenContext)
@@ -770,6 +772,17 @@ void GpuProcessHost::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
Send(new GpuMsg_DestroyGpuMemoryBuffer(id, client_id, sync_token));
}
+void GpuProcessHost::CreateArcVideoAcceleratorChannel(
+ const CreateArcVideoAcceleratorChannelCallback& callback) {
+ DCHECK(CalledOnValidThread());
+
+ if (Send(new GpuMsg_CreateArcVideoAcceleratorChannel())) {
+ create_arc_video_accelerator_channel_requests_.push(callback);
+ } else {
+ callback.Run(IPC::ChannelHandle());
+ }
+}
+
void GpuProcessHost::OnInitialized(bool result, const gpu::GPUInfo& gpu_info) {
UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", result);
initialized_ = result;
@@ -837,6 +850,22 @@ void GpuProcessHost::OnGpuMemoryBufferCreated(
callback.Run(handle);
}
+void GpuProcessHost::OnArcVideoAcceleratorChannelCreated(
+ const IPC::ChannelHandle& handle) {
+ if (create_arc_video_accelerator_channel_requests_.empty()) {
+ RouteOnUIThread(
+ GpuHostMsg_OnLogMessage(logging::LOG_WARNING, "WARNING",
+ "Received a ArcVideoAcceleratorChannelCreated "
+ "message but no requests in queue."));
+ return;
+ }
+
+ CreateArcVideoAcceleratorChannelCallback callback =
+ create_arc_video_accelerator_channel_requests_.front();
+ create_arc_video_accelerator_channel_requests_.pop();
+ callback.Run(handle);
+}
+
void GpuProcessHost::OnDidCreateOffscreenContext(const GURL& url) {
urls_with_live_offscreen_contexts_.insert(url);
}
@@ -1049,6 +1078,13 @@ void GpuProcessHost::SendOutstandingReplies() {
create_gpu_memory_buffer_requests_.pop();
callback.Run(gfx::GpuMemoryBufferHandle());
}
+
+ while (!create_arc_video_accelerator_channel_requests_.empty()) {
+ CreateArcVideoAcceleratorChannelCallback callback =
+ create_arc_video_accelerator_channel_requests_.front();
+ create_arc_video_accelerator_channel_requests_.pop();
+ callback.Run(IPC::ChannelHandle());
+ }
}
void GpuProcessHost::BlockLiveOffscreenContexts() {

Powered by Google App Engine
This is Rietveld 408576698