diff --git a/cc/debug/rendering_stats.cc b/cc/debug/rendering_stats.cc index abce5ae562b9f6..5c194c6256f378 100644 --- a/cc/debug/rendering_stats.cc +++ b/cc/debug/rendering_stats.cc @@ -51,26 +51,6 @@ void ImplThreadRenderingStats::Add(const ImplThreadRenderingStats& other) { rasterized_pixel_count += other.rasterized_pixel_count; } -void RenderingStats::EnumerateFields(Enumerator* enumerator) const { - enumerator->AddInt64("frameCount", - main_stats.frame_count + impl_stats.frame_count); - enumerator->AddDouble("paintTime", - main_stats.paint_time.InSecondsF()); - enumerator->AddInt64("paintedPixelCount", - main_stats.painted_pixel_count); - enumerator->AddDouble("recordTime", - main_stats.record_time.InSecondsF()); - enumerator->AddInt64("recordedPixelCount", - main_stats.recorded_pixel_count); - // Combine rasterization and analysis time as a precursor to combining - // them in the same step internally. - enumerator->AddDouble("rasterizeTime", - impl_stats.rasterize_time.InSecondsF() + - impl_stats.analysis_time.InSecondsF()); - enumerator->AddInt64("rasterizedPixelCount", - impl_stats.rasterized_pixel_count); -} - void RenderingStats::Add(const RenderingStats& other) { main_stats.Add(other.main_stats); impl_stats.Add(other.impl_stats); diff --git a/cc/debug/rendering_stats.h b/cc/debug/rendering_stats.h index d28f110715744c..72262c8b6ad890 100644 --- a/cc/debug/rendering_stats.h +++ b/cc/debug/rendering_stats.h @@ -12,22 +12,6 @@ namespace cc { -// In conjunction with EnumerateFields, this allows the embedder to -// enumerate the values in this structure without -// having to embed references to its specific member variables. This -// simplifies the addition of new fields to this type. -class RenderingStatsEnumerator { - public: - virtual void AddInt64(const char* name, int64 value) = 0; - virtual void AddDouble(const char* name, double value) = 0; - virtual void AddInt(const char* name, int value) = 0; - virtual void AddTimeDeltaInSecondsF(const char* name, - const base::TimeDelta& value) = 0; - - protected: - virtual ~RenderingStatsEnumerator() {} -}; - struct CC_EXPORT MainThreadRenderingStats { // Note: when adding new members, please remember to update EnumerateFields // and Add in rendering_stats.cc. @@ -58,14 +42,9 @@ struct CC_EXPORT ImplThreadRenderingStats { }; struct CC_EXPORT RenderingStats { - typedef RenderingStatsEnumerator Enumerator; - MainThreadRenderingStats main_stats; ImplThreadRenderingStats impl_stats; - // Outputs the fields in this structure to the provided enumerator. - void EnumerateFields(Enumerator* enumerator) const; - // Add fields of |other| to the fields in this structure. void Add(const RenderingStats& other); }; diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 485dc52baa11c2..e67e26932a4618 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -507,11 +507,6 @@ void LayerTreeHost::SetNeedsDisplayOnAllLayers() { } } -void LayerTreeHost::CollectRenderingStats(RenderingStats* stats) const { - CHECK(debug_state_.RecordRenderingStats()); - *stats = rendering_stats_instrumentation_->GetRenderingStats(); -} - const RendererCapabilities& LayerTreeHost::GetRendererCapabilities() const { return proxy_->GetRendererCapabilities(); } diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 663fd9ea8bb1cc..7e637a74826b17 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -2385,8 +2385,6 @@ void RenderWidgetHostImpl::ComputeTouchLatency( base::TimeDelta ui_delta = rwh_component.event_time - ui_component.event_time; - rendering_stats_.touch_ui_count++; - rendering_stats_.total_touch_ui_latency += ui_delta; UMA_HISTOGRAM_CUSTOM_COUNTS( "Event.Latency.Browser.TouchUI", ui_delta.InMicroseconds(), @@ -2400,8 +2398,6 @@ void RenderWidgetHostImpl::ComputeTouchLatency( DCHECK(acked_component.event_count == 1); base::TimeDelta acked_delta = acked_component.event_time - rwh_component.event_time; - rendering_stats_.touch_acked_count++; - rendering_stats_.total_touch_acked_latency += acked_delta; UMA_HISTOGRAM_CUSTOM_COUNTS( "Event.Latency.Browser.TouchAcked", acked_delta.InMicroseconds(), @@ -2409,10 +2405,6 @@ void RenderWidgetHostImpl::ComputeTouchLatency( 1000000, 100); } - - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableGpuBenchmarking)) - Send(new ViewMsg_SetBrowserRenderingStats(routing_id_, rendering_stats_)); } void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) { @@ -2435,11 +2427,6 @@ void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) { return; } - rendering_stats_.input_event_count += rwh_component.event_count; - rendering_stats_.total_input_latency += - rwh_component.event_count * - (swap_component.event_time - rwh_component.event_time); - ui::LatencyInfo::LatencyComponent original_component; if (latency_info.FindLatency( ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT, @@ -2458,15 +2445,7 @@ void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) { 1000000, 100); } - rendering_stats_.scroll_update_count += original_component.event_count; - rendering_stats_.total_scroll_update_latency += - original_component.event_count * - (swap_component.event_time - original_component.event_time); } - - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableGpuBenchmarking)) - Send(new ViewMsg_SetBrowserRenderingStats(routing_id_, rendering_stats_)); } void RenderWidgetHostImpl::DidReceiveRendererFrame() { diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index df6dc8daa2bf9f..45bdb9650aa102 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -25,7 +25,6 @@ #include "build/build_config.h" #include "content/browser/renderer_host/input/input_ack_handler.h" #include "content/browser/renderer_host/input/input_router_client.h" -#include "content/common/browser_rendering_stats.h" #include "content/common/input/synthetic_gesture_packet.h" #include "content/common/view_message_enums.h" #include "content/port/browser/event_with_latency_info.h" @@ -932,8 +931,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, int64 last_input_number_; - BrowserRenderingStats rendering_stats_; - DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); }; diff --git a/content/common/browser_rendering_stats.cc b/content/common/browser_rendering_stats.cc deleted file mode 100644 index 9c0c8259de5e53..00000000000000 --- a/content/common/browser_rendering_stats.cc +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/common/browser_rendering_stats.h" - -namespace content { - -BrowserRenderingStats::BrowserRenderingStats() : - input_event_count(0), - touch_ui_count(0), - touch_acked_count(0), - scroll_update_count(0) { -} - -BrowserRenderingStats::~BrowserRenderingStats() {} - -void BrowserRenderingStats::EnumerateFields( - cc::RenderingStats::Enumerator* enumerator) const { - enumerator->AddInt("inputEventCount", input_event_count); - enumerator->AddTimeDeltaInSecondsF("totalInputLatency", total_input_latency); - - enumerator->AddInt("touchUICount", touch_ui_count); - enumerator->AddTimeDeltaInSecondsF("totalTouchUILatency", - total_touch_ui_latency); - - enumerator->AddInt("touchAckedCount", touch_acked_count); - enumerator->AddTimeDeltaInSecondsF("totalTouchAckedLatency", - total_touch_acked_latency); - - enumerator->AddInt("scrollUpdateCount", scroll_update_count); - enumerator->AddTimeDeltaInSecondsF("totalScrollUpdateLatency", - total_scroll_update_latency); -} - -} // namespace content diff --git a/content/common/browser_rendering_stats.h b/content/common/browser_rendering_stats.h deleted file mode 100644 index 1db8dd05d03d06..00000000000000 --- a/content/common/browser_rendering_stats.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_COMMON_BROWSER_RENDERING_STATS_H_ -#define CONTENT_COMMON_BROWSER_RENDERING_STATS_H_ - -#include "base/time/time.h" -#include "cc/debug/rendering_stats.h" -#include "content/common/content_export.h" - -namespace content { - -struct CONTENT_EXPORT BrowserRenderingStats { - BrowserRenderingStats(); - ~BrowserRenderingStats(); - - uint32 input_event_count; - base::TimeDelta total_input_latency; - - uint32 touch_ui_count; - base::TimeDelta total_touch_ui_latency; - uint32 touch_acked_count; - base::TimeDelta total_touch_acked_latency; - - uint32 scroll_update_count; - base::TimeDelta total_scroll_update_latency; - // Note: when adding new members, please remember to update enumerateFields - // in browser_rendering_stats.cc. - - // Outputs the fields in this structure to the provided enumerator. - void EnumerateFields(cc::RenderingStats::Enumerator* enumerator) const; -}; - -} // namespace content - -#endif // CONTENT_COMMON_BROWSER_RENDERING_STATS_H_ diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc index 72f80f1af0bfa8..aa3d44fc116470 100644 --- a/content/common/gpu/client/gpu_channel_host.cc +++ b/content/common/gpu/client/gpu_channel_host.cc @@ -218,14 +218,6 @@ void GpuChannelHost::DestroyCommandBuffer( delete command_buffer; } -bool GpuChannelHost::CollectRenderingStatsForSurface( - int surface_id, GpuRenderingStats* stats) { - TRACE_EVENT0("gpu", "GpuChannelHost::CollectRenderingStats"); - - return Send(new GpuChannelMsg_CollectRenderingStatsForSurface(surface_id, - stats)); -} - void GpuChannelHost::AddRoute( int route_id, base::WeakPtr listener) { DCHECK(MessageLoopProxy::current().get()); diff --git a/content/common/gpu/client/gpu_channel_host.h b/content/common/gpu/client/gpu_channel_host.h index 03466ea9966472..ed83e015f45619 100644 --- a/content/common/gpu/client/gpu_channel_host.h +++ b/content/common/gpu/client/gpu_channel_host.h @@ -49,7 +49,6 @@ class SyncMessageFilter; namespace content { class CommandBufferProxyImpl; class GpuChannelHost; -struct GpuRenderingStats; struct GpuListenerInfo { GpuListenerInfo(); @@ -140,10 +139,6 @@ class GpuChannelHost : public IPC::Sender, // Destroy a command buffer created by this channel. void DestroyCommandBuffer(CommandBufferProxyImpl* command_buffer); - // Collect rendering stats from GPU process. - bool CollectRenderingStatsForSurface( - int surface_id, GpuRenderingStats* stats); - // Add a route for the current message loop. void AddRoute(int route_id, base::WeakPtr listener); void RemoveRoute(int route_id); diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc index f02a69fdddf44e..7ce8d30dae9ce5 100644 --- a/content/common/gpu/gpu_channel.cc +++ b/content/common/gpu/gpu_channel.cc @@ -757,9 +757,6 @@ bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) { OnDevToolsStartEventsRecording) IPC_MESSAGE_HANDLER(GpuChannelMsg_DevToolsStopEventsRecording, OnDevToolsStopEventsRecording) - IPC_MESSAGE_HANDLER( - GpuChannelMsg_CollectRenderingStatsForSurface, - OnCollectRenderingStatsForSurface) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() DCHECK(handled) << msg.type(); @@ -918,34 +915,6 @@ void GpuChannel::OnDevToolsStopEventsRecording() { devtools_gpu_agent_->StopEventsRecording(); } -void GpuChannel::OnCollectRenderingStatsForSurface( - int32 surface_id, GpuRenderingStats* stats) { - for (StubMap::Iterator it(&stubs_); - !it.IsAtEnd(); it.Advance()) { - int texture_upload_count = - it.GetCurrentValue()->decoder()->GetTextureUploadCount(); - base::TimeDelta total_texture_upload_time = - it.GetCurrentValue()->decoder()->GetTotalTextureUploadTime(); - base::TimeDelta total_processing_commands_time = - it.GetCurrentValue()->decoder()->GetTotalProcessingCommandsTime(); - - stats->global_texture_upload_count += texture_upload_count; - stats->global_total_texture_upload_time += total_texture_upload_time; - stats->global_total_processing_commands_time += - total_processing_commands_time; - if (it.GetCurrentValue()->surface_id() == surface_id) { - stats->texture_upload_count += texture_upload_count; - stats->total_texture_upload_time += total_texture_upload_time; - stats->total_processing_commands_time += total_processing_commands_time; - } - } - - GPUVideoMemoryUsageStats usage_stats; - gpu_channel_manager_->gpu_memory_manager()->GetVideoMemoryUsageStats( - &usage_stats); - stats->global_video_memory_bytes_allocated = usage_stats.bytes_allocated; -} - void GpuChannel::MessageProcessed() { messages_processed_++; if (preempting_flag_.get()) { diff --git a/content/common/gpu/gpu_channel.h b/content/common/gpu/gpu_channel.h index 68ca02235fe776..b0920cf92130ee 100644 --- a/content/common/gpu/gpu_channel.h +++ b/content/common/gpu/gpu_channel.h @@ -42,7 +42,6 @@ namespace content { class DevToolsGpuAgent; class GpuChannelManager; class GpuChannelMessageFilter; -struct GpuRenderingStats; class GpuVideoEncodeAccelerator; class GpuWatchdog; @@ -172,10 +171,6 @@ class GpuChannel : public IPC::Listener, void OnDevToolsStartEventsRecording(int32* route_id); void OnDevToolsStopEventsRecording(); - // Collect rendering stats. - void OnCollectRenderingStatsForSurface( - int32 surface_id, GpuRenderingStats* stats); - // Decrement the count of unhandled IPC messages and defer preemption. void MessageProcessed(); diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h index 4ee0cab6c66ccb..bbdb375c8b9368 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -12,7 +12,6 @@ #include "content/common/content_export.h" #include "content/common/gpu/gpu_memory_uma_stats.h" #include "content/common/gpu/gpu_process_launch_causes.h" -#include "content/common/gpu/gpu_rendering_stats.h" #include "content/public/common/common_param_traits.h" #include "content/public/common/gpu_memory_stats.h" #include "gpu/command_buffer/common/capabilities.h" @@ -223,16 +222,6 @@ IPC_ENUM_TRAITS(gpu::error::ContextLostReason) IPC_ENUM_TRAITS(media::VideoCodecProfile) -IPC_STRUCT_TRAITS_BEGIN(content::GpuRenderingStats) - IPC_STRUCT_TRAITS_MEMBER(global_texture_upload_count) - IPC_STRUCT_TRAITS_MEMBER(global_total_texture_upload_time) - IPC_STRUCT_TRAITS_MEMBER(texture_upload_count) - IPC_STRUCT_TRAITS_MEMBER(total_texture_upload_time) - IPC_STRUCT_TRAITS_MEMBER(global_total_processing_commands_time) - IPC_STRUCT_TRAITS_MEMBER(total_processing_commands_time) - IPC_STRUCT_TRAITS_MEMBER(global_video_memory_bytes_allocated) -IPC_STRUCT_TRAITS_END() - IPC_ENUM_TRAITS(media::VideoFrame::Format) IPC_ENUM_TRAITS(media::VideoEncodeAccelerator::Error) @@ -481,11 +470,6 @@ IPC_SYNC_MESSAGE_CONTROL0_1(GpuChannelMsg_CreateVideoEncoder, IPC_MESSAGE_CONTROL1(GpuChannelMsg_DestroyVideoEncoder, int32 /* route_id */) -// Tells the GPU process to collect rendering stats. -IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_CollectRenderingStatsForSurface, - int32 /* surface_id */, - content::GpuRenderingStats /* stats */) - // Sent by DevTools agent in the inspected renderer process to initiate GPU // instrumentation events recording. IPC_SYNC_MESSAGE_CONTROL0_1(GpuChannelMsg_DevToolsStartEventsRecording, diff --git a/content/common/gpu/gpu_rendering_stats.cc b/content/common/gpu/gpu_rendering_stats.cc deleted file mode 100644 index 88e54f08f6ea07..00000000000000 --- a/content/common/gpu/gpu_rendering_stats.cc +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/common/gpu/gpu_rendering_stats.h" - -namespace content { - -GpuRenderingStats::GpuRenderingStats() - : global_texture_upload_count(0), - texture_upload_count(0), - global_video_memory_bytes_allocated(0) { -} - -GpuRenderingStats::~GpuRenderingStats() { -} - -void GpuRenderingStats::EnumerateFields( - cc::RenderingStats::Enumerator* enumerator) const { - enumerator->AddInt("globalTextureUploadCount", global_texture_upload_count); - enumerator->AddTimeDeltaInSecondsF("globalTotalTextureUploadTimeInSeconds", - global_total_texture_upload_time); - enumerator->AddInt("textureUploadCount", texture_upload_count); - enumerator->AddTimeDeltaInSecondsF("totalTextureUploadTimeInSeconds", - total_texture_upload_time); - enumerator->AddTimeDeltaInSecondsF( - "globalTotalProcessingCommandsTimeInSeconds", - global_total_processing_commands_time); - enumerator->AddTimeDeltaInSecondsF("totalProcessingCommandsTimeInSeconds", - total_processing_commands_time); - enumerator->AddInt64("globalVideoMemoryBytesAllocated", - global_video_memory_bytes_allocated); -} - -} // namespace content diff --git a/content/common/gpu/gpu_rendering_stats.h b/content/common/gpu/gpu_rendering_stats.h deleted file mode 100644 index ab248537201778..00000000000000 --- a/content/common/gpu/gpu_rendering_stats.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_COMMON_GPU_GPU_RENDERING_STATS_H_ -#define CONTENT_COMMON_GPU_GPU_RENDERING_STATS_H_ - -#include "base/time/time.h" -#include "cc/debug/rendering_stats.h" -#include "content/common/content_export.h" - -namespace content { - -struct CONTENT_EXPORT GpuRenderingStats { - GpuRenderingStats(); - ~GpuRenderingStats(); - - int global_texture_upload_count; - base::TimeDelta global_total_texture_upload_time; - int texture_upload_count; - base::TimeDelta total_texture_upload_time; - base::TimeDelta global_total_processing_commands_time; - base::TimeDelta total_processing_commands_time; - int64 global_video_memory_bytes_allocated; - // Note: when adding new members, please remember to update enumerateFields - // in gpu_rendering_stats.cc. - - // Outputs the fields in this structure to the provided enumerator. - void EnumerateFields(cc::RenderingStats::Enumerator* enumerator) const; -}; - -} // namespace content - -#endif // CONTENT_PUBLIC_COMMON_RENDERING_STATS_H_ diff --git a/content/common/view_messages.h b/content/common/view_messages.h index f88bc9b694a94b..0bfc66eb9a3a74 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h @@ -11,7 +11,6 @@ #include "cc/output/begin_frame_args.h" #include "cc/output/compositor_frame.h" #include "cc/output/compositor_frame_ack.h" -#include "content/common/browser_rendering_stats.h" #include "content/common/content_export.h" #include "content/common/content_param_traits.h" #include "content/common/cookie_data.h" @@ -272,17 +271,6 @@ IPC_STRUCT_TRAITS_BEGIN(ui::SelectedFileInfo) IPC_STRUCT_TRAITS_MEMBER(display_name) IPC_STRUCT_TRAITS_END() -IPC_STRUCT_TRAITS_BEGIN(content::BrowserRenderingStats) - IPC_STRUCT_TRAITS_MEMBER(input_event_count) - IPC_STRUCT_TRAITS_MEMBER(total_input_latency) - IPC_STRUCT_TRAITS_MEMBER(touch_ui_count) - IPC_STRUCT_TRAITS_MEMBER(total_touch_ui_latency) - IPC_STRUCT_TRAITS_MEMBER(touch_acked_count) - IPC_STRUCT_TRAITS_MEMBER(total_touch_acked_latency) - IPC_STRUCT_TRAITS_MEMBER(scroll_update_count) - IPC_STRUCT_TRAITS_MEMBER(total_scroll_update_latency) -IPC_STRUCT_TRAITS_END() - IPC_STRUCT_BEGIN(ViewHostMsg_CreateWindow_Params) // Routing ID of the view initiating the open. IPC_STRUCT_MEMBER(int, opener_id) @@ -895,11 +883,6 @@ IPC_MESSAGE_ROUTED3(ViewMsg_Find, IPC_MESSAGE_ROUTED1(ViewMsg_StopFinding, content::StopFindAction /* action */) -// Informs the renderer about various statistics the browser has (e.g. -// latency) regarding the frames that have been displayed. -IPC_MESSAGE_ROUTED1(ViewMsg_SetBrowserRenderingStats, - content::BrowserRenderingStats /* stats */) - // Replaces a date time input field. IPC_MESSAGE_ROUTED1(ViewMsg_ReplaceDateTime, double /* dialog_value */) diff --git a/content/content_common.gypi b/content/content_common.gypi index 750d799d802713..a896e9ae725f2f 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -122,8 +122,6 @@ 'common/browser_plugin/browser_plugin_constants.cc', 'common/browser_plugin/browser_plugin_constants.h', 'common/browser_plugin/browser_plugin_messages.h', - 'common/browser_rendering_stats.cc', - 'common/browser_rendering_stats.h', 'common/cc_messages.cc', 'common/cc_messages.h', 'common/child_process_host_impl.cc', @@ -229,8 +227,6 @@ 'common/gpu/gpu_memory_uma_stats.h', 'common/gpu/gpu_messages.h', 'common/gpu/gpu_process_launch_causes.h', - 'common/gpu/gpu_rendering_stats.cc', - 'common/gpu/gpu_rendering_stats.h', 'common/gpu/gpu_surface_lookup.cc', 'common/gpu/gpu_surface_lookup.h', 'common/gpu/gpu_watchdog.h', diff --git a/content/renderer/gpu/gpu_benchmarking_extension.cc b/content/renderer/gpu/gpu_benchmarking_extension.cc index 4736d142450a87..0396d4900c4c02 100644 --- a/content/renderer/gpu/gpu_benchmarking_extension.cc +++ b/content/renderer/gpu/gpu_benchmarking_extension.cc @@ -12,8 +12,6 @@ #include "base/memory/scoped_vector.h" #include "base/strings/string_number_conversions.h" #include "cc/layers/layer.h" -#include "content/common/browser_rendering_stats.h" -#include "content/common/gpu/gpu_rendering_stats.h" #include "content/common/input/synthetic_gesture_params.h" #include "content/common/input/synthetic_pinch_gesture_params.h" #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" @@ -34,13 +32,11 @@ #include "third_party/skia/include/core/SkStream.h" #include "ui/gfx/codec/png_codec.h" #include "v8/include/v8.h" -#include "webkit/renderer/compositor_bindings/web_rendering_stats_impl.h" using blink::WebCanvas; using blink::WebFrame; using blink::WebImageCache; using blink::WebPrivatePtr; -using blink::WebRenderingStatsImpl; using blink::WebSize; using blink::WebView; @@ -104,38 +100,6 @@ class SkPictureSerializer { int layer_id_; }; -class RenderingStatsEnumerator : public cc::RenderingStats::Enumerator { - public: - RenderingStatsEnumerator(v8::Isolate* isolate, - v8::Handle stats_object) - : isolate(isolate), stats_object(stats_object) {} - - virtual void AddInt64(const char* name, int64 value) OVERRIDE { - stats_object->Set(v8::String::NewFromUtf8(isolate, name), - v8::Number::New(isolate, value)); - } - - virtual void AddDouble(const char* name, double value) OVERRIDE { - stats_object->Set(v8::String::NewFromUtf8(isolate, name), - v8::Number::New(isolate, value)); - } - - virtual void AddInt(const char* name, int value) OVERRIDE { - stats_object->Set(v8::String::NewFromUtf8(isolate, name), - v8::Integer::New(isolate, value)); - } - - virtual void AddTimeDeltaInSecondsF(const char* name, - const base::TimeDelta& value) OVERRIDE { - stats_object->Set(v8::String::NewFromUtf8(isolate, name), - v8::Number::New(isolate, value.InSecondsF())); - } - - private: - v8::Isolate* isolate; - v8::Handle stats_object; -}; - } // namespace namespace content { @@ -264,14 +228,6 @@ class GpuBenchmarkingWrapper : public v8::Extension { " native function SetRasterizeOnlyVisibleContent();" " return SetRasterizeOnlyVisibleContent();" "};" - "chrome.gpuBenchmarking.renderingStats = function() {" - " native function GetRenderingStats();" - " return GetRenderingStats();" - "};" - "chrome.gpuBenchmarking.gpuRenderingStats = function() {" - " native function GetGpuRenderingStats();" - " return GetGpuRenderingStats();" - "};" "chrome.gpuBenchmarking.printToSkPicture = function(dirname) {" " native function PrintToSkPicture();" " return PrintToSkPicture(dirname);" @@ -363,10 +319,6 @@ class GpuBenchmarkingWrapper : public v8::Extension { if (name->Equals( v8::String::NewFromUtf8(isolate, "SetRasterizeOnlyVisibleContent"))) return v8::FunctionTemplate::New(isolate, SetRasterizeOnlyVisibleContent); - if (name->Equals(v8::String::NewFromUtf8(isolate, "GetRenderingStats"))) - return v8::FunctionTemplate::New(isolate, GetRenderingStats); - if (name->Equals(v8::String::NewFromUtf8(isolate, "GetGpuRenderingStats"))) - return v8::FunctionTemplate::New(isolate, GetGpuRenderingStats); if (name->Equals(v8::String::NewFromUtf8(isolate, "PrintToSkPicture"))) return v8::FunctionTemplate::New(isolate, PrintToSkPicture); if (name->Equals(v8::String::NewFromUtf8(isolate, "BeginSmoothScroll"))) @@ -409,48 +361,6 @@ class GpuBenchmarkingWrapper : public v8::Extension { context.compositor()->SetRasterizeOnlyVisibleContent(); } - static void GetRenderingStats( - const v8::FunctionCallbackInfo& args) { - - GpuBenchmarkingContext context; - if (!context.Init(false)) - return; - - WebRenderingStatsImpl stats; - context.render_view_impl()->GetRenderingStats(stats); - - content::GpuRenderingStats gpu_stats; - context.render_view_impl()->GetGpuRenderingStats(&gpu_stats); - BrowserRenderingStats browser_stats; - context.render_view_impl()->GetBrowserRenderingStats(&browser_stats); - v8::Handle stats_object = v8::Object::New(args.GetIsolate()); - - RenderingStatsEnumerator enumerator(args.GetIsolate(), stats_object); - stats.rendering_stats.EnumerateFields(&enumerator); - gpu_stats.EnumerateFields(&enumerator); - browser_stats.EnumerateFields(&enumerator); - - args.GetReturnValue().Set(stats_object); - } - - static void GetGpuRenderingStats( - const v8::FunctionCallbackInfo& args) { - - GpuBenchmarkingContext context; - if (!context.Init(false)) - return; - - content::GpuRenderingStats gpu_stats; - context.render_view_impl()->GetGpuRenderingStats(&gpu_stats); - - v8::Isolate* isolate = args.GetIsolate(); - v8::Handle stats_object = v8::Object::New(isolate); - RenderingStatsEnumerator enumerator(isolate, stats_object); - gpu_stats.EnumerateFields(&enumerator); - - args.GetReturnValue().Set(stats_object); - } - static void PrintToSkPicture( const v8::FunctionCallbackInfo& args) { if (args.Length() != 1) diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index 301e11de69a18d..e4c61f724cfefa 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc @@ -327,10 +327,6 @@ void RenderWidgetCompositor::SetRasterizeOnlyVisibleContent() { layer_tree_host_->SetDebugState(current); } -void RenderWidgetCompositor::GetRenderingStats(cc::RenderingStats* stats) { - layer_tree_host_->CollectRenderingStats(stats); -} - void RenderWidgetCompositor::UpdateTopControlsState( cc::TopControlsState constraints, cc::TopControlsState current, diff --git a/content/renderer/gpu/render_widget_compositor.h b/content/renderer/gpu/render_widget_compositor.h index 5e4cadf4be9851..3f9fa49c9876f1 100644 --- a/content/renderer/gpu/render_widget_compositor.h +++ b/content/renderer/gpu/render_widget_compositor.h @@ -10,7 +10,6 @@ #include "base/time/time.h" #include "base/values.h" #include "cc/base/swap_promise_monitor.h" -#include "cc/debug/rendering_stats.h" #include "cc/input/top_controls_state.h" #include "cc/trees/layer_tree_host_client.h" #include "cc/trees/layer_tree_host_single_thread_client.h" @@ -50,7 +49,6 @@ class RenderWidgetCompositor : public blink::WebLayerTreeView, void Composite(base::TimeTicks frame_begin_time); void SetNeedsDisplayOnAllLayers(); void SetRasterizeOnlyVisibleContent(); - void GetRenderingStats(cc::RenderingStats* stats); void UpdateTopControlsState(cc::TopControlsState constraints, cc::TopControlsState current, bool animate); @@ -110,7 +108,6 @@ class RenderWidgetCompositor : public blink::WebLayerTreeView, const blink::WebLayer* innerViewportScrollLayer, const blink::WebLayer* outerViewportScrollLayer) OVERRIDE; virtual void clearViewportLayers() OVERRIDE; - virtual void renderingStats(blink::WebRenderingStats& stats) const {} virtual void setShowFPSCounter(bool show); virtual void setShowPaintRects(bool show); virtual void setShowDebugBorders(bool show); diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 54b9e99330d377..ffcbabed98eb49 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -67,7 +67,6 @@ #include "ui/gfx/skia_util.h" #include "ui/gl/gl_switches.h" #include "ui/surface/transport_dib.h" -#include "webkit/renderer/compositor_bindings/web_rendering_stats_impl.h" #if defined(OS_ANDROID) #include "base/android/sys_utils.h" @@ -617,8 +616,6 @@ bool RenderWidget::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(ViewMsg_ImeEventAck, OnImeEventAck) #endif IPC_MESSAGE_HANDLER(ViewMsg_Snapshot, OnSnapshot) - IPC_MESSAGE_HANDLER(ViewMsg_SetBrowserRenderingStats, - OnSetBrowserRenderingStats) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -2768,36 +2765,11 @@ void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { } } -void RenderWidget::GetRenderingStats( - blink::WebRenderingStatsImpl& stats) const { - if (compositor_) - compositor_->GetRenderingStats(&stats.rendering_stats); - - stats.rendering_stats.Add( - legacy_software_mode_stats_->GetRenderingStats()); -} - -bool RenderWidget::GetGpuRenderingStats(GpuRenderingStats* stats) const { - GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); - if (!gpu_channel) - return false; - - return gpu_channel->CollectRenderingStatsForSurface(surface_id(), stats); -} RenderWidgetCompositor* RenderWidget::compositor() const { return compositor_.get(); } -void RenderWidget::OnSetBrowserRenderingStats( - const BrowserRenderingStats& stats) { - browser_rendering_stats_ = stats; -} - -void RenderWidget::GetBrowserRenderingStats(BrowserRenderingStats* stats) { - *stats = browser_rendering_stats_; -} - bool RenderWidget::WillHandleMouseEvent(const blink::WebMouseEvent& event) { return false; } diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h index 63f99d03da1012..5fdae4e80c7eb5 100644 --- a/content/renderer/render_widget.h +++ b/content/renderer/render_widget.h @@ -16,7 +16,6 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "cc/debug/rendering_stats_instrumentation.h" -#include "content/common/browser_rendering_stats.h" #include "content/common/content_export.h" #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" #include "content/common/input/synthetic_gesture_params.h" @@ -57,7 +56,6 @@ class WebInputEvent; class WebKeyboardEvent; class WebMouseEvent; class WebTouchEvent; -struct WebRenderingStatsImpl; } namespace cc { class OutputSurface; } @@ -74,7 +72,6 @@ class RenderWidgetCompositor; class RenderWidgetTest; class ResizingModeSelector; struct ContextMenuParams; -struct GpuRenderingStats; struct WebPluginGeometry; // RenderWidget provides a communication bridge between a WebWidget and @@ -168,18 +165,6 @@ class CONTENT_EXPORT RenderWidget // pending moves don't try to reference it. void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); - // Fills in a WebRenderingStatsImpl struct containing information about - // rendering, e.g. count of frames rendered, time spent painting. - void GetRenderingStats(blink::WebRenderingStatsImpl&) const; - - // Fills in a GpuRenderingStats struct containing information about - // GPU rendering, e.g. count of texture uploads performed, time spent - // uploading. - // This call is relatively expensive as it blocks on the GPU process - bool GetGpuRenderingStats(GpuRenderingStats*) const; - - void GetBrowserRenderingStats(BrowserRenderingStats* stats); - RenderWidgetCompositor* compositor() const; virtual scoped_ptr CreateOutputSurface(bool fallback); @@ -401,7 +386,6 @@ class CONTENT_EXPORT RenderWidget bool ShouldHandleImeEvent(); void OnSnapshot(const gfx::Rect& src_subrect); - void OnSetBrowserRenderingStats(const BrowserRenderingStats& stats); // Notify the compositor about a change in viewport size. This should be // used only with auto resize mode WebWidgets, as normal WebWidgets should @@ -773,10 +757,6 @@ class CONTENT_EXPORT RenderWidget // Specified whether the compositor will run in its own thread. bool is_threaded_compositing_enabled_; - // The last set of rendering stats received from the browser. This is only - // received when using the --enable-gpu-benchmarking flag. - BrowserRenderingStats browser_rendering_stats_; - // The latency information for any current non-accelerated-compositing // frame. std::vector latency_info_; diff --git a/content/test/web_layer_tree_view_impl_for_testing.cc b/content/test/web_layer_tree_view_impl_for_testing.cc index 4d2533a6fd7665..997854f1c8ac35 100644 --- a/content/test/web_layer_tree_view_impl_for_testing.cc +++ b/content/test/web_layer_tree_view_impl_for_testing.cc @@ -18,7 +18,6 @@ #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" #include "third_party/WebKit/public/platform/WebLayer.h" #include "third_party/WebKit/public/platform/WebLayerTreeView.h" -#include "third_party/WebKit/public/platform/WebRenderingStats.h" #include "third_party/WebKit/public/platform/WebSize.h" #include "ui/gfx/frame_time.h" #include "webkit/common/gpu/test_context_provider_factory.h" @@ -27,7 +26,6 @@ using blink::WebColor; using blink::WebGraphicsContext3D; using blink::WebRect; -using blink::WebRenderingStats; using blink::WebSize; namespace webkit { @@ -142,8 +140,6 @@ void WebLayerTreeViewImplForTesting::setDeferCommits(bool defer_commits) { layer_tree_host_->SetDeferCommits(defer_commits); } -void WebLayerTreeViewImplForTesting::renderingStats(WebRenderingStats&) const {} - void WebLayerTreeViewImplForTesting::Layout() { } diff --git a/content/test/web_layer_tree_view_impl_for_testing.h b/content/test/web_layer_tree_view_impl_for_testing.h index c5f9cf99c33feb..3dbcb7f4210fdd 100644 --- a/content/test/web_layer_tree_view_impl_for_testing.h +++ b/content/test/web_layer_tree_view_impl_for_testing.h @@ -55,8 +55,6 @@ class WebLayerTreeViewImplForTesting virtual bool compositeAndReadback(void* pixels, const blink::WebRect& rect); virtual void finishAllRendering(); virtual void setDeferCommits(bool defer_commits); - virtual void renderingStats( - blink::WebRenderingStats& stats) const; // NOLINT(runtime/references) virtual void registerViewportLayers( const blink::WebLayer* pageScaleLayerLayer, const blink::WebLayer* innerViewportScrollLayer, diff --git a/tools/perf/metrics/smoothness.js b/tools/perf/metrics/smoothness.js deleted file mode 100644 index 1fdf975b681a38..00000000000000 --- a/tools/perf/metrics/smoothness.js +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -'use strict'; - -/** - * @fileoverview This file provides the RenderingStats object, used - * to characterize rendering smoothness. - */ -(function() { - var getTimeMs = (function() { - if (window.performance) - return (performance.now || - performance.mozNow || - performance.msNow || - performance.oNow || - performance.webkitNow).bind(window.performance); - else - return function() { return new Date().getTime(); }; - })(); - - var requestAnimationFrame = (function() { - return window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function(callback) { - window.setTimeout(callback, 1000 / 60); - }; - })().bind(window); - - /** - * Tracks rendering performance using the gpuBenchmarking.renderingStats API. - * @constructor - */ - function GpuBenchmarkingRenderingStats() { - } - - GpuBenchmarkingRenderingStats.prototype.start = function() { - this.startTime_ = getTimeMs(); - this.initialStats_ = this.getRenderingStats_(); - } - - GpuBenchmarkingRenderingStats.prototype.stop = function() { - this.stopTime_ = getTimeMs(); - this.finalStats_ = this.getRenderingStats_(); - } - - GpuBenchmarkingRenderingStats.prototype.getStartValues = function() { - if (!this.initialStats_) - throw new Error('Start not called.'); - - if (!this.finalStats_) - throw new Error('Stop was not called.'); - - return this.initialStats_; - } - - GpuBenchmarkingRenderingStats.prototype.getEndValues = function() { - if (!this.initialStats_) - throw new Error('Start not called.'); - - if (!this.finalStats_) - throw new Error('Stop was not called.'); - - return this.finalStats_; - } - - GpuBenchmarkingRenderingStats.prototype.getDeltas = function() { - if (!this.initialStats_) - throw new Error('Start not called.'); - - if (!this.finalStats_) - throw new Error('Stop was not called.'); - - var stats = {} - for (var key in this.finalStats_) - stats[key] = this.finalStats_[key] - this.initialStats_[key]; - return stats; - }; - - GpuBenchmarkingRenderingStats.prototype.isUsingGpuBenchmarking = function() { - return true; - } - - GpuBenchmarkingRenderingStats.prototype.getRenderingStats_ = function() { - var stats = chrome.gpuBenchmarking.renderingStats(); - stats.totalTimeInSeconds = getTimeMs() / 1000; - return stats; - }; - - /** - * Tracks rendering performance using requestAnimationFrame. - * @constructor - */ - function RafRenderingStats() { - this.recording_ = false; - this.frameTimes_ = []; - } - - RafRenderingStats.prototype.start = function() { - if (this.recording_) - throw new Error('Already started.'); - this.recording_ = true; - requestAnimationFrame(this.recordFrameTime_.bind(this)); - } - - RafRenderingStats.prototype.stop = function() { - this.recording_ = false; - } - - RafRenderingStats.prototype.getStartValues = function() { - var results = {}; - results.numAnimationFrames = 0; - results.numFramesSentToScreen = 0; - results.droppedFrameCount = 0; - return results; - } - - RafRenderingStats.prototype.getEndValues = function() { - var results = {}; - results.numAnimationFrames = this.frameTimes_.length - 1; - results.numFramesSentToScreen = results.numAnimationFrames; - results.droppedFrameCount = this.getDroppedFrameCount_(this.frameTimes_); - return results; - } - - RafRenderingStats.prototype.getDeltas = function() { - var endValues = this.getEndValues(); - endValues.totalTimeInSeconds = ( - this.frameTimes_[this.frameTimes_.length - 1] - - this.frameTimes_[0]) / 1000; - return endValues; - }; - - RafRenderingStats.prototype.isUsingGpuBenchmarking = function() { - return false; - } - - RafRenderingStats.prototype.recordFrameTime_ = function(timestamp) { - if (!this.recording_) - return; - - this.frameTimes_.push(timestamp); - requestAnimationFrame(this.recordFrameTime_.bind(this)); - }; - - RafRenderingStats.prototype.getDroppedFrameCount_ = function(frameTimes) { - var droppedFrameCount = 0; - var droppedFrameThreshold = 1000 / 55; - for (var i = 1; i < frameTimes.length; i++) { - var frameTime = frameTimes[i] - frameTimes[i-1]; - if (frameTime > droppedFrameThreshold) - droppedFrameCount += Math.floor(frameTime / droppedFrameThreshold); - } - return droppedFrameCount; - }; - - function RenderingStats() { - if (window.chrome && chrome.gpuBenchmarking && - chrome.gpuBenchmarking.renderingStats) { - return new GpuBenchmarkingRenderingStats(); - } - return new RafRenderingStats(); - } - - window.__RenderingStats = RenderingStats; -})(); diff --git a/webkit/renderer/compositor_bindings/web_rendering_stats_impl.h b/webkit/renderer/compositor_bindings/web_rendering_stats_impl.h deleted file mode 100644 index 2b347af9f8937f..00000000000000 --- a/webkit/renderer/compositor_bindings/web_rendering_stats_impl.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_RENDERING_STATS_IMPL_H_ -#define WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_RENDERING_STATS_IMPL_H_ - -#include "cc/debug/rendering_stats.h" -#include "third_party/WebKit/public/platform/WebRenderingStats.h" - -namespace blink { - -struct WebRenderingStatsImpl : public WebRenderingStats { - WebRenderingStatsImpl() {} - - cc::RenderingStats rendering_stats; -}; - -} // namespace blink - -#endif // WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_RENDERING_STATS_IMPL_H_