| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 | 820 |
| 821 void RenderWidgetCompositor::setTopControlsHeight(float height, bool shrink) { | 821 void RenderWidgetCompositor::setTopControlsHeight(float height, bool shrink) { |
| 822 layer_tree_host_->SetTopControlsHeight(height, shrink); | 822 layer_tree_host_->SetTopControlsHeight(height, shrink); |
| 823 } | 823 } |
| 824 | 824 |
| 825 void RenderWidgetCompositor::setTopControlsShownRatio(float ratio) { | 825 void RenderWidgetCompositor::setTopControlsShownRatio(float ratio) { |
| 826 layer_tree_host_->SetTopControlsShownRatio(ratio); | 826 layer_tree_host_->SetTopControlsShownRatio(ratio); |
| 827 } | 827 } |
| 828 | 828 |
| 829 void RenderWidgetCompositor::WillBeginMainFrame() { | 829 void RenderWidgetCompositor::WillBeginMainFrame() { |
| 830 widget_->willBeginCompositorFrame(); | 830 widget_->WillBeginCompositorFrame(); |
| 831 } | 831 } |
| 832 | 832 |
| 833 void RenderWidgetCompositor::DidBeginMainFrame() { | 833 void RenderWidgetCompositor::DidBeginMainFrame() { |
| 834 } | 834 } |
| 835 | 835 |
| 836 void RenderWidgetCompositor::BeginMainFrame(const cc::BeginFrameArgs& args) { | 836 void RenderWidgetCompositor::BeginMainFrame(const cc::BeginFrameArgs& args) { |
| 837 double frame_time_sec = (args.frame_time - base::TimeTicks()).InSecondsF(); | 837 double frame_time_sec = (args.frame_time - base::TimeTicks()).InSecondsF(); |
| 838 double deadline_sec = (args.deadline - base::TimeTicks()).InSecondsF(); | 838 double deadline_sec = (args.deadline - base::TimeTicks()).InSecondsF(); |
| 839 double interval_sec = args.interval.InSecondsF(); | 839 double interval_sec = args.interval.InSecondsF(); |
| 840 WebBeginFrameArgs web_begin_frame_args = | 840 WebBeginFrameArgs web_begin_frame_args = |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 void RenderWidgetCompositor::WillCommit() { | 922 void RenderWidgetCompositor::WillCommit() { |
| 923 if (!layout_and_paint_async_callback_) | 923 if (!layout_and_paint_async_callback_) |
| 924 return; | 924 return; |
| 925 layout_and_paint_async_callback_->didLayoutAndPaint(); | 925 layout_and_paint_async_callback_->didLayoutAndPaint(); |
| 926 layout_and_paint_async_callback_ = nullptr; | 926 layout_and_paint_async_callback_ = nullptr; |
| 927 } | 927 } |
| 928 | 928 |
| 929 void RenderWidgetCompositor::DidCommit() { | 929 void RenderWidgetCompositor::DidCommit() { |
| 930 DCHECK(!temporary_copy_output_request_); | 930 DCHECK(!temporary_copy_output_request_); |
| 931 widget_->DidCommitCompositorFrame(); | 931 widget_->DidCommitCompositorFrame(); |
| 932 widget_->didBecomeReadyForAdditionalInput(); | |
| 933 compositor_deps_->GetRendererScheduler()->DidCommitFrameToCompositor(); | 932 compositor_deps_->GetRendererScheduler()->DidCommitFrameToCompositor(); |
| 934 } | 933 } |
| 935 | 934 |
| 936 void RenderWidgetCompositor::DidCommitAndDrawFrame() { | 935 void RenderWidgetCompositor::DidCommitAndDrawFrame() { |
| 937 widget_->didCommitAndDrawCompositorFrame(); | 936 widget_->DidCommitAndDrawCompositorFrame(); |
| 938 } | 937 } |
| 939 | 938 |
| 940 void RenderWidgetCompositor::DidCompleteSwapBuffers() { | 939 void RenderWidgetCompositor::DidCompleteSwapBuffers() { |
| 941 widget_->didCompleteSwapBuffers(); | 940 widget_->DidCompleteSwapBuffers(); |
| 942 bool threaded = !!compositor_deps_->GetCompositorImplThreadTaskRunner().get(); | 941 bool threaded = !!compositor_deps_->GetCompositorImplThreadTaskRunner().get(); |
| 943 if (!threaded) | 942 if (!threaded) |
| 944 widget_->OnSwapBuffersComplete(); | 943 widget_->OnSwapBuffersComplete(); |
| 945 } | 944 } |
| 946 | 945 |
| 947 void RenderWidgetCompositor::DidCompletePageScaleAnimation() { | 946 void RenderWidgetCompositor::DidCompletePageScaleAnimation() { |
| 948 widget_->DidCompletePageScaleAnimation(); | 947 widget_->DidCompletePageScaleAnimation(); |
| 949 } | 948 } |
| 950 | 949 |
| 951 void RenderWidgetCompositor::ScheduleAnimation() { | 950 void RenderWidgetCompositor::ScheduleAnimation() { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 return; | 1000 return; |
| 1002 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 1001 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 1003 } | 1002 } |
| 1004 | 1003 |
| 1005 void RenderWidgetCompositor::SetSurfaceIdNamespace( | 1004 void RenderWidgetCompositor::SetSurfaceIdNamespace( |
| 1006 uint32_t surface_id_namespace) { | 1005 uint32_t surface_id_namespace) { |
| 1007 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); | 1006 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); |
| 1008 } | 1007 } |
| 1009 | 1008 |
| 1010 } // namespace content | 1009 } // namespace content |
| OLD | NEW |