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

Unified Diff: Source/core/rendering/RenderLayer.cpp

Issue 23455031: New UMA stats for stacking container opt-in measurements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index ad7140e7d9eec108e4dfdb6e05ef0952b3217262..c3962750e71970456864ac2b6e4235ecea00f8c0 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -133,7 +133,7 @@ RenderLayer::RenderLayer(RenderLayerModelObject* renderer)
, m_hasOutOfFlowPositionedDescendantDirty(true)
, m_hasUnclippedDescendant(false)
, m_isUnclippedDescendant(false)
- , m_needsCompositedScrolling(false)
+ , m_isScrollableAreaHasBeenRecorded(false)
, m_canBePromotedToStackingContainer(false)
, m_canBePromotedToStackingContainerDirty(true)
, m_isRootLayer(renderer->isRenderView())
@@ -154,6 +154,7 @@ RenderLayer::RenderLayer(RenderLayerModelObject* renderer)
#endif
, m_canSkipRepaintRectsUpdateOnScroll(renderer->isTableCell())
, m_hasFilterInfo(false)
+ , m_needsCompositedScrolling(MixedTriState)
, m_blendMode(BlendModeNormal)
, m_renderer(renderer)
, m_parent(0)
@@ -2051,7 +2052,7 @@ bool RenderLayer::needsToBeStackingContainer() const
{
switch (m_forceNeedsCompositedScrolling) {
case DoNotForceCompositedScrolling:
- return m_needsCompositedScrolling;
+ return m_needsCompositedScrolling == TrueTriState;
case CompositedScrollingAlwaysOn:
return true;
case CompositedScrollingAlwaysOff:
@@ -2059,7 +2060,7 @@ bool RenderLayer::needsToBeStackingContainer() const
}
ASSERT_NOT_REACHED();
- return m_needsCompositedScrolling;
+ return m_needsCompositedScrolling == TrueTriState;
}
void RenderLayer::updateNeedsCompositedScrolling()
@@ -2086,10 +2087,19 @@ void RenderLayer::updateNeedsCompositedScrolling()
void RenderLayer::setNeedsCompositedScrolling(bool needsCompositedScrolling)
{
- if (m_needsCompositedScrolling == needsCompositedScrolling)
+ const bool neededCompositedScrolling = m_needsCompositedScrolling == TrueTriState;
+ if (neededCompositedScrolling == needsCompositedScrolling)
return;
- m_needsCompositedScrolling = needsCompositedScrolling;
+ // 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 if m_needsCompositedScrolling has been set yet. If it hasn't been
+ // set, its value will be MixedTriState, but if it has been set, it will be
+ // TrueTriState or FalseTriState.
+ if (acceleratedCompositingForOverflowScrollEnabled() && m_needsCompositedScrolling == MixedTriState)
+ HistogramSupport::histogramEnumeration("Renderer.NeedsToBeStackingContainer", 1, 2);
+
+ m_needsCompositedScrolling = needsCompositedScrolling ? TrueTriState : FalseTriState;
// Note, the z-order lists may need to be rebuilt, but our code guarantees
// that we have not affected stacking, so we will not dirty
@@ -6187,6 +6197,13 @@ void RenderLayer::updateScrollableAreaSet(bool hasOverflow)
if (hasOverflow && isVisibleToHitTest) {
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.IsScrollableArea", 1, 2);
+ m_isScrollableAreaHasBeenRecorded = true;
+ }
Ian Vollick 2013/09/03 18:28:07 This should happen inside the previous 'if', I thi
hartmanng 2013/09/03 21:26:56 Done.
} else {
if (frameView->removeScrollableArea(scrollableArea()))
setNeedsCompositedScrolling(false);
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698