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

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

Issue 10868048: Report texture upload time in renderingStats. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add totalProcessingCommandsTime stat and fix nits Created 8 years, 3 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 #include "content/common/gpu/client/gpu_channel_host.h" 5 #include "content/common/gpu/client/gpu_channel_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 int route_id = command_buffer->GetRouteID(); 207 int route_id = command_buffer->GetRouteID();
208 Send(new GpuChannelMsg_DestroyCommandBuffer(route_id)); 208 Send(new GpuChannelMsg_DestroyCommandBuffer(route_id));
209 // Check the proxy has not already been removed after a channel error. 209 // Check the proxy has not already been removed after a channel error.
210 if (proxies_.find(route_id) != proxies_.end()) 210 if (proxies_.find(route_id) != proxies_.end())
211 proxies_.erase(route_id); 211 proxies_.erase(route_id);
212 RemoveRoute(route_id); 212 RemoveRoute(route_id);
213 delete command_buffer; 213 delete command_buffer;
214 #endif 214 #endif
215 } 215 }
216 216
217 bool GpuChannelHost::CollectRenderingStats(
218 int surface_id, content::GpuRenderingStats* stats) {
piman 2012/08/30 22:44:11 At a high level, why restricting here to "view" co
219 TRACE_EVENT0("gpu", "GpuChannelHost::CollectRenderingStats");
220
221 AutoLock lock(context_lock_);
222 // An error occurred. Need to get the host again to reinitialize it.
223 if (!channel_.get())
piman 2012/08/30 22:44:11 Why this? I think it's racy if called on a non-mai
224 return false;
225
226 if (!Send(new GpuChannelMsg_CollectRenderingStats(surface_id, stats)))
227 return false;
228
229 return true;
230 }
231
217 void GpuChannelHost::AddRoute( 232 void GpuChannelHost::AddRoute(
218 int route_id, base::WeakPtr<IPC::Listener> listener) { 233 int route_id, base::WeakPtr<IPC::Listener> listener) {
219 DCHECK(MessageLoopProxy::current()); 234 DCHECK(MessageLoopProxy::current());
220 235
221 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); 236 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy();
222 io_loop->PostTask(FROM_HERE, 237 io_loop->PostTask(FROM_HERE,
223 base::Bind(&GpuChannelHost::MessageFilter::AddRoute, 238 base::Bind(&GpuChannelHost::MessageFilter::AddRoute,
224 channel_filter_.get(), route_id, listener, 239 channel_filter_.get(), route_id, listener,
225 MessageLoopProxy::current())); 240 MessageLoopProxy::current()));
226 } 241 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 const GpuListenerInfo& info = it->second; 316 const GpuListenerInfo& info = it->second;
302 info.loop->PostTask( 317 info.loop->PostTask(
303 FROM_HERE, 318 FROM_HERE,
304 base::Bind(&IPC::Listener::OnChannelError, info.listener)); 319 base::Bind(&IPC::Listener::OnChannelError, info.listener));
305 } 320 }
306 321
307 listeners_.clear(); 322 listeners_.clear();
308 } 323 }
309 324
310 325
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698