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

Side by Side Diff: Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp

Issue 1311133005: Merge 200866 "Do not create scrollbars if the subtree is invisible." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2454/
Patch Set: Created 5 years, 4 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
« no previous file with comments | « LayoutTests/compositing/animation/hidden-animated-layer-should-not-have-scrollbars-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 bool CompositedDeprecatedPaintLayerMapping::toggleScrollbarLayerIfNeeded(OwnPtr< GraphicsLayer>& layer, bool needsLayer, CompositingReasons reason) 1299 bool CompositedDeprecatedPaintLayerMapping::toggleScrollbarLayerIfNeeded(OwnPtr< GraphicsLayer>& layer, bool needsLayer, CompositingReasons reason)
1300 { 1300 {
1301 if (needsLayer == !!layer) 1301 if (needsLayer == !!layer)
1302 return false; 1302 return false;
1303 layer = needsLayer ? createGraphicsLayer(reason) : nullptr; 1303 layer = needsLayer ? createGraphicsLayer(reason) : nullptr;
1304 return true; 1304 return true;
1305 } 1305 }
1306 1306
1307 bool CompositedDeprecatedPaintLayerMapping::updateOverflowControlsLayers(bool ne edsHorizontalScrollbarLayer, bool needsVerticalScrollbarLayer, bool needsScrollC ornerLayer, bool needsAncestorClip) 1307 bool CompositedDeprecatedPaintLayerMapping::updateOverflowControlsLayers(bool ne edsHorizontalScrollbarLayer, bool needsVerticalScrollbarLayer, bool needsScrollC ornerLayer, bool needsAncestorClip)
1308 { 1308 {
1309 // If the subtree is invisible, we don't actually need scrollbar layers.
1310 bool invisible = m_owningLayer.subtreeIsInvisible();
1311 needsHorizontalScrollbarLayer &= !invisible;
1312 needsVerticalScrollbarLayer &= !invisible;
1313 needsScrollCornerLayer &= !invisible;
1314
1309 bool horizontalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerF orHorizontalScrollbar, needsHorizontalScrollbarLayer, CompositingReasonLayerForH orizontalScrollbar); 1315 bool horizontalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerF orHorizontalScrollbar, needsHorizontalScrollbarLayer, CompositingReasonLayerForH orizontalScrollbar);
1310 bool verticalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerFor VerticalScrollbar, needsVerticalScrollbarLayer, CompositingReasonLayerForVertica lScrollbar); 1316 bool verticalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerFor VerticalScrollbar, needsVerticalScrollbarLayer, CompositingReasonLayerForVertica lScrollbar);
1311 bool scrollCornerLayerChanged = toggleScrollbarLayerIfNeeded(m_layerForScrol lCorner, needsScrollCornerLayer, CompositingReasonLayerForScrollCorner); 1317 bool scrollCornerLayerChanged = toggleScrollbarLayerIfNeeded(m_layerForScrol lCorner, needsScrollCornerLayer, CompositingReasonLayerForScrollCorner);
1312 1318
1313 bool needsOverflowControlsHostLayer = needsHorizontalScrollbarLayer || needs VerticalScrollbarLayer || needsScrollCornerLayer; 1319 bool needsOverflowControlsHostLayer = needsHorizontalScrollbarLayer || needs VerticalScrollbarLayer || needsScrollCornerLayer;
1314 toggleScrollbarLayerIfNeeded(m_overflowControlsHostLayer, needsOverflowContr olsHostLayer, CompositingReasonLayerForOverflowControlsHost); 1320 toggleScrollbarLayerIfNeeded(m_overflowControlsHostLayer, needsOverflowContr olsHostLayer, CompositingReasonLayerForOverflowControlsHost);
1315 bool needsOverflowClipLayer = needsOverflowControlsHostLayer && needsAncesto rClip; 1321 bool needsOverflowClipLayer = needsOverflowControlsHostLayer && needsAncesto rClip;
1316 toggleScrollbarLayerIfNeeded(m_overflowControlsClippingLayer, needsOverflowC lipLayer, CompositingReasonLayerForOverflowControlsHost); 1322 toggleScrollbarLayerIfNeeded(m_overflowControlsClippingLayer, needsOverflowC lipLayer, CompositingReasonLayerForOverflowControlsHost);
1317 1323
1318 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) { 1324 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) {
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
2384 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2390 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2385 name = "Scrolling Block Selection Layer"; 2391 name = "Scrolling Block Selection Layer";
2386 } else { 2392 } else {
2387 ASSERT_NOT_REACHED(); 2393 ASSERT_NOT_REACHED();
2388 } 2394 }
2389 2395
2390 return name; 2396 return name;
2391 } 2397 }
2392 2398
2393 } // namespace blink 2399 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/compositing/animation/hidden-animated-layer-should-not-have-scrollbars-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698