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

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

Issue 1158673006: Replace various ScrollableArea scroll methods with setScrollPosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Build fix Created 5 years, 6 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 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 void GraphicsLayer::notifyAnimationFinished(double, int group) 1144 void GraphicsLayer::notifyAnimationFinished(double, int group)
1145 { 1145 {
1146 if (m_scrollableArea) 1146 if (m_scrollableArea)
1147 m_scrollableArea->notifyCompositorAnimationFinished(group); 1147 m_scrollableArea->notifyCompositorAnimationFinished(group);
1148 } 1148 }
1149 1149
1150 void GraphicsLayer::didScroll() 1150 void GraphicsLayer::didScroll()
1151 { 1151 {
1152 if (m_scrollableArea) { 1152 if (m_scrollableArea) {
1153 DoublePoint newPosition = m_scrollableArea->minimumScrollPosition() + to DoubleSize(m_layer->layer()->scrollPositionDouble()); 1153 DoublePoint newPosition = m_scrollableArea->minimumScrollPosition() + to DoubleSize(m_layer->layer()->scrollPositionDouble());
1154 bool cancelProgrammaticAnimations = false; 1154
1155 // FIXME: Remove the toFloatPoint(). crbug.com/414283. 1155 // FrameView::setScrollPosition doesn't work for compositor commits (int eracts poorly with programmatic scroll animations)
1156 m_scrollableArea->scrollToOffsetWithoutAnimation(toFloatPoint(newPositio n), cancelProgrammaticAnimations); 1156 // so we need to use the ScrollableArea version. The FrameView method sh ould go away soon anyway.
1157 m_scrollableArea->ScrollableArea::setScrollPosition(newPosition, Composi torScroll);
1157 } 1158 }
1158 } 1159 }
1159 1160
1160 DisplayItemList* GraphicsLayer::displayItemList() 1161 DisplayItemList* GraphicsLayer::displayItemList()
1161 { 1162 {
1162 if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) 1163 if (!RuntimeEnabledFeatures::slimmingPaintEnabled())
1163 return 0; 1164 return 0;
1164 if (!m_displayItemList) 1165 if (!m_displayItemList)
1165 m_displayItemList = DisplayItemList::create(); 1166 m_displayItemList = DisplayItemList::create();
1166 return m_displayItemList.get(); 1167 return m_displayItemList.get();
1167 } 1168 }
1168 1169
1169 } // namespace blink 1170 } // namespace blink
1170 1171
1171 #ifndef NDEBUG 1172 #ifndef NDEBUG
1172 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) 1173 void showGraphicsLayerTree(const blink::GraphicsLayer* layer)
1173 { 1174 {
1174 if (!layer) { 1175 if (!layer) {
1175 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); 1176 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n");
1176 return; 1177 return;
1177 } 1178 }
1178 1179
1179 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1180 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1180 fprintf(stderr, "%s\n", output.utf8().data()); 1181 fprintf(stderr, "%s\n", output.utf8().data());
1181 } 1182 }
1182 #endif 1183 #endif
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXScrollbar.cpp ('k') | Source/platform/graphics/GraphicsLayerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698