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

Side by Side Diff: chrome/browser/gpu_process_host_ui_shim.cc

Issue 6691013: Introduce gpu_trace_event for gpu performance analysis. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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 // TODO(jam): move this file to src/content once we have an interface that the 1 // TODO(jam): move this file to src/content once we have an interface that the
2 // embedder provides. We can then use it to get the resource and resize the 2 // embedder provides. We can then use it to get the resource and resize the
3 // window. 3 // window.
4 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 4 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be 5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file. 6 // found in the LICENSE file.
7 7
8 #include "chrome/browser/gpu_process_host_ui_shim.h" 8 #include "chrome/browser/gpu_process_host_ui_shim.h"
9 9
10 #include "base/id_map.h" 10 #include "base/id_map.h"
11 #include "chrome/browser/gpu_data_manager.h" 11 #include "chrome/browser/gpu_data_manager.h"
12 #include "content/browser/browser_thread.h" 12 #include "content/browser/browser_thread.h"
13 #include "content/browser/gpu_process_host.h" 13 #include "content/browser/gpu_process_host.h"
14 #include "content/browser/renderer_host/render_process_host.h" 14 #include "content/browser/renderer_host/render_process_host.h"
15 #include "content/browser/renderer_host/render_view_host.h" 15 #include "content/browser/renderer_host/render_view_host.h"
16 #include "content/browser/renderer_host/render_widget_host_view.h" 16 #include "content/browser/renderer_host/render_widget_host_view.h"
17 #include "content/common/gpu_messages.h" 17 #include "content/common/gpu_messages.h"
18 #include "gpu/common/gpu_trace_event.h"
18 19
19 #if defined(OS_LINUX) 20 #if defined(OS_LINUX)
20 // These two #includes need to come after gpu_messages.h. 21 // These two #includes need to come after gpu_messages.h.
21 #include <gdk/gdkwindow.h> // NOLINT 22 #include <gdk/gdkwindow.h> // NOLINT
22 #include <gdk/gdkx.h> // NOLINT 23 #include <gdk/gdkx.h> // NOLINT
23 #include "ui/base/x/x11_util.h" 24 #include "ui/base/x/x11_util.h"
24 #include "ui/gfx/gtk_native_view_id_manager.h" 25 #include "ui/gfx/gtk_native_view_id_manager.h"
25 #include "ui/gfx/size.h" 26 #include "ui/gfx/size.h"
26 #endif // defined(OS_LINUX) 27 #endif // defined(OS_LINUX)
27 28
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 if (message.routing_id() != MSG_ROUTING_CONTROL) 255 if (message.routing_id() != MSG_ROUTING_CONTROL)
255 return false; 256 return false;
256 257
257 return OnControlMessageReceived(message); 258 return OnControlMessageReceived(message);
258 } 259 }
259 260
260 void GpuProcessHostUIShim::EstablishGpuChannel( 261 void GpuProcessHostUIShim::EstablishGpuChannel(
261 int renderer_id, 262 int renderer_id,
262 EstablishChannelCallback *callback) { 263 EstablishChannelCallback *callback) {
263 DCHECK(CalledOnValidThread()); 264 DCHECK(CalledOnValidThread());
265 GPU_TRACE_EVENT0("gpu", "GpuProcessHostUIShim::EstablishGpuChannel");
264 linked_ptr<EstablishChannelCallback> wrapped_callback(callback); 266 linked_ptr<EstablishChannelCallback> wrapped_callback(callback);
265 267
266 // If GPU features are already blacklisted, no need to establish the channel. 268 // If GPU features are already blacklisted, no need to establish the channel.
267 if (gpu_data_manager_->GetGpuFeatureFlags().flags() != 0) { 269 if (gpu_data_manager_->GetGpuFeatureFlags().flags() != 0) {
268 EstablishChannelError( 270 EstablishChannelError(
269 wrapped_callback.release(), IPC::ChannelHandle(), NULL, GPUInfo()); 271 wrapped_callback.release(), IPC::ChannelHandle(), NULL, GPUInfo());
270 return; 272 return;
271 } 273 }
272 274
273 if (Send(new GpuMsg_EstablishChannel(renderer_id))) { 275 if (Send(new GpuMsg_EstablishChannel(renderer_id))) {
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 int render_view_id) { 531 int render_view_id) {
530 RenderViewHost* host = RenderViewHost::FromID(renderer_id, 532 RenderViewHost* host = RenderViewHost::FromID(renderer_id,
531 render_view_id); 533 render_view_id);
532 if (!host) { 534 if (!host) {
533 return; 535 return;
534 } 536 }
535 host->ScheduleComposite(); 537 host->ScheduleComposite();
536 } 538 }
537 539
538 #endif 540 #endif
539
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/gpu_internals.html » ('j') | chrome/browser/ui/webui/gpu_internals_ui.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698