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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 7292010: Delete GpuVideoService and move GpuVideoDecodeAccelerator ownership to stubs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase ToT Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_Flush, OnFlush); 86 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_Flush, OnFlush);
87 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush); 87 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush);
88 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_CreateTransferBuffer, 88 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_CreateTransferBuffer,
89 OnCreateTransferBuffer); 89 OnCreateTransferBuffer);
90 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_RegisterTransferBuffer, 90 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_RegisterTransferBuffer,
91 OnRegisterTransferBuffer); 91 OnRegisterTransferBuffer);
92 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_DestroyTransferBuffer, 92 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_DestroyTransferBuffer,
93 OnDestroyTransferBuffer); 93 OnDestroyTransferBuffer);
94 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_GetTransferBuffer, 94 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_GetTransferBuffer,
95 OnGetTransferBuffer); 95 OnGetTransferBuffer);
96 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateVideoDecoder,
97 OnCreateVideoDecoder)
98 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyVideoDecoder,
99 OnDestroyVideoDecoder)
96 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ResizeOffscreenFrameBuffer, 100 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ResizeOffscreenFrameBuffer,
97 OnResizeOffscreenFrameBuffer); 101 OnResizeOffscreenFrameBuffer);
98 #if defined(OS_MACOSX) 102 #if defined(OS_MACOSX)
99 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetWindowSize, OnSetWindowSize); 103 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetWindowSize, OnSetWindowSize);
100 #endif // defined(OS_MACOSX) 104 #endif // defined(OS_MACOSX)
101 IPC_MESSAGE_UNHANDLED(handled = false) 105 IPC_MESSAGE_UNHANDLED(handled = false)
102 IPC_END_MESSAGE_MAP() 106 IPC_END_MESSAGE_MAP()
107
108 // If this message isn't intended for the stub, try to route it to the video
109 // decoder.
110 if (!handled && video_decoder_.get())
111 handled = video_decoder_->OnMessageReceived(message);
112
103 DCHECK(handled); 113 DCHECK(handled);
104 return handled; 114 return handled;
105 } 115 }
106 116
107 bool GpuCommandBufferStub::Send(IPC::Message* message) { 117 bool GpuCommandBufferStub::Send(IPC::Message* message) {
108 return channel_->Send(message); 118 return channel_->Send(message);
109 } 119 }
110 120
111 void GpuCommandBufferStub::OnInitialize( 121 void GpuCommandBufferStub::OnInitialize(
112 base::SharedMemoryHandle ring_buffer, 122 base::SharedMemoryHandle ring_buffer,
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 if (state.error == gpu::error::kLostContext && 576 if (state.error == gpu::error::kLostContext &&
567 gfx::GLContext::LosesAllContextsOnContextLost()) { 577 gfx::GLContext::LosesAllContextsOnContextLost()) {
568 channel_->LoseAllContexts(); 578 channel_->LoseAllContexts();
569 } else { 579 } else {
570 IPC::Message* msg = new GpuCommandBufferMsg_UpdateState(route_id_, state); 580 IPC::Message* msg = new GpuCommandBufferMsg_UpdateState(route_id_, state);
571 msg->set_unblock(true); 581 msg->set_unblock(true);
572 Send(msg); 582 Send(msg);
573 } 583 }
574 } 584 }
575 585
586 void GpuCommandBufferStub::OnCreateVideoDecoder(
587 int32 decoder_host_id, const std::vector<uint32>& configs) {
588 video_decoder_.reset(
589 new GpuVideoDecodeAccelerator(this, decoder_host_id, this));
590 video_decoder_->Initialize(configs);
591 }
592
593 void GpuCommandBufferStub::OnDestroyVideoDecoder() {
594 LOG(ERROR) << "GpuCommandBufferStub::OnDestroyVideoDecoder";
595 video_decoder_.reset();
596 }
597
576 #endif // defined(ENABLE_GPU) 598 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698