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