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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 10386185: Add trace events to measure GPU process startup timing and time to first present. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 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 | « content/gpu/gpu_main.cc ('k') | ui/gl/gl_surface.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/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 if (!success) 759 if (!success)
760 return scoped_ptr<base::SharedMemory>(); 760 return scoped_ptr<base::SharedMemory>();
761 761
762 if (!base::SharedMemory::IsHandleValid(handle)) 762 if (!base::SharedMemory::IsHandleValid(handle))
763 return scoped_ptr<base::SharedMemory>(); 763 return scoped_ptr<base::SharedMemory>();
764 return scoped_ptr<base::SharedMemory>(new base::SharedMemory(handle, false)); 764 return scoped_ptr<base::SharedMemory>(new base::SharedMemory(handle, false));
765 } 765 }
766 766
767 int32 RenderThreadImpl::CreateViewCommandBuffer( 767 int32 RenderThreadImpl::CreateViewCommandBuffer(
768 int32 surface_id, const GPUCreateCommandBufferConfig& init_params) { 768 int32 surface_id, const GPUCreateCommandBufferConfig& init_params) {
769 TRACE_EVENT1("gpu",
770 "RenderThreadImpl::CreateViewCommandBuffer",
771 "surface_id",
772 surface_id);
773
769 int32 route_id = MSG_ROUTING_NONE; 774 int32 route_id = MSG_ROUTING_NONE;
770 IPC::Message* message = new GpuHostMsg_CreateViewCommandBuffer( 775 IPC::Message* message = new GpuHostMsg_CreateViewCommandBuffer(
771 surface_id, 776 surface_id,
772 init_params, 777 init_params,
773 &route_id); 778 &route_id);
774 779
775 // Allow calling this from the compositor thread. 780 // Allow calling this from the compositor thread.
776 if (MessageLoop::current() == message_loop()) 781 if (MessageLoop::current() == message_loop())
777 ChildThread::Send(message); 782 ChildThread::Send(message);
778 else 783 else
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 false, 882 false,
878 params.swapped_out, 883 params.swapped_out,
879 params.next_page_id, 884 params.next_page_id,
880 params.screen_info, 885 params.screen_info,
881 false, 886 false,
882 params.accessibility_mode); 887 params.accessibility_mode);
883 } 888 }
884 889
885 GpuChannelHost* RenderThreadImpl::EstablishGpuChannelSync( 890 GpuChannelHost* RenderThreadImpl::EstablishGpuChannelSync(
886 content::CauseForGpuLaunch cause_for_gpu_launch) { 891 content::CauseForGpuLaunch cause_for_gpu_launch) {
892 TRACE_EVENT0("gpu", "RenderThreadImpl::EstablishGpuChannelSync");
893
887 if (gpu_channel_.get()) { 894 if (gpu_channel_.get()) {
888 // Do nothing if we already have a GPU channel or are already 895 // Do nothing if we already have a GPU channel or are already
889 // establishing one. 896 // establishing one.
890 if (gpu_channel_->state() == GpuChannelHost::kUnconnected || 897 if (gpu_channel_->state() == GpuChannelHost::kUnconnected ||
891 gpu_channel_->state() == GpuChannelHost::kConnected) 898 gpu_channel_->state() == GpuChannelHost::kConnected)
892 return GetGpuChannel(); 899 return GetGpuChannel();
893 900
894 // Recreate the channel if it has been lost. 901 // Recreate the channel if it has been lost.
895 gpu_channel_ = NULL; 902 gpu_channel_ = NULL;
896 } 903 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 973
967 scoped_refptr<base::MessageLoopProxy> 974 scoped_refptr<base::MessageLoopProxy>
968 RenderThreadImpl::GetFileThreadMessageLoopProxy() { 975 RenderThreadImpl::GetFileThreadMessageLoopProxy() {
969 DCHECK(message_loop() == MessageLoop::current()); 976 DCHECK(message_loop() == MessageLoop::current());
970 if (!file_thread_.get()) { 977 if (!file_thread_.get()) {
971 file_thread_.reset(new base::Thread("Renderer::FILE")); 978 file_thread_.reset(new base::Thread("Renderer::FILE"));
972 file_thread_->Start(); 979 file_thread_->Start();
973 } 980 }
974 return file_thread_->message_loop_proxy(); 981 return file_thread_->message_loop_proxy();
975 } 982 }
OLDNEW
« no previous file with comments | « content/gpu/gpu_main.cc ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698