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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 needs_repainting_on_restore_ = true; | 822 needs_repainting_on_restore_ = true; |
823 TRACE_EVENT0("renderer", "EarlyOut_NotVisible"); | 823 TRACE_EVENT0("renderer", "EarlyOut_NotVisible"); |
824 return; | 824 return; |
825 } | 825 } |
826 | 826 |
827 if (is_accelerated_compositing_active_) | 827 if (is_accelerated_compositing_active_) |
828 using_asynchronous_swapbuffers_ = SupportsAsynchronousSwapBuffers(); | 828 using_asynchronous_swapbuffers_ = SupportsAsynchronousSwapBuffers(); |
829 | 829 |
830 // Tracking of frame rate jitter | 830 // Tracking of frame rate jitter |
831 base::TimeTicks frame_begin_ticks = base::TimeTicks::Now(); | 831 base::TimeTicks frame_begin_ticks = base::TimeTicks::Now(); |
| 832 webwidget_->instrumentBeginFrame(); |
832 AnimateIfNeeded(); | 833 AnimateIfNeeded(); |
833 | 834 |
834 // Layout may generate more invalidation. It may also enable the | 835 // Layout may generate more invalidation. It may also enable the |
835 // GPU acceleration, so make sure to run layout before we send the | 836 // GPU acceleration, so make sure to run layout before we send the |
836 // GpuRenderingActivated message. | 837 // GpuRenderingActivated message. |
837 webwidget_->layout(); | 838 webwidget_->layout(); |
838 | 839 |
839 // The following two can result in further layout and possibly | 840 // The following two can result in further layout and possibly |
840 // enable GPU acceleration so they need to be called before any painting | 841 // enable GPU acceleration so they need to be called before any painting |
841 // is done. | 842 // is done. |
842 UpdateTextInputState(); | 843 UpdateTextInputState(); |
843 UpdateSelectionBounds(); | 844 UpdateSelectionBounds(); |
844 | 845 |
845 // Suppress painting if nothing is dirty. This has to be done after updating | 846 // Suppress painting if nothing is dirty. This has to be done after updating |
846 // animations running layout as these may generate further invalidations. | 847 // animations running layout as these may generate further invalidations. |
847 if (!paint_aggregator_.HasPendingUpdate()) { | 848 if (!paint_aggregator_.HasPendingUpdate()) { |
848 TRACE_EVENT0("renderer", "EarlyOut_NoPendingUpdate"); | 849 TRACE_EVENT0("renderer", "EarlyOut_NoPendingUpdate"); |
| 850 webwidget_->instrumentCancelFrame(); |
849 return; | 851 return; |
850 } | 852 } |
851 | 853 |
852 if (!last_do_deferred_update_time_.is_null()) { | 854 if (!last_do_deferred_update_time_.is_null()) { |
853 base::TimeDelta delay = frame_begin_ticks - last_do_deferred_update_time_; | 855 base::TimeDelta delay = frame_begin_ticks - last_do_deferred_update_time_; |
854 if (is_accelerated_compositing_active_) { | 856 if (is_accelerated_compositing_active_) { |
855 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer4.AccelDoDeferredUpdateDelay", | 857 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer4.AccelDoDeferredUpdateDelay", |
856 delay, | 858 delay, |
857 base::TimeDelta::FromMilliseconds(1), | 859 base::TimeDelta::FromMilliseconds(1), |
858 base::TimeDelta::FromMilliseconds(60), | 860 base::TimeDelta::FromMilliseconds(60), |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 } | 1665 } |
1664 } | 1666 } |
1665 | 1667 |
1666 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 1668 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
1667 return false; | 1669 return false; |
1668 } | 1670 } |
1669 | 1671 |
1670 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1672 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
1671 return false; | 1673 return false; |
1672 } | 1674 } |
OLD | NEW |