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

Side by Side Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 10083056: GpuMemoryManager suggests values for renderer Contents Texture Managers' preferred memory limit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: On max 10.5, it fails to init command buffer, and my callback code didn't guard against that. Created 8 years, 7 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 | « no previous file | content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc » ('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) 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 #include "content/common/gpu/client/command_buffer_proxy_impl.h" 5 #include "content/common/gpu/client/command_buffer_proxy_impl.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 const GPUCommandBufferConsoleMessage& message) { 98 const GPUCommandBufferConsoleMessage& message) {
99 if (!console_message_callback_.is_null()) { 99 if (!console_message_callback_.is_null()) {
100 console_message_callback_.Run(message.message, message.id); 100 console_message_callback_.Run(message.message, message.id);
101 } 101 }
102 } 102 }
103 103
104 void CommandBufferProxyImpl::SetMemoryAllocationChangedCallback( 104 void CommandBufferProxyImpl::SetMemoryAllocationChangedCallback(
105 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>& 105 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>&
106 callback) { 106 callback) {
107 memory_allocation_changed_callback_ = callback; 107 memory_allocation_changed_callback_ = callback;
108 Send(new GpuCommandBufferMsg_SetClientHasMemoryAllocationChangedCallback(
109 route_id_, !memory_allocation_changed_callback_.is_null()));
108 } 110 }
109 111
110 void CommandBufferProxyImpl::OnSetMemoryAllocation( 112 void CommandBufferProxyImpl::OnSetMemoryAllocation(
111 const GpuMemoryAllocationForRenderer& allocation) { 113 const GpuMemoryAllocationForRenderer& allocation) {
112 if (!memory_allocation_changed_callback_.is_null()) 114 if (!memory_allocation_changed_callback_.is_null())
113 memory_allocation_changed_callback_.Run(allocation); 115 memory_allocation_changed_callback_.Run(allocation);
114 } 116 }
115 117
116 void CommandBufferProxyImpl::SetChannelErrorCallback( 118 void CommandBufferProxyImpl::SetChannelErrorCallback(
117 const base::Closure& callback) { 119 const base::Closure& callback) {
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 502
501 void CommandBufferProxyImpl::SetOnConsoleMessageCallback( 503 void CommandBufferProxyImpl::SetOnConsoleMessageCallback(
502 const GpuConsoleMessageCallback& callback) { 504 const GpuConsoleMessageCallback& callback) {
503 console_message_callback_ = callback; 505 console_message_callback_ = callback;
504 } 506 }
505 507
506 void CommandBufferProxyImpl::TryUpdateState() { 508 void CommandBufferProxyImpl::TryUpdateState() {
507 if (last_state_.error == gpu::error::kNoError) 509 if (last_state_.error == gpu::error::kNoError)
508 shared_state_->Read(&last_state_); 510 shared_state_->Read(&last_state_);
509 } 511 }
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698