Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 2884423003: Use scroll-boundary-behavior to control overscroll-refresh/glow on android. (Closed)
Patch Set: Added missing files Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <limits> 10 #include <limits>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 namespace cc { 78 namespace cc {
79 class Layer; 79 class Layer;
80 } 80 }
81 81
82 using blink::WebFloatPoint; 82 using blink::WebFloatPoint;
83 using blink::WebRect; 83 using blink::WebRect;
84 using blink::WebSelection; 84 using blink::WebSelection;
85 using blink::WebSize; 85 using blink::WebSize;
86 using blink::WebBrowserControlsState; 86 using blink::WebBrowserControlsState;
87 using blink::WebScrollBoundaryBehavior;
87 88
88 namespace content { 89 namespace content {
89 namespace { 90 namespace {
90 91
91 using ReportTimeCallback = base::Callback<void(bool, double)>; 92 using ReportTimeCallback = base::Callback<void(bool, double)>;
92 93
93 double MonotonicallyIncreasingTime() { 94 double MonotonicallyIncreasingTime() {
94 return static_cast<double>(base::TimeTicks::Now().ToInternalValue()) / 95 return static_cast<double>(base::TimeTicks::Now().ToInternalValue()) /
95 base::Time::kMicrosecondsPerSecond; 96 base::Time::kMicrosecondsPerSecond;
96 } 97 }
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 } 1065 }
1065 1066
1066 void RenderWidgetCompositor::SetBrowserControlsShownRatio(float ratio) { 1067 void RenderWidgetCompositor::SetBrowserControlsShownRatio(float ratio) {
1067 layer_tree_host_->SetBrowserControlsShownRatio(ratio); 1068 layer_tree_host_->SetBrowserControlsShownRatio(ratio);
1068 } 1069 }
1069 1070
1070 void RenderWidgetCompositor::setBottomControlsHeight(float height) { 1071 void RenderWidgetCompositor::setBottomControlsHeight(float height) {
1071 layer_tree_host_->SetBottomControlsHeight(height); 1072 layer_tree_host_->SetBottomControlsHeight(height);
1072 } 1073 }
1073 1074
1075 void RenderWidgetCompositor::SetScrollBoundaryBehavior(
1076 WebScrollBoundaryBehavior behavior) const {
1077 layer_tree_host_->SetScrollBoundaryBehavior(behavior);
1078 }
1079
1074 void RenderWidgetCompositor::WillBeginMainFrame() { 1080 void RenderWidgetCompositor::WillBeginMainFrame() {
1075 delegate_->WillBeginCompositorFrame(); 1081 delegate_->WillBeginCompositorFrame();
1076 } 1082 }
1077 1083
1078 void RenderWidgetCompositor::DidBeginMainFrame() {} 1084 void RenderWidgetCompositor::DidBeginMainFrame() {}
1079 1085
1080 void RenderWidgetCompositor::BeginMainFrame(const cc::BeginFrameArgs& args) { 1086 void RenderWidgetCompositor::BeginMainFrame(const cc::BeginFrameArgs& args) {
1081 compositor_deps_->GetRendererScheduler()->WillBeginFrame(args); 1087 compositor_deps_->GetRendererScheduler()->WillBeginFrame(args);
1082 double frame_time_sec = (args.frame_time - base::TimeTicks()).InSecondsF(); 1088 double frame_time_sec = (args.frame_time - base::TimeTicks()).InSecondsF();
1083 delegate_->BeginMainFrame(frame_time_sec); 1089 delegate_->BeginMainFrame(frame_time_sec);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 const cc::LocalSurfaceId& local_surface_id) { 1218 const cc::LocalSurfaceId& local_surface_id) {
1213 layer_tree_host_->SetLocalSurfaceId(local_surface_id); 1219 layer_tree_host_->SetLocalSurfaceId(local_surface_id);
1214 } 1220 }
1215 1221
1216 void RenderWidgetCompositor::NotifySwapTime(ReportTimeCallback callback) { 1222 void RenderWidgetCompositor::NotifySwapTime(ReportTimeCallback callback) {
1217 QueueSwapPromise(base::MakeUnique<ReportTimeSwapPromise>( 1223 QueueSwapPromise(base::MakeUnique<ReportTimeSwapPromise>(
1218 std::move(callback), base::ThreadTaskRunnerHandle::Get())); 1224 std::move(callback), base::ThreadTaskRunnerHandle::Get()));
1219 } 1225 }
1220 1226
1221 } // namespace content 1227 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698