| OLD | NEW |
| 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_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 } | 919 } |
| 920 | 920 |
| 921 // Calculate filtered time per frame: | 921 // Calculate filtered time per frame: |
| 922 float frame_time_elapsed = static_cast<float>(delay.InSecondsF()); | 922 float frame_time_elapsed = static_cast<float>(delay.InSecondsF()); |
| 923 filtered_time_per_frame_ = | 923 filtered_time_per_frame_ = |
| 924 0.9f * filtered_time_per_frame_ + 0.1f * frame_time_elapsed; | 924 0.9f * filtered_time_per_frame_ + 0.1f * frame_time_elapsed; |
| 925 } | 925 } |
| 926 last_do_deferred_update_time_ = frame_begin_ticks; | 926 last_do_deferred_update_time_ = frame_begin_ticks; |
| 927 | 927 |
| 928 if (!is_accelerated_compositing_active_) { | 928 if (!is_accelerated_compositing_active_) { |
| 929 software_stats_.numAnimationFrames++; | 929 software_stats_.mainAnimationFrameCount++; |
| 930 software_stats_.numFramesSentToScreen++; | 930 software_stats_.rendererFrameCount++; |
| 931 } | 931 } |
| 932 | 932 |
| 933 // OK, save the pending update to a local since painting may cause more | 933 // OK, save the pending update to a local since painting may cause more |
| 934 // invalidation. Some WebCore rendering objects only layout when painted. | 934 // invalidation. Some WebCore rendering objects only layout when painted. |
| 935 PaintAggregator::PendingUpdate update; | 935 PaintAggregator::PendingUpdate update; |
| 936 paint_aggregator_.PopPendingUpdate(&update); | 936 paint_aggregator_.PopPendingUpdate(&update); |
| 937 | 937 |
| 938 gfx::Rect scroll_damage = update.GetScrollDamage(); | 938 gfx::Rect scroll_damage = update.GetScrollDamage(); |
| 939 gfx::Rect bounds = update.GetPaintBounds().Union(scroll_damage); | 939 gfx::Rect bounds = update.GetPaintBounds().Union(scroll_damage); |
| 940 | 940 |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 i != plugin_window_moves_.end(); ++i) { | 1856 i != plugin_window_moves_.end(); ++i) { |
| 1857 if (i->window == window) { | 1857 if (i->window == window) { |
| 1858 plugin_window_moves_.erase(i); | 1858 plugin_window_moves_.erase(i); |
| 1859 break; | 1859 break; |
| 1860 } | 1860 } |
| 1861 } | 1861 } |
| 1862 } | 1862 } |
| 1863 | 1863 |
| 1864 void RenderWidget::GetRenderingStats(WebKit::WebRenderingStats& stats) const { | 1864 void RenderWidget::GetRenderingStats(WebKit::WebRenderingStats& stats) const { |
| 1865 webwidget()->renderingStats(stats); | 1865 webwidget()->renderingStats(stats); |
| 1866 stats.numAnimationFrames += software_stats_.numAnimationFrames; | 1866 stats.mainAnimationFrameCount += software_stats_.mainAnimationFrameCount; |
| 1867 stats.numFramesSentToScreen += software_stats_.numFramesSentToScreen; | 1867 stats.rendererFrameCount += software_stats_.rendererFrameCount; |
| 1868 stats.totalPaintTimeInSeconds += software_stats_.totalPaintTimeInSeconds; | 1868 stats.totalPaintTimeInSeconds += software_stats_.totalPaintTimeInSeconds; |
| 1869 } | 1869 } |
| 1870 | 1870 |
| 1871 bool RenderWidget::GetGpuRenderingStats( | 1871 bool RenderWidget::GetGpuRenderingStats( |
| 1872 content::GpuRenderingStats* stats) const { | 1872 content::GpuRenderingStats* stats) const { |
| 1873 GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); | 1873 GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); |
| 1874 if (!gpu_channel) | 1874 if (!gpu_channel) |
| 1875 return false; | 1875 return false; |
| 1876 | 1876 |
| 1877 return gpu_channel->CollectRenderingStatsForSurface(surface_id(), stats); | 1877 return gpu_channel->CollectRenderingStatsForSurface(surface_id(), stats); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1890 pending_smooth_scroll_gestures_.insert(std::make_pair(id, callback)); | 1890 pending_smooth_scroll_gestures_.insert(std::make_pair(id, callback)); |
| 1891 } | 1891 } |
| 1892 | 1892 |
| 1893 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 1893 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
| 1894 return false; | 1894 return false; |
| 1895 } | 1895 } |
| 1896 | 1896 |
| 1897 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1897 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
| 1898 return false; | 1898 return false; |
| 1899 } | 1899 } |
| OLD | NEW |