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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 : m_inResizeMode(false) | 127 : m_inResizeMode(false) |
128 , m_scrollDimensionsDirty(true) | 128 , m_scrollDimensionsDirty(true) |
129 , m_normalFlowListDirty(true) | 129 , m_normalFlowListDirty(true) |
130 , m_hasSelfPaintingLayerDescendant(false) | 130 , m_hasSelfPaintingLayerDescendant(false) |
131 , m_hasSelfPaintingLayerDescendantDirty(false) | 131 , m_hasSelfPaintingLayerDescendantDirty(false) |
132 , m_hasOutOfFlowPositionedDescendant(false) | 132 , m_hasOutOfFlowPositionedDescendant(false) |
133 , m_hasOutOfFlowPositionedDescendantDirty(true) | 133 , m_hasOutOfFlowPositionedDescendantDirty(true) |
134 , m_hasUnclippedDescendant(false) | 134 , m_hasUnclippedDescendant(false) |
135 , m_isUnclippedDescendant(false) | 135 , m_isUnclippedDescendant(false) |
136 , m_needsCompositedScrolling(false) | 136 , m_needsCompositedScrolling(false) |
137 , m_needsCompositedScrollingHasBeenRecorded(false) | |
138 , m_willUseCompositedScrollingHasBeenRecorded(false) | |
139 , m_isScrollableAreaHasBeenRecorded(false) | |
137 , m_canBePromotedToStackingContainer(false) | 140 , m_canBePromotedToStackingContainer(false) |
138 , m_canBePromotedToStackingContainerDirty(true) | 141 , m_canBePromotedToStackingContainerDirty(true) |
139 , m_isRootLayer(renderer->isRenderView()) | 142 , m_isRootLayer(renderer->isRenderView()) |
140 , m_usedTransparency(false) | 143 , m_usedTransparency(false) |
141 , m_paintingInsideReflection(false) | 144 , m_paintingInsideReflection(false) |
142 , m_inOverflowRelayout(false) | 145 , m_inOverflowRelayout(false) |
143 , m_repaintStatus(NeedsNormalRepaint) | 146 , m_repaintStatus(NeedsNormalRepaint) |
144 , m_visibleContentStatusDirty(true) | 147 , m_visibleContentStatusDirty(true) |
145 , m_hasVisibleContent(false) | 148 , m_hasVisibleContent(false) |
146 , m_visibleDescendantStatusDirty(false) | 149 , m_visibleDescendantStatusDirty(false) |
(...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2077 // We gather a boolean value for use with Google UMA histograms to | 2080 // We gather a boolean value for use with Google UMA histograms to |
2078 // quantify the actual effects of a set of patches attempting to | 2081 // quantify the actual effects of a set of patches attempting to |
2079 // relax composited scrolling requirements, thereby increasing the | 2082 // relax composited scrolling requirements, thereby increasing the |
2080 // number of composited overflow divs. | 2083 // number of composited overflow divs. |
2081 if (acceleratedCompositingForOverflowScrollEnabled()) | 2084 if (acceleratedCompositingForOverflowScrollEnabled()) |
2082 HistogramSupport::histogramEnumeration("Renderer.NeedsCompositedScrollin g", needsCompositedScrolling, 2); | 2085 HistogramSupport::histogramEnumeration("Renderer.NeedsCompositedScrollin g", needsCompositedScrolling, 2); |
2083 | 2086 |
2084 setNeedsCompositedScrolling(needsCompositedScrolling); | 2087 setNeedsCompositedScrolling(needsCompositedScrolling); |
2085 } | 2088 } |
2086 | 2089 |
2090 enum CompositedScrollingHistogramBuckets { | |
2091 IsScrollableAreaBucket = 0, | |
2092 NeedsToBeStackingContainerBucket = 1, | |
2093 WillUseCompositedScrollingBucket = 2 | |
2094 }; | |
2095 | |
2087 void RenderLayer::setNeedsCompositedScrolling(bool needsCompositedScrolling) | 2096 void RenderLayer::setNeedsCompositedScrolling(bool needsCompositedScrolling) |
2088 { | 2097 { |
2089 if (m_needsCompositedScrolling == needsCompositedScrolling) | 2098 if (m_needsCompositedScrolling == needsCompositedScrolling) |
2090 return; | 2099 return; |
2091 | 2100 |
2101 // Count the total number of RenderLayers which need to be stacking | |
2102 // containers some point. This should be recorded at most once per | |
2103 // RenderLayer, so we check m_needsCompositedScrollingHasBeenRecorded. | |
2104 if (acceleratedCompositingForOverflowScrollEnabled() && !m_needsCompositedSc rollingHasBeenRecorded) { | |
2105 HistogramSupport::histogramEnumeration("Renderer.CompositedScrolling", N eedsToBeStackingContainerBucket, 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.
| |
2106 m_needsCompositedScrollingHasBeenRecorded = true; | |
2107 } | |
2108 | |
2109 // Count the total number of RenderLayers which need composited scrolling at | |
2110 // some point. This should be recorded at most once per RenderLayer, so we | |
2111 // check m_willUseCompositedScrollingHasBeenRecorded. | |
2112 // | |
2113 // FIXME: Currently, this computes the exact same value as the above. | |
2114 // However, it will soon be expanded to cover more than just stacking | |
2115 // containers (see crbug.com/249354). When this happens, we should see a | |
2116 // spike in "WillUseCompositedScrolling", while "NeedsToBeStackingContainer" | |
2117 // will remain relatively static. | |
2118 if (acceleratedCompositingForOverflowScrollEnabled() && !m_willUseComposited ScrollingHasBeenRecorded) { | |
2119 HistogramSupport::histogramEnumeration("Renderer.CompositedScrolling", W illUseCompositedScrollingBucket, 3); | |
2120 m_willUseCompositedScrollingHasBeenRecorded = true; | |
2121 } | |
2122 | |
2092 m_needsCompositedScrolling = needsCompositedScrolling; | 2123 m_needsCompositedScrolling = needsCompositedScrolling; |
2093 | 2124 |
2094 // Note, the z-order lists may need to be rebuilt, but our code guarantees | 2125 // Note, the z-order lists may need to be rebuilt, but our code guarantees |
2095 // that we have not affected stacking, so we will not dirty | 2126 // that we have not affected stacking, so we will not dirty |
2096 // m_canBePromotedToStackingContainer for either us or our stacking context | 2127 // m_canBePromotedToStackingContainer for either us or our stacking context |
2097 // or container. | 2128 // or container. |
2098 didUpdateNeedsCompositedScrolling(); | 2129 didUpdateNeedsCompositedScrolling(); |
2099 } | 2130 } |
2100 | 2131 |
2101 void RenderLayer::setForceNeedsCompositedScrolling(RenderLayer::ForceNeedsCompos itedScrollingMode mode) | 2132 void RenderLayer::setForceNeedsCompositedScrolling(RenderLayer::ForceNeedsCompos itedScrollingMode mode) |
(...skipping 4076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6178 | 6209 |
6179 FrameView* frameView = frame->view(); | 6210 FrameView* frameView = frame->view(); |
6180 if (!frameView) | 6211 if (!frameView) |
6181 return; | 6212 return; |
6182 | 6213 |
6183 bool isVisibleToHitTest = renderer()->visibleToHitTesting(); | 6214 bool isVisibleToHitTest = renderer()->visibleToHitTesting(); |
6184 if (HTMLFrameOwnerElement* owner = frame->ownerElement()) | 6215 if (HTMLFrameOwnerElement* owner = frame->ownerElement()) |
6185 isVisibleToHitTest &= owner->renderer() && owner->renderer()->visibleToH itTesting(); | 6216 isVisibleToHitTest &= owner->renderer() && owner->renderer()->visibleToH itTesting(); |
6186 | 6217 |
6187 if (hasOverflow && isVisibleToHitTest) { | 6218 if (hasOverflow && isVisibleToHitTest) { |
6188 if (frameView->addScrollableArea(scrollableArea())) | 6219 if (frameView->addScrollableArea(scrollableArea())) { |
6189 compositor()->setNeedsUpdateCompositingRequirementsState(); | 6220 compositor()->setNeedsUpdateCompositingRequirementsState(); |
6221 | |
6222 // Count the total number of RenderLayers that are scrollable areas for | |
6223 // any period. We only want to record this at most once per RenderLa yer. | |
6224 if (!m_isScrollableAreaHasBeenRecorded) { | |
6225 HistogramSupport::histogramEnumeration("Renderer.CompositedScrol ling", IsScrollableAreaBucket, 3); | |
6226 m_isScrollableAreaHasBeenRecorded = true; | |
6227 } | |
6228 } | |
6190 } else { | 6229 } else { |
6191 if (frameView->removeScrollableArea(scrollableArea())) | 6230 if (frameView->removeScrollableArea(scrollableArea())) |
6192 setNeedsCompositedScrolling(false); | 6231 setNeedsCompositedScrolling(false); |
6193 } | 6232 } |
6194 } | 6233 } |
6195 | 6234 |
6196 void RenderLayer::updateScrollCornerStyle() | 6235 void RenderLayer::updateScrollCornerStyle() |
6197 { | 6236 { |
6198 RenderObject* actualRenderer = rendererForScrollbar(renderer()); | 6237 RenderObject* actualRenderer = rendererForScrollbar(renderer()); |
6199 RefPtr<RenderStyle> corner = renderer()->hasOverflowClip() ? actualRenderer- >getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->st yle()) : PassRefPtr<RenderStyle>(0); | 6238 RefPtr<RenderStyle> corner = renderer()->hasOverflowClip() ? actualRenderer- >getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->st yle()) : PassRefPtr<RenderStyle>(0); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6473 } | 6512 } |
6474 } | 6513 } |
6475 | 6514 |
6476 void showLayerTree(const WebCore::RenderObject* renderer) | 6515 void showLayerTree(const WebCore::RenderObject* renderer) |
6477 { | 6516 { |
6478 if (!renderer) | 6517 if (!renderer) |
6479 return; | 6518 return; |
6480 showLayerTree(renderer->enclosingLayer()); | 6519 showLayerTree(renderer->enclosingLayer()); |
6481 } | 6520 } |
6482 #endif | 6521 #endif |
OLD | NEW |