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

Side by Side Diff: cc/blink/web_layer_impl.cc

Issue 1648293003: Fix smooth scroll jump when switching scroll handling between MT and CC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove fn to clear all main thread scrolling reasons Created 4 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/blink/web_layer_impl.h" 5 #include "cc/blink/web_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 void WebLayerImpl::addMainThreadScrollingReasons( 323 void WebLayerImpl::addMainThreadScrollingReasons(
324 uint32_t main_thread_scrolling_reasons) { 324 uint32_t main_thread_scrolling_reasons) {
325 // WebLayerImpl should only know about non-transient scrolling 325 // WebLayerImpl should only know about non-transient scrolling
326 // reasons. Transient scrolling reasons are computed per hit test. 326 // reasons. Transient scrolling reasons are computed per hit test.
327 DCHECK(main_thread_scrolling_reasons); 327 DCHECK(main_thread_scrolling_reasons);
328 DCHECK(cc::MainThreadScrollingReason::MainThreadCanSetScrollReasons( 328 DCHECK(cc::MainThreadScrollingReason::MainThreadCanSetScrollReasons(
329 main_thread_scrolling_reasons)); 329 main_thread_scrolling_reasons));
330 layer_->AddMainThreadScrollingReasons(main_thread_scrolling_reasons); 330 layer_->AddMainThreadScrollingReasons(main_thread_scrolling_reasons);
331 } 331 }
332 332
333 void WebLayerImpl::clearMainThreadScrollingReasons() { 333 void WebLayerImpl::clearMainThreadScrollingReasons(
334 layer_->ClearMainThreadScrollingReasons(); 334 uint32_t main_thread_scrolling_reasons_to_clear) {
335 layer_->ClearMainThreadScrollingReasons(
336 main_thread_scrolling_reasons_to_clear);
335 } 337 }
336 338
337 bool WebLayerImpl::shouldScrollOnMainThread() const { 339 bool WebLayerImpl::shouldScrollOnMainThread() const {
338 return layer_->should_scroll_on_main_thread(); 340 return layer_->should_scroll_on_main_thread();
339 } 341 }
340 342
341 void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects) { 343 void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects) {
342 cc::Region region; 344 cc::Region region;
343 for (size_t i = 0; i < rects.size(); ++i) 345 for (size_t i = 0; i < rects.size(); ++i)
344 region.Union(rects[i]); 346 region.Union(rects[i]);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 500
499 Layer* WebLayerImpl::layer() const { 501 Layer* WebLayerImpl::layer() const {
500 return layer_.get(); 502 return layer_.get();
501 } 503 }
502 504
503 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) { 505 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) {
504 contents_opaque_is_fixed_ = fixed; 506 contents_opaque_is_fixed_ = fixed;
505 } 507 }
506 508
507 } // namespace cc_blink 509 } // namespace cc_blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698