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

Side by Side Diff: content/renderer/gpu/command_buffer_proxy.cc

Issue 7634019: Allow cmdbuffer creation from compositor thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nest class Created 9 years, 4 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/renderer/gpu/command_buffer_proxy.h ('k') | content/renderer/gpu/gpu_channel_host.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 #include "content/renderer/gpu/command_buffer_proxy.h" 5 #include "content/renderer/gpu/command_buffer_proxy.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/shared_memory.h" 10 #include "base/shared_memory.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 LOG(ERROR) << "Send(GpuChannelMsg_CreateVideoDecoder) failed"; 394 LOG(ERROR) << "Send(GpuChannelMsg_CreateVideoDecoder) failed";
395 return NULL; 395 return NULL;
396 } 396 }
397 397
398 scoped_refptr<GpuVideoDecodeAcceleratorHost> decoder_host = 398 scoped_refptr<GpuVideoDecodeAcceleratorHost> decoder_host =
399 new GpuVideoDecodeAcceleratorHost(channel_, decoder_route_id, client); 399 new GpuVideoDecodeAcceleratorHost(channel_, decoder_route_id, client);
400 bool inserted = video_decoder_hosts_.insert(std::make_pair( 400 bool inserted = video_decoder_hosts_.insert(std::make_pair(
401 decoder_route_id, decoder_host)).second; 401 decoder_route_id, decoder_host)).second;
402 DCHECK(inserted); 402 DCHECK(inserted);
403 403
404 channel_->AddRoute(decoder_route_id, decoder_host.get()); 404 channel_->AddRoute(decoder_route_id, decoder_host->AsWeakPtr());
405 405
406 return decoder_host; 406 return decoder_host;
407 } 407 }
408 408
409 bool CommandBufferProxy::Send(IPC::Message* msg) { 409 bool CommandBufferProxy::Send(IPC::Message* msg) {
410 // Caller should not intentionally send a message if the context is lost. 410 // Caller should not intentionally send a message if the context is lost.
411 DCHECK(last_state_.error == gpu::error::kNoError); 411 DCHECK(last_state_.error == gpu::error::kNoError);
412 412
413 if (channel_) { 413 if (channel_) {
414 if (channel_->Send(msg)) { 414 if (channel_->Send(msg)) {
(...skipping 12 matching lines...) Expand all
427 delete msg; 427 delete msg;
428 return false; 428 return false;
429 } 429 }
430 430
431 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) { 431 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) {
432 // Handle wraparound. It works as long as we don't have more than 2B state 432 // Handle wraparound. It works as long as we don't have more than 2B state
433 // updates in flight across which reordering occurs. 433 // updates in flight across which reordering occurs.
434 if (state.generation - last_state_.generation < 0x80000000U) 434 if (state.generation - last_state_.generation < 0x80000000U)
435 last_state_ = state; 435 last_state_ = state;
436 } 436 }
OLDNEW
« no previous file with comments | « content/renderer/gpu/command_buffer_proxy.h ('k') | content/renderer/gpu/gpu_channel_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698