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

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: Mark OverscrollRefresh() as protected. Created 3 years, 3 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 namespace cc { 83 namespace cc {
84 class Layer; 84 class Layer;
85 } 85 }
86 86
87 using blink::WebFloatPoint; 87 using blink::WebFloatPoint;
88 using blink::WebRect; 88 using blink::WebRect;
89 using blink::WebSelection; 89 using blink::WebSelection;
90 using blink::WebSize; 90 using blink::WebSize;
91 using blink::WebBrowserControlsState; 91 using blink::WebBrowserControlsState;
92 using blink::WebLayerTreeView; 92 using blink::WebLayerTreeView;
93 using blink::WebScrollBoundaryBehavior;
93 94
94 namespace content { 95 namespace content {
95 namespace { 96 namespace {
96 97
97 using ReportTimeCallback = 98 using ReportTimeCallback =
98 base::Callback<void(WebLayerTreeView::SwapResult, double)>; 99 base::Callback<void(WebLayerTreeView::SwapResult, double)>;
99 100
100 double MonotonicallyIncreasingTime() { 101 double MonotonicallyIncreasingTime() {
101 return static_cast<double>(base::TimeTicks::Now().ToInternalValue()) / 102 return static_cast<double>(base::TimeTicks::Now().ToInternalValue()) /
102 base::Time::kMicrosecondsPerSecond; 103 base::Time::kMicrosecondsPerSecond;
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 // fact that this would make layout tests slow and cause flakiness. However, 1173 // fact that this would make layout tests slow and cause flakiness. However,
1173 // in this case we actually need a commit to transfer the decode requests to 1174 // in this case we actually need a commit to transfer the decode requests to
1174 // the impl side. So, force a commit to happen. 1175 // the impl side. So, force a commit to happen.
1175 if (CompositeIsSynchronous()) { 1176 if (CompositeIsSynchronous()) {
1176 base::ThreadTaskRunnerHandle::Get()->PostTask( 1177 base::ThreadTaskRunnerHandle::Get()->PostTask(
1177 FROM_HERE, base::Bind(&RenderWidgetCompositor::SynchronouslyComposite, 1178 FROM_HERE, base::Bind(&RenderWidgetCompositor::SynchronouslyComposite,
1178 weak_factory_.GetWeakPtr())); 1179 weak_factory_.GetWeakPtr()));
1179 } 1180 }
1180 } 1181 }
1181 1182
1183 void RenderWidgetCompositor::SetScrollBoundaryBehavior(
1184 const WebScrollBoundaryBehavior& behavior) {
1185 layer_tree_host_->SetScrollBoundaryBehavior(behavior);
1186 }
1187
1182 void RenderWidgetCompositor::WillBeginMainFrame() { 1188 void RenderWidgetCompositor::WillBeginMainFrame() {
1183 delegate_->WillBeginCompositorFrame(); 1189 delegate_->WillBeginCompositorFrame();
1184 } 1190 }
1185 1191
1186 void RenderWidgetCompositor::DidBeginMainFrame() {} 1192 void RenderWidgetCompositor::DidBeginMainFrame() {}
1187 1193
1188 void RenderWidgetCompositor::BeginMainFrame(const viz::BeginFrameArgs& args) { 1194 void RenderWidgetCompositor::BeginMainFrame(const viz::BeginFrameArgs& args) {
1189 compositor_deps_->GetRendererScheduler()->WillBeginFrame(args); 1195 compositor_deps_->GetRendererScheduler()->WillBeginFrame(args);
1190 double frame_time_sec = (args.frame_time - base::TimeTicks()).InSecondsF(); 1196 double frame_time_sec = (args.frame_time - base::TimeTicks()).InSecondsF();
1191 delegate_->BeginMainFrame(frame_time_sec); 1197 delegate_->BeginMainFrame(frame_time_sec);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 void RenderWidgetCompositor::NotifySwapTime(ReportTimeCallback callback) { 1321 void RenderWidgetCompositor::NotifySwapTime(ReportTimeCallback callback) {
1316 QueueSwapPromise(base::MakeUnique<ReportTimeSwapPromise>( 1322 QueueSwapPromise(base::MakeUnique<ReportTimeSwapPromise>(
1317 std::move(callback), base::ThreadTaskRunnerHandle::Get())); 1323 std::move(callback), base::ThreadTaskRunnerHandle::Get()));
1318 } 1324 }
1319 1325
1320 void RenderWidgetCompositor::RequestBeginMainFrameNotExpected(bool new_state) { 1326 void RenderWidgetCompositor::RequestBeginMainFrameNotExpected(bool new_state) {
1321 layer_tree_host_->RequestBeginMainFrameNotExpected(new_state); 1327 layer_tree_host_->RequestBeginMainFrameNotExpected(new_state);
1322 } 1328 }
1323 1329
1324 } // namespace content 1330 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698