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

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_impl.cc

Issue 136173004: Early terminate flings when scrolling impossible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/browser/android/in_process/synchronous_compositor_impl.h" 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "cc/input/input_handler.h" 9 #include "cc/input/input_handler.h"
10 #include "cc/input/layer_scroll_offset_delegate.h"
11 #include "content/browser/android/in_process/synchronous_compositor_factory_impl .h" 10 #include "content/browser/android/in_process/synchronous_compositor_factory_impl .h"
12 #include "content/browser/android/in_process/synchronous_input_event_filter.h" 11 #include "content/browser/android/in_process/synchronous_input_event_filter.h"
13 #include "content/browser/renderer_host/render_widget_host_view_android.h" 12 #include "content/browser/renderer_host/render_widget_host_view_android.h"
13 #include "content/common/input/did_overscroll_params.h"
14 #include "content/public/browser/android/synchronous_compositor_client.h" 14 #include "content/public/browser/android/synchronous_compositor_client.h"
15 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
16 #include "content/public/browser/render_process_host.h" 16 #include "content/public/browser/render_process_host.h"
17 #include "content/public/browser/render_view_host.h" 17 #include "content/public/browser/render_view_host.h"
18 #include "ui/gl/gl_surface.h" 18 #include "ui/gl/gl_surface.h"
19 19
20 namespace content { 20 namespace content {
21 21
22 namespace { 22 namespace {
23 23
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 if (input_handler_) 177 if (input_handler_)
178 input_handler_->SetRootLayerScrollOffsetDelegate(NULL); 178 input_handler_->SetRootLayerScrollOffsetDelegate(NULL);
179 179
180 input_handler_ = input_handler; 180 input_handler_ = input_handler;
181 181
182 if (input_handler_) 182 if (input_handler_)
183 input_handler_->SetRootLayerScrollOffsetDelegate(this); 183 input_handler_->SetRootLayerScrollOffsetDelegate(this);
184 } 184 }
185 185
186 void SynchronousCompositorImpl::DidOverscroll( 186 void SynchronousCompositorImpl::DidOverscroll(
187 const cc::DidOverscrollParams& params) { 187 const DidOverscrollParams& params) {
188 if (compositor_client_) { 188 if (compositor_client_) {
189 compositor_client_->DidOverscroll(params.accumulated_overscroll, 189 compositor_client_->DidOverscroll(params.accumulated_overscroll,
190 params.latest_overscroll_delta, 190 params.latest_overscroll_delta,
191 params.current_fling_velocity); 191 params.current_fling_velocity);
192 } 192 }
193 } 193 }
194 194
195 void SynchronousCompositorImpl::DidStopFlinging() { 195 void SynchronousCompositorImpl::DidStopFlinging() {
196 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( 196 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>(
197 contents_->GetRenderWidgetHostView()); 197 contents_->GetRenderWidgetHostView());
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 g_factory.Get(); // Ensure it's initialized. 285 g_factory.Get(); // Ensure it's initialized.
286 SynchronousCompositorImpl::CreateForWebContents(contents); 286 SynchronousCompositorImpl::CreateForWebContents(contents);
287 } 287 }
288 if (SynchronousCompositorImpl* instance = 288 if (SynchronousCompositorImpl* instance =
289 SynchronousCompositorImpl::FromWebContents(contents)) { 289 SynchronousCompositorImpl::FromWebContents(contents)) {
290 instance->SetClient(client); 290 instance->SetClient(client);
291 } 291 }
292 } 292 }
293 293
294 } // namespace content 294 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698