| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 updatedScrollableAreaSet = true; | 1342 updatedScrollableAreaSet = true; |
| 1343 } else { | 1343 } else { |
| 1344 if (frameView->removeScrollableArea(this)) | 1344 if (frameView->removeScrollableArea(this)) |
| 1345 updatedScrollableAreaSet = true; | 1345 updatedScrollableAreaSet = true; |
| 1346 } | 1346 } |
| 1347 | 1347 |
| 1348 if (updatedScrollableAreaSet) { | 1348 if (updatedScrollableAreaSet) { |
| 1349 // Count the total number of RenderLayers that are scrollable areas for | 1349 // Count the total number of RenderLayers that are scrollable areas for |
| 1350 // any period. We only want to record this at most once per RenderLayer. | 1350 // any period. We only want to record this at most once per RenderLayer. |
| 1351 if (requiresScrollableArea && !m_isScrollableAreaHasBeenRecorded) { | 1351 if (requiresScrollableArea && !m_isScrollableAreaHasBeenRecorded) { |
| 1352 WebKit::Platform::current()->histogramEnumeration("Renderer.Composit
edScrolling", RenderLayer::IsScrollableAreaBucket, RenderLayer::CompositedScroll
ingHistogramMax); | 1352 blink::Platform::current()->histogramEnumeration("Renderer.Composite
dScrolling", RenderLayer::IsScrollableAreaBucket, RenderLayer::CompositedScrolli
ngHistogramMax); |
| 1353 m_isScrollableAreaHasBeenRecorded = true; | 1353 m_isScrollableAreaHasBeenRecorded = true; |
| 1354 } | 1354 } |
| 1355 | 1355 |
| 1356 // We always want composited scrolling if compositor driven accelerated | 1356 // We always want composited scrolling if compositor driven accelerated |
| 1357 // scrolling is enabled. Since we will not update needs composited scrol
ling | 1357 // scrolling is enabled. Since we will not update needs composited scrol
ling |
| 1358 // in this case, we must force our state to update. | 1358 // in this case, we must force our state to update. |
| 1359 if (layer()->compositorDrivenAcceleratedScrollingEnabled()) | 1359 if (layer()->compositorDrivenAcceleratedScrollingEnabled()) |
| 1360 layer()->didUpdateNeedsCompositedScrolling(); | 1360 layer()->didUpdateNeedsCompositedScrolling(); |
| 1361 else if (requiresScrollableArea) | 1361 else if (requiresScrollableArea) |
| 1362 m_box->view()->compositor()->setNeedsUpdateCompositingRequirementsSt
ate(); | 1362 m_box->view()->compositor()->setNeedsUpdateCompositingRequirementsSt
ate(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1380 const bool needsToBeStackingContainerDidChange = layer()->stackingNode()->se
tNeedsToBeStackingContainer(needsToBeStackingContainer); | 1380 const bool needsToBeStackingContainerDidChange = layer()->stackingNode()->se
tNeedsToBeStackingContainer(needsToBeStackingContainer); |
| 1381 | 1381 |
| 1382 const bool needsCompositedScrolling = needsToBeStackingContainer | 1382 const bool needsCompositedScrolling = needsToBeStackingContainer |
| 1383 || layer()->compositorDrivenAcceleratedScrollingEnabled(); | 1383 || layer()->compositorDrivenAcceleratedScrollingEnabled(); |
| 1384 | 1384 |
| 1385 // We gather a boolean value for use with Google UMA histograms to | 1385 // We gather a boolean value for use with Google UMA histograms to |
| 1386 // quantify the actual effects of a set of patches attempting to | 1386 // quantify the actual effects of a set of patches attempting to |
| 1387 // relax composited scrolling requirements, thereby increasing the | 1387 // relax composited scrolling requirements, thereby increasing the |
| 1388 // number of composited overflow divs. | 1388 // number of composited overflow divs. |
| 1389 if (layer()->acceleratedCompositingForOverflowScrollEnabled()) | 1389 if (layer()->acceleratedCompositingForOverflowScrollEnabled()) |
| 1390 WebKit::Platform::current()->histogramEnumeration("Renderer.NeedsComposi
tedScrolling", needsCompositedScrolling, 2); | 1390 blink::Platform::current()->histogramEnumeration("Renderer.NeedsComposit
edScrolling", needsCompositedScrolling, 2); |
| 1391 | 1391 |
| 1392 const bool needsCompositedScrollingDidChange = setNeedsCompositedScrolling(n
eedsCompositedScrolling); | 1392 const bool needsCompositedScrollingDidChange = setNeedsCompositedScrolling(n
eedsCompositedScrolling); |
| 1393 | 1393 |
| 1394 if (needsToBeStackingContainerDidChange || needsCompositedScrollingDidChange
) { | 1394 if (needsToBeStackingContainerDidChange || needsCompositedScrollingDidChange
) { |
| 1395 // Note, the z-order lists may need to be rebuilt, but our code guarante
es | 1395 // Note, the z-order lists may need to be rebuilt, but our code guarante
es |
| 1396 // that we have not affected stacking, so we will not dirty | 1396 // that we have not affected stacking, so we will not dirty |
| 1397 // m_descendantsAreContiguousInStackingOrder for either us or our stacki
ng | 1397 // m_descendantsAreContiguousInStackingOrder for either us or our stacki
ng |
| 1398 // context or container. | 1398 // context or container. |
| 1399 layer()->didUpdateNeedsCompositedScrolling(); | 1399 layer()->didUpdateNeedsCompositedScrolling(); |
| 1400 } | 1400 } |
| 1401 } | 1401 } |
| 1402 | 1402 |
| 1403 bool RenderLayerScrollableArea::setNeedsCompositedScrolling(bool needsComposited
Scrolling) | 1403 bool RenderLayerScrollableArea::setNeedsCompositedScrolling(bool needsComposited
Scrolling) |
| 1404 { | 1404 { |
| 1405 if (this->needsCompositedScrolling() == needsCompositedScrolling) | 1405 if (this->needsCompositedScrolling() == needsCompositedScrolling) |
| 1406 return false; | 1406 return false; |
| 1407 | 1407 |
| 1408 // Count the total number of RenderLayers which need composited scrolling at | 1408 // Count the total number of RenderLayers which need composited scrolling at |
| 1409 // some point. This should be recorded at most once per RenderLayer, so we | 1409 // some point. This should be recorded at most once per RenderLayer, so we |
| 1410 // check m_willUseCompositedScrollingHasBeenRecorded. | 1410 // check m_willUseCompositedScrollingHasBeenRecorded. |
| 1411 if (layer()->acceleratedCompositingForOverflowScrollEnabled() && !m_willUseC
ompositedScrollingHasBeenRecorded) { | 1411 if (layer()->acceleratedCompositingForOverflowScrollEnabled() && !m_willUseC
ompositedScrollingHasBeenRecorded) { |
| 1412 WebKit::Platform::current()->histogramEnumeration("Renderer.CompositedSc
rolling", RenderLayer::WillUseCompositedScrollingBucket, RenderLayer::Composited
ScrollingHistogramMax); | 1412 blink::Platform::current()->histogramEnumeration("Renderer.CompositedScr
olling", RenderLayer::WillUseCompositedScrollingBucket, RenderLayer::CompositedS
crollingHistogramMax); |
| 1413 m_willUseCompositedScrollingHasBeenRecorded = true; | 1413 m_willUseCompositedScrollingHasBeenRecorded = true; |
| 1414 } | 1414 } |
| 1415 | 1415 |
| 1416 m_needsCompositedScrolling = needsCompositedScrolling; | 1416 m_needsCompositedScrolling = needsCompositedScrolling; |
| 1417 | 1417 |
| 1418 return true; | 1418 return true; |
| 1419 } | 1419 } |
| 1420 | 1420 |
| 1421 void RenderLayerScrollableArea::updateHasVisibleNonLayerContent() | 1421 void RenderLayerScrollableArea::updateHasVisibleNonLayerContent() |
| 1422 { | 1422 { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1469 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo
sitedScrollingMode mode) | 1469 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo
sitedScrollingMode mode) |
| 1470 { | 1470 { |
| 1471 if (m_forceNeedsCompositedScrolling == mode) | 1471 if (m_forceNeedsCompositedScrolling == mode) |
| 1472 return; | 1472 return; |
| 1473 | 1473 |
| 1474 m_forceNeedsCompositedScrolling = mode; | 1474 m_forceNeedsCompositedScrolling = mode; |
| 1475 layer()->didUpdateNeedsCompositedScrolling(); | 1475 layer()->didUpdateNeedsCompositedScrolling(); |
| 1476 } | 1476 } |
| 1477 | 1477 |
| 1478 } // Namespace WebCore | 1478 } // Namespace WebCore |
| OLD | NEW |