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

Side by Side Diff: Source/core/rendering/RenderLayerCompositor.cpp

Issue 18187004: Don't update graphics layer positions during coordinated scrolling (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ifdefs, expectations, rtl fixes Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 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 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 } 1168 }
1169 1169
1170 void RenderLayerCompositor::frameViewDidScroll() 1170 void RenderLayerCompositor::frameViewDidScroll()
1171 { 1171 {
1172 FrameView* frameView = m_renderView->frameView(); 1172 FrameView* frameView = m_renderView->frameView();
1173 IntPoint scrollPosition = frameView->scrollPosition(); 1173 IntPoint scrollPosition = frameView->scrollPosition();
1174 1174
1175 if (!m_scrollLayer) 1175 if (!m_scrollLayer)
1176 return; 1176 return;
1177 1177
1178 // If there's a scrolling coordinator that manages scrolling for this frame view, 1178 bool scrollingCoordinatorHandlesOffset = false;
1179 // it will also manage updating the scroll layer position.
1180 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator( )) { 1179 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator( )) {
1181 if (Settings* settings = m_renderView->document()->settings()) { 1180 if (Settings* settings = m_renderView->document()->settings()) {
1182 if (isMainFrame() || settings->compositedScrollingForFramesEnabled() ) 1181 if (isMainFrame() || settings->compositedScrollingForFramesEnabled() )
1183 scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameVi ew); 1182 scrollingCoordinatorHandlesOffset = scrollingCoordinator->scroll ableAreaScrollLayerDidChange(frameView);
1184 } 1183 }
1185 } 1184 }
1186 1185
1187 m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y ())); 1186 #ifndef BLINK_SCROLLING_POSITION_NO_OFFSET
1187 // FIXME: Remove when possible. Only required to stage multi-repo change.
1188 scrollingCoordinatorHandlesOffset = false;
1189 #endif
1190
1191 // Scroll position = scroll minimum + scroll offset. Adjust the layer's
1192 // position to handle whatever the scroll coordinator isn't handling.
1193 // The minimum scroll position is non-zero for RTL pages with overflow.
1194 if (scrollingCoordinatorHandlesOffset)
1195 m_scrollLayer->setPosition(-frameView->minimumScrollPosition());
1196 else
1197 m_scrollLayer->setPosition(-scrollPosition);
1188 } 1198 }
1189 1199
1190 void RenderLayerCompositor::frameViewDidLayout() 1200 void RenderLayerCompositor::frameViewDidLayout()
1191 { 1201 {
1192 } 1202 }
1193 1203
1194 void RenderLayerCompositor::rootFixedBackgroundsChanged() 1204 void RenderLayerCompositor::rootFixedBackgroundsChanged()
1195 { 1205 {
1196 if (!supportsFixedRootBackgroundCompositing()) 1206 if (!supportsFixedRootBackgroundCompositing())
1197 return; 1207 return;
1198 1208
1199 // To avoid having to make the fixed root background layer fixed positioned to 1209 // To avoid having to make the fixed root background layer fixed positioned to
1200 // stay put, we position it in the layer tree as follows: 1210 // stay put, we position it in the layer tree as follows:
1201 // 1211 //
1202 // + Overflow controls host 1212 // + Overflow controls host
1203 // + Frame clip 1213 // + Frame clip
1204 // + (Fixed root background) <-- Here. 1214 // + (Fixed root background) <-- Here.
1205 // + Frame scroll 1215 // + Frame scroll
1206 // + Root content layer 1216 // + Root content layer
1207 // + Scrollbars 1217 // + Scrollbars
1208 // 1218 //
1209 // That is, it needs to be the first child of the frame clip, the sibling of 1219 // That is, it needs to be the first child of the frame clip, the sibling of
1210 // the frame scroll layer. The compositor does not own the background layer, it 1220 // the frame scroll layer. The compositor does not own the background layer, it
1211 // just positions it (like the foreground layer). 1221 // just positions it (like the foreground layer).
1212 if (GraphicsLayer* backgroundLayer = fixedRootBackgroundLayer()) 1222 if (GraphicsLayer* backgroundLayer = fixedRootBackgroundLayer())
1213 m_clipLayer->addChildBelow(backgroundLayer, m_scrollLayer.get()); 1223 m_clipLayer->addChildBelow(backgroundLayer, m_scrollLayer.get());
1214 } 1224 }
1215 1225
1216 void RenderLayerCompositor::scrollingLayerDidChange(RenderLayer* layer) 1226 bool RenderLayerCompositor::scrollingLayerDidChange(RenderLayer* layer)
1217 { 1227 {
1218 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator( )) 1228 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator( ))
1219 scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer); 1229 return scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer);
1230 return false;
1220 } 1231 }
1221 1232
1222 String RenderLayerCompositor::layerTreeAsText(LayerTreeFlags flags) 1233 String RenderLayerCompositor::layerTreeAsText(LayerTreeFlags flags)
1223 { 1234 {
1224 updateCompositingLayers(CompositingUpdateAfterLayout); 1235 updateCompositingLayers(CompositingUpdateAfterLayout);
1225 1236
1226 if (!m_rootContentLayer) 1237 if (!m_rootContentLayer)
1227 return String(); 1238 return String();
1228 1239
1229 // We skip dumping the scroll and clip layers to keep layerTreeAsText output 1240 // We skip dumping the scroll and clip layers to keep layerTreeAsText output
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
2755 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); 2766 info.addMember(m_layerForScrollCorner, "layerForScrollCorner");
2756 #if ENABLE(RUBBER_BANDING) 2767 #if ENABLE(RUBBER_BANDING)
2757 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); 2768 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas");
2758 info.addMember(m_contentShadowLayer, "contentShadowLayer"); 2769 info.addMember(m_contentShadowLayer, "contentShadowLayer");
2759 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); 2770 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea");
2760 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); 2771 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea");
2761 #endif 2772 #endif
2762 } 2773 }
2763 2774
2764 } // namespace WebCore 2775 } // namespace WebCore
OLDNEW
« Source/core/rendering/RenderLayerBacking.cpp ('K') | « Source/core/rendering/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698