OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 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 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 bool CompositedDeprecatedPaintLayerMapping::toggleScrollbarLayerIfNeeded(OwnPtr<
GraphicsLayer>& layer, bool needsLayer, CompositingReasons reason) | 1279 bool CompositedDeprecatedPaintLayerMapping::toggleScrollbarLayerIfNeeded(OwnPtr<
GraphicsLayer>& layer, bool needsLayer, CompositingReasons reason) |
1280 { | 1280 { |
1281 if (needsLayer == !!layer) | 1281 if (needsLayer == !!layer) |
1282 return false; | 1282 return false; |
1283 layer = needsLayer ? createGraphicsLayer(reason) : nullptr; | 1283 layer = needsLayer ? createGraphicsLayer(reason) : nullptr; |
1284 return true; | 1284 return true; |
1285 } | 1285 } |
1286 | 1286 |
1287 bool CompositedDeprecatedPaintLayerMapping::updateOverflowControlsLayers(bool ne
edsHorizontalScrollbarLayer, bool needsVerticalScrollbarLayer, bool needsScrollC
ornerLayer, bool needsAncestorClip) | 1287 bool CompositedDeprecatedPaintLayerMapping::updateOverflowControlsLayers(bool ne
edsHorizontalScrollbarLayer, bool needsVerticalScrollbarLayer, bool needsScrollC
ornerLayer, bool needsAncestorClip) |
1288 { | 1288 { |
| 1289 // If the subtree is invisible, we don't actually need scrollbar layers. |
| 1290 bool invisible = m_owningLayer.subtreeIsInvisible(); |
| 1291 needsHorizontalScrollbarLayer &= !invisible; |
| 1292 needsVerticalScrollbarLayer &= !invisible; |
| 1293 needsScrollCornerLayer &= !invisible; |
| 1294 |
1289 bool horizontalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerF
orHorizontalScrollbar, needsHorizontalScrollbarLayer, CompositingReasonLayerForH
orizontalScrollbar); | 1295 bool horizontalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerF
orHorizontalScrollbar, needsHorizontalScrollbarLayer, CompositingReasonLayerForH
orizontalScrollbar); |
1290 bool verticalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerFor
VerticalScrollbar, needsVerticalScrollbarLayer, CompositingReasonLayerForVertica
lScrollbar); | 1296 bool verticalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerFor
VerticalScrollbar, needsVerticalScrollbarLayer, CompositingReasonLayerForVertica
lScrollbar); |
1291 bool scrollCornerLayerChanged = toggleScrollbarLayerIfNeeded(m_layerForScrol
lCorner, needsScrollCornerLayer, CompositingReasonLayerForScrollCorner); | 1297 bool scrollCornerLayerChanged = toggleScrollbarLayerIfNeeded(m_layerForScrol
lCorner, needsScrollCornerLayer, CompositingReasonLayerForScrollCorner); |
1292 | 1298 |
1293 bool needsOverflowControlsHostLayer = needsHorizontalScrollbarLayer || needs
VerticalScrollbarLayer || needsScrollCornerLayer; | 1299 bool needsOverflowControlsHostLayer = needsHorizontalScrollbarLayer || needs
VerticalScrollbarLayer || needsScrollCornerLayer; |
1294 toggleScrollbarLayerIfNeeded(m_overflowControlsHostLayer, needsOverflowContr
olsHostLayer, CompositingReasonLayerForOverflowControlsHost); | 1300 toggleScrollbarLayerIfNeeded(m_overflowControlsHostLayer, needsOverflowContr
olsHostLayer, CompositingReasonLayerForOverflowControlsHost); |
1295 bool needsOverflowClipLayer = needsOverflowControlsHostLayer && needsAncesto
rClip; | 1301 bool needsOverflowClipLayer = needsOverflowControlsHostLayer && needsAncesto
rClip; |
1296 toggleScrollbarLayerIfNeeded(m_overflowControlsClippingLayer, needsOverflowC
lipLayer, CompositingReasonLayerForOverflowControlsHost); | 1302 toggleScrollbarLayerIfNeeded(m_overflowControlsClippingLayer, needsOverflowC
lipLayer, CompositingReasonLayerForOverflowControlsHost); |
1297 | 1303 |
1298 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay
er(m_owningLayer)) { | 1304 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay
er(m_owningLayer)) { |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2363 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2369 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
2364 name = "Scrolling Block Selection Layer"; | 2370 name = "Scrolling Block Selection Layer"; |
2365 } else { | 2371 } else { |
2366 ASSERT_NOT_REACHED(); | 2372 ASSERT_NOT_REACHED(); |
2367 } | 2373 } |
2368 | 2374 |
2369 return name; | 2375 return name; |
2370 } | 2376 } |
2371 | 2377 |
2372 } // namespace blink | 2378 } // namespace blink |
OLD | NEW |