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

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

Issue 9910004: Implement Discard and EnsureBackbufferCHROMIUM using command buffer instead of IPC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_DestroyTransferBuffer, 116 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_DestroyTransferBuffer,
117 OnDestroyTransferBuffer); 117 OnDestroyTransferBuffer);
118 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_GetTransferBuffer, 118 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_GetTransferBuffer,
119 OnGetTransferBuffer); 119 OnGetTransferBuffer);
120 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_CreateVideoDecoder, 120 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_CreateVideoDecoder,
121 OnCreateVideoDecoder) 121 OnCreateVideoDecoder)
122 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyVideoDecoder, 122 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyVideoDecoder,
123 OnDestroyVideoDecoder) 123 OnDestroyVideoDecoder)
124 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetSurfaceVisible, 124 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetSurfaceVisible,
125 OnSetSurfaceVisible) 125 OnSetSurfaceVisible)
126 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DiscardBackbuffer,
127 OnDiscardBackbuffer)
128 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_EnsureBackbuffer,
129 OnEnsureBackbuffer)
130 IPC_MESSAGE_UNHANDLED(handled = false) 126 IPC_MESSAGE_UNHANDLED(handled = false)
131 IPC_END_MESSAGE_MAP() 127 IPC_END_MESSAGE_MAP()
132 128
133 DCHECK(handled); 129 DCHECK(handled);
134 return handled; 130 return handled;
135 } 131 }
136 132
137 bool GpuCommandBufferStub::Send(IPC::Message* message) { 133 bool GpuCommandBufferStub::Send(IPC::Message* message) {
138 return channel_->Send(message); 134 return channel_->Send(message);
139 } 135 }
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 298 }
303 299
304 if (CommandLine::ForCurrentProcess()->HasSwitch( 300 if (CommandLine::ForCurrentProcess()->HasSwitch(
305 switches::kEnableGPUServiceLogging)) { 301 switches::kEnableGPUServiceLogging)) {
306 decoder_->set_log_commands(true); 302 decoder_->set_log_commands(true);
307 } 303 }
308 304
309 decoder_->SetMsgCallback( 305 decoder_->SetMsgCallback(
310 base::Bind(&GpuCommandBufferStub::SendConsoleMessage, 306 base::Bind(&GpuCommandBufferStub::SendConsoleMessage,
311 base::Unretained(this))); 307 base::Unretained(this)));
308 decoder_->SetDiscardBackbufferCallback(
309 base::Bind(&GpuCommandBufferStub::OnDiscardBackbuffer,
310 base::Unretained(this)));
311 decoder_->SetEnsureBackbufferCallback(
312 base::Bind(&GpuCommandBufferStub::OnEnsureBackbuffer,
313 base::Unretained(this)));
312 314
313 command_buffer_->SetPutOffsetChangeCallback( 315 command_buffer_->SetPutOffsetChangeCallback(
314 base::Bind(&gpu::GpuScheduler::PutChanged, 316 base::Bind(&gpu::GpuScheduler::PutChanged,
315 base::Unretained(scheduler_.get()))); 317 base::Unretained(scheduler_.get())));
316 command_buffer_->SetGetBufferChangeCallback( 318 command_buffer_->SetGetBufferChangeCallback(
317 base::Bind(&gpu::GpuScheduler::SetGetBuffer, 319 base::Bind(&gpu::GpuScheduler::SetGetBuffer,
318 base::Unretained(scheduler_.get()))); 320 base::Unretained(scheduler_.get())));
319 command_buffer_->SetParseErrorCallback( 321 command_buffer_->SetParseErrorCallback(
320 base::Bind(&GpuCommandBufferStub::OnParseError, base::Unretained(this))); 322 base::Bind(&GpuCommandBufferStub::OnParseError, base::Unretained(this)));
321 scheduler_->SetScheduledCallback( 323 scheduler_->SetScheduledCallback(
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 } 639 }
638 640
639 void GpuCommandBufferStub::SetMemoryAllocation( 641 void GpuCommandBufferStub::SetMemoryAllocation(
640 const GpuMemoryAllocation& allocation) { 642 const GpuMemoryAllocation& allocation) {
641 allocation_ = allocation; 643 allocation_ = allocation;
642 644
643 SendMemoryAllocationToProxy(allocation); 645 SendMemoryAllocationToProxy(allocation);
644 } 646 }
645 647
646 #endif // defined(ENABLE_GPU) 648 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698