Chromium Code Reviews| Index: Source/core/rendering/RenderLayer.cpp |
| diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp |
| index ad7140e7d9eec108e4dfdb6e05ef0952b3217262..abd0eba8111511c711fcd8c5777e3e540204a15c 100644 |
| --- a/Source/core/rendering/RenderLayer.cpp |
| +++ b/Source/core/rendering/RenderLayer.cpp |
| @@ -134,6 +134,9 @@ RenderLayer::RenderLayer(RenderLayerModelObject* renderer) |
| , m_hasUnclippedDescendant(false) |
| , m_isUnclippedDescendant(false) |
| , m_needsCompositedScrolling(false) |
| + , m_needsCompositedScrollingHasBeenRecorded(false) |
| + , m_willUseCompositedScrollingHasBeenRecorded(false) |
| + , m_isScrollableAreaHasBeenRecorded(false) |
| , m_canBePromotedToStackingContainer(false) |
| , m_canBePromotedToStackingContainerDirty(true) |
| , m_isRootLayer(renderer->isRenderView()) |
| @@ -2084,11 +2087,39 @@ void RenderLayer::updateNeedsCompositedScrolling() |
| setNeedsCompositedScrolling(needsCompositedScrolling); |
| } |
| +enum CompositedScrollingHistogramBuckets { |
| + IsScrollableAreaBucket = 0, |
| + NeedsToBeStackingContainerBucket = 1, |
| + WillUseCompositedScrollingBucket = 2 |
| +}; |
| + |
| void RenderLayer::setNeedsCompositedScrolling(bool needsCompositedScrolling) |
| { |
| if (m_needsCompositedScrolling == needsCompositedScrolling) |
| return; |
| + // Count the total number of RenderLayers which need to be stacking |
| + // containers some point. This should be recorded at most once per |
| + // RenderLayer, so we check m_needsCompositedScrollingHasBeenRecorded. |
| + if (acceleratedCompositingForOverflowScrollEnabled() && !m_needsCompositedScrollingHasBeenRecorded) { |
| + HistogramSupport::histogramEnumeration("Renderer.CompositedScrolling", NeedsToBeStackingContainerBucket, 3); |
|
Alexei Svitkine (slow)
2013/09/04 15:21:19
Nit: Instead of hardcoding 3 for the last param at
hartmanng
2013/09/04 15:48:56
Done.
|
| + m_needsCompositedScrollingHasBeenRecorded = true; |
| + } |
| + |
| + // Count the total number of RenderLayers which need composited scrolling at |
| + // some point. This should be recorded at most once per RenderLayer, so we |
| + // check m_willUseCompositedScrollingHasBeenRecorded. |
| + // |
| + // FIXME: Currently, this computes the exact same value as the above. |
| + // However, it will soon be expanded to cover more than just stacking |
| + // containers (see crbug.com/249354). When this happens, we should see a |
| + // spike in "WillUseCompositedScrolling", while "NeedsToBeStackingContainer" |
| + // will remain relatively static. |
| + if (acceleratedCompositingForOverflowScrollEnabled() && !m_willUseCompositedScrollingHasBeenRecorded) { |
| + HistogramSupport::histogramEnumeration("Renderer.CompositedScrolling", WillUseCompositedScrollingBucket, 3); |
| + m_willUseCompositedScrollingHasBeenRecorded = true; |
| + } |
| + |
| m_needsCompositedScrolling = needsCompositedScrolling; |
| // Note, the z-order lists may need to be rebuilt, but our code guarantees |
| @@ -6185,8 +6216,16 @@ void RenderLayer::updateScrollableAreaSet(bool hasOverflow) |
| isVisibleToHitTest &= owner->renderer() && owner->renderer()->visibleToHitTesting(); |
| if (hasOverflow && isVisibleToHitTest) { |
| - if (frameView->addScrollableArea(scrollableArea())) |
| + if (frameView->addScrollableArea(scrollableArea())) { |
| compositor()->setNeedsUpdateCompositingRequirementsState(); |
| + |
| + // Count the total number of RenderLayers that are scrollable areas for |
| + // any period. We only want to record this at most once per RenderLayer. |
| + if (!m_isScrollableAreaHasBeenRecorded) { |
| + HistogramSupport::histogramEnumeration("Renderer.CompositedScrolling", IsScrollableAreaBucket, 3); |
| + m_isScrollableAreaHasBeenRecorded = true; |
| + } |
| + } |
| } else { |
| if (frameView->removeScrollableArea(scrollableArea())) |
| setNeedsCompositedScrolling(false); |