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

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: 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(content::GpuRenderingStats& stats) {
218 TRACE_EVENT0("gpu", "GpuChannelHost::CollectRenderingStats");
219
220 #if defined(ENABLE_GPU)
221 AutoLock lock(context_lock_);
222 // An error occurred. Need to get the host again to reinitialize it.
223 if (!channel_.get())
224 return false;
225
226 if (!Send(new GpuChannelMsg_CollectRenderingStats(&stats))) {
227 return false;
228 }
229
230 return true;
231 #else
232 return false;
233 #endif
234 }
235
217 void GpuChannelHost::AddRoute( 236 void GpuChannelHost::AddRoute(
218 int route_id, base::WeakPtr<IPC::Listener> listener) { 237 int route_id, base::WeakPtr<IPC::Listener> listener) {
219 DCHECK(MessageLoopProxy::current()); 238 DCHECK(MessageLoopProxy::current());
220 239
221 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); 240 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy();
222 io_loop->PostTask(FROM_HERE, 241 io_loop->PostTask(FROM_HERE,
223 base::Bind(&GpuChannelHost::MessageFilter::AddRoute, 242 base::Bind(&GpuChannelHost::MessageFilter::AddRoute,
224 channel_filter_.get(), route_id, listener, 243 channel_filter_.get(), route_id, listener,
225 MessageLoopProxy::current())); 244 MessageLoopProxy::current()));
226 } 245 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 const GpuListenerInfo& info = it->second; 320 const GpuListenerInfo& info = it->second;
302 info.loop->PostTask( 321 info.loop->PostTask(
303 FROM_HERE, 322 FROM_HERE,
304 base::Bind(&IPC::Listener::OnChannelError, info.listener)); 323 base::Bind(&IPC::Listener::OnChannelError, info.listener));
305 } 324 }
306 325
307 listeners_.clear(); 326 listeners_.clear();
308 } 327 }
309 328
310 329
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698