Commit 5d5a062f authored by Sahel Sharify's avatar Sahel Sharify Committed by Commit Bot

Send GSB before switching to mainthread scrolling in smooth scroll path.

This cl is the equivalent of https://codereview.chromium.org/2854683002 fix for smooth scrolling
path,if the compositor handles the GSB and during the scrolling we have to switch to main thread
since the compositor cannot handle a GSU a GSB must be sent to the main thread since the original
GSB was handled on the compositor rather than being sent to the main thread.

touchpad-scroll-impl-to-main.html is the test that forces switch from compositor thread to main
thread in the middle of scrolling. It used to get executed with --disable-smooth-scrolling
in this cl I've moved the test to a new virtual test suite that has default scroll animation
value.

I have removed the test expectations since I have changed the test and this might fix the flake.

subpixel-accumulation.html needs scroll animation to be disabled and that's why I had to move it to
a new test suite.

Bug: 820979, 708499, 757165, 800840
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I21b1f4285897d74559f6827e6a232f007dc897b0
Reviewed-on: https://chromium-review.googlesource.com/961264
Commit-Queue: Sahel Sharifymoghaddam <sahel@chromium.org>
Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543425}
parent 999e75b1
......@@ -2704,9 +2704,6 @@ crbug.com/749738 [ Win7 Debug ] http/tests/devtools/editor/text-editor-word-jump
# Sheriff failures 2017-07-28
crbug.com/749738 [ Win7 Debug ] http/tests/devtools/console/console-format-es6-2.js [ Timeout ]
# Sheriff failure 2017-08-07
crbug.com/708499 [ Linux ] virtual/wheelscrolllatching/fast/compositor-wheel-scroll-latching/touchpad-scroll-impl-to-main.html [ Failure Pass ]
# Sheriff failure 2017-08-29
crbug.com/727252 [ Win7 ] external/wpt/media-source/mediasource-endofstream.html [ Pass Timeout ]
......@@ -2890,7 +2887,6 @@ crbug.com/757165 [ Win ] paint/invalidation/scroll/scrollbar-damage-and-full-vie
crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-filter-modified-save-restore.html [ Skip ]
crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-filter-modified.html [ Skip ]
crbug.com/757165 [ Win ] virtual/threaded/animations/svg/animated-filter-svg-element.html [ Skip ]
crbug.com/757165 [ Win ] virtual/wheelscrolllatching/fast/compositor-wheel-scroll-latching/touchpad-scroll-impl-to-main.html [ Skip ]
crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-blending-clipping.html [ Skip ]
crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-blending-color-over-color.html [ Skip ]
crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-blending-color-over-gradient.html [ Skip ]
......@@ -3190,9 +3186,6 @@ crbug.com/799814 [ Android ] fast/beacon/beacon-basic.html [ Pass Failure ]
# This test has been flaky for some time on Win 7 (dgb)
crbug.com/800078 [ Win7 ] http/tests/devtools/console/console-link-to-snippet.js [ Pass Failure ]
# This test is flaking (failing, crashing) on mac_chromium_rel_ng.
crbug.com/800840 [ Mac ] virtual/wheelscrolllatching/fast/compositor-wheel-scroll-latching/touchpad-scroll-impl-to-main.html [ Skip ]
# Sheriff failures 2018-01-19
# This test is failing regularly on Win 7 (dgb), WebKit Mac10.11 (dgb),
# WebKit Linux Trusty (dbg).
......
......@@ -1061,7 +1061,7 @@ crbug.com/778875 virtual/threaded/fast/animationworklet/animation-worklet-scroll
crbug.com/692310 virtual/threaded/animations/composited-animations-rotate-zero-degrees.html [ Pass Failure Timeout ]
# This test uses internal call to initiate smooth scrolling on impl-thread.
crbug.com/667946 fast/compositor-wheel-scroll-latching/touchpad-scroll-impl-to-main.html [ Failure ]
crbug.com/667946 fast/compositor-wheel-scroll-latching/animated-scroll/touchpad-scroll-impl-to-main.html [ Failure ]
# virtual/threaded variants of sub-directories and tests already skipped or marked as failing above.
......
......@@ -2763,9 +2763,6 @@ crbug.com/749738 [ Win7 Debug ] http/tests/devtools/editor/text-editor-word-jump
# Sheriff failures 2017-08-04
crbug.com/626703 [ Win7 Release ] external/wpt/html/semantics/tabular-data/processing-model-1/span-limits.html [ Timeout ]
# Sheriff failure 2017-08-07
crbug.com/708499 [ Linux ] virtual/wheelscrolllatching/fast/compositor-wheel-scroll-latching/touchpad-scroll-impl-to-main.html [ Failure Pass ]
crbug.com/731018 [ Mac ] sensor/accelerometer.html [ Failure Pass Crash ]
crbug.com/731018 [ Mac ] sensor/ambient-light-sensor.html [ Failure Pass Crash ]
crbug.com/731018 [ Mac ] sensor/gyroscope.html [ Failure Pass Crash ]
......@@ -2947,7 +2944,6 @@ crbug.com/757165 [ Win ] paint/invalidation/scroll/scrollbar-damage-and-full-vie
crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-filter-modified-save-restore.html [ Skip ]
crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-filter-modified.html [ Skip ]
crbug.com/757165 [ Win ] virtual/threaded/animations/svg/animated-filter-svg-element.html [ Skip ]
crbug.com/757165 [ Win ] virtual/wheelscrolllatching/fast/compositor-wheel-scroll-latching/touchpad-scroll-impl-to-main.html [ Skip ]
crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-blending-clipping.html [ Skip ]
crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-blending-color-over-color.html [ Skip ]
crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-blending-color-over-gradient.html [ Skip ]
......@@ -3246,9 +3242,6 @@ crbug.com/798680 external/wpt/pointerevents/pointerlock/pointerevent_pointerlock
crbug.com/804682 [ Mac ] external/wpt/service-workers/service-worker/navigation-preload/resource-timing.https.html [ Pass Failure ]
crbug.com/799137 [ Mac ] virtual/modern-media-controls/media/controls/modern/doubletap-to-jump-backwards-at-start.html [ Pass Timeout ]
# This test is flaking (failing, crashing) on mac_chromium_rel_ng.
crbug.com/800840 [ Mac ] virtual/wheelscrolllatching/fast/compositor-wheel-scroll-latching/touchpad-scroll-impl-to-main.html [ Skip ]
# Sheriff failures 2018-01-23
# Flaking on linux_chromium_rel_ng
crbug.com/804709 [ Linux ] virtual/gpu/fast/canvas/canvas-fillPath-shadow.html [ Pass Failure ]
......
......@@ -319,7 +319,13 @@
},
{
"prefix": "wheelscrolllatching",
"base": "fast/compositor-wheel-scroll-latching",
"base": "fast/compositor-wheel-scroll-latching/animated-scroll",
"args": ["--enable-features=TouchpadAndWheelScrollLatching",
"--enable-threaded-compositing"]
},
{
"prefix": "wheelscrolllatching",
"base": "fast/compositor-wheel-scroll-latching/non-animated-scroll",
"args": ["--enable-features=TouchpadAndWheelScrollLatching",
"--enable-threaded-compositing",
"--disable-smooth-scrolling"]
......
<!DOCTYPE HTML>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<style>
body {
margin: 0px;
......@@ -29,21 +29,21 @@ var rect = div.getBoundingClientRect();
const GESTURE_SOURCE_TYPE = 2; // MOUSE_INPUT from synthetic_gesture_params.h
function changeStyleToScrollOnMain() {
if(div.scrollTop > 150)
if(div.scrollTop > 100)
div.style = "border-radius:40px; position:fixed;";
}
div.addEventListener("scroll", changeStyleToScrollOnMain, {passive: true});
div.addEventListener("wheel", changeStyleToScrollOnMain, {passive: true});
const MAX_RAF = 1000;
let last_scroll_offset = div.scrollTop;
var last_changed_count = 0;
var raf_count = 0;
function waitForAnimationEnd() {
return new Promise((resolve, reject) => {
function tick() {
// We requestAnimationFrame either for 1000 frames or until 20 frames with
// no change have been observed.
if (raf_count >= MAX_RAF || raf_count - last_changed_count > 20) {
// We requestAnimationFrame until either 70 frames with no change observed
// or the div is fully scrolled.
if (raf_count - last_changed_count > 70 ||
div.scrollTop == div.scrollHeight - div.clientHeight) {
resolve();
} else {
if (div.scrollTop != last_scroll_offset) {
......@@ -66,7 +66,7 @@ promise_test(() => {
(rect.top + rect.bottom) / 2,
GESTURE_SOURCE_TYPE,
'down',
4000);
2000);
}).then(waitForAnimationEnd)
.then(() => {
assert_equals(div.scrollTop, div.scrollHeight - div.clientHeight,
......
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script>
let t;
if (window.internals && chrome && chrome.gpuBenchmarking) {
......
This suite runs the tests in fast/compositor-wheel-scroll-latching/animated-scroll with
# --enable-features=TouchpadAndWheelScrollLatching --enable-threaded-compositing
This suite runs the tests in fast/compositor-wheel-scroll-latching with
This suite runs the tests in fast/compositor-wheel-scroll-latching/non-animated-scroll with
# --enable-features=TouchpadAndWheelScrollLatching --enable-threaded-compositing --disable-smooth-scrolling
......@@ -765,7 +765,12 @@ InputHandlerProxy::HandleGestureScrollUpdate(
return DID_HANDLE;
case cc::InputHandler::SCROLL_IGNORED:
return DROP_EVENT;
default:
case cc::InputHandler::SCROLL_ON_MAIN_THREAD:
case cc::InputHandler::SCROLL_UNKNOWN:
if (input_handler_->ScrollingShouldSwitchtoMainThread()) {
gesture_scroll_on_impl_thread_ = false;
client_->GenerateScrollBeginAndSendToMainThread(gesture_event);
}
return DID_NOT_HANDLE;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment