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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

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: finish animations on main 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 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 linkHighlight->layer()->setLayerClient(this); 1167 linkHighlight->layer()->setLayerClient(this);
1168 updateChildList(); 1168 updateChildList();
1169 } 1169 }
1170 1170
1171 void GraphicsLayer::removeLinkHighlight(LinkHighlight* linkHighlight) 1171 void GraphicsLayer::removeLinkHighlight(LinkHighlight* linkHighlight)
1172 { 1172 {
1173 m_linkHighlights.remove(m_linkHighlights.find(linkHighlight)); 1173 m_linkHighlights.remove(m_linkHighlights.find(linkHighlight));
1174 updateChildList(); 1174 updateChildList();
1175 } 1175 }
1176 1176
1177 void GraphicsLayer::setMainThreadScrollingReasons(uint32_t reasons)
1178 {
1179 if (!reasons && m_scrollableArea) {
1180 // There may be a scroll animation running on the main thread. Forward
1181 // the call to the ScrollAnimator that will clear the main thread
1182 // scrolling reasons after the animation is complete.
1183 m_scrollableArea->clearMainThreadScrollingReasons(true);
1184 return;
1185 }
1186 if (WebLayer* scrollLayer = platformLayer()) {
1187 // The ScrollAnimator will override this main thread scrolling reason if
1188 // it is added while the ScrollAnimator is scheduled to clear the main
1189 // thread scrolling reason (from call above). Thus, inform it to not
1190 // clear the main thread scrolling reasons.
1191 m_scrollableArea->clearMainThreadScrollingReasons(false);
1192 scrollLayer->addMainThreadScrollingReasons(reasons);
ajuma 2016/02/04 15:05:48 Would it simplify things if the main thread scroll
1193 }
1194 }
1195
1177 void GraphicsLayer::setScrollableArea(ScrollableArea* scrollableArea, bool isVie wport) 1196 void GraphicsLayer::setScrollableArea(ScrollableArea* scrollableArea, bool isVie wport)
1178 { 1197 {
1179 if (m_scrollableArea == scrollableArea) 1198 if (m_scrollableArea == scrollableArea)
1180 return; 1199 return;
1181 1200
1182 m_scrollableArea = scrollableArea; 1201 m_scrollableArea = scrollableArea;
1183 1202
1184 // Viewport scrolling may involve pinch zoom and gets routed through 1203 // Viewport scrolling may involve pinch zoom and gets routed through
1185 // WebViewImpl explicitly rather than via GraphicsLayer::didScroll. 1204 // WebViewImpl explicitly rather than via GraphicsLayer::didScroll.
1186 if (isViewport) 1205 if (isViewport)
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 { 1271 {
1253 if (!layer) { 1272 if (!layer) {
1254 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); 1273 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n");
1255 return; 1274 return;
1256 } 1275 }
1257 1276
1258 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1277 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1259 fprintf(stderr, "%s\n", output.utf8().data()); 1278 fprintf(stderr, "%s\n", output.utf8().data());
1260 } 1279 }
1261 #endif 1280 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698