| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 RenderLayer::RenderLayer(RenderLayerModelObject* renderer) | 124 RenderLayer::RenderLayer(RenderLayerModelObject* renderer) |
| 125 : m_inResizeMode(false) | 125 : m_inResizeMode(false) |
| 126 , m_normalFlowListDirty(true) | 126 , m_normalFlowListDirty(true) |
| 127 , m_hasSelfPaintingLayerDescendant(false) | 127 , m_hasSelfPaintingLayerDescendant(false) |
| 128 , m_hasSelfPaintingLayerDescendantDirty(false) | 128 , m_hasSelfPaintingLayerDescendantDirty(false) |
| 129 , m_hasOutOfFlowPositionedDescendant(false) | 129 , m_hasOutOfFlowPositionedDescendant(false) |
| 130 , m_hasOutOfFlowPositionedDescendantDirty(true) | 130 , m_hasOutOfFlowPositionedDescendantDirty(true) |
| 131 , m_hasUnclippedDescendant(false) | 131 , m_hasUnclippedDescendant(false) |
| 132 , m_isUnclippedDescendant(false) | 132 , m_isUnclippedDescendant(false) |
| 133 , m_needsCompositedScrolling(false) | 133 , m_needsCompositedScrolling(false) |
| 134 , m_needsCompositedScrollingHasBeenRecorded(false) |
| 135 , m_willUseCompositedScrollingHasBeenRecorded(false) |
| 136 , m_isScrollableAreaHasBeenRecorded(false) |
| 134 , m_canBePromotedToStackingContainer(false) | 137 , m_canBePromotedToStackingContainer(false) |
| 135 , m_canBePromotedToStackingContainerDirty(true) | 138 , m_canBePromotedToStackingContainerDirty(true) |
| 136 , m_isRootLayer(renderer->isRenderView()) | 139 , m_isRootLayer(renderer->isRenderView()) |
| 137 , m_usedTransparency(false) | 140 , m_usedTransparency(false) |
| 138 , m_paintingInsideReflection(false) | 141 , m_paintingInsideReflection(false) |
| 139 , m_inOverflowRelayout(false) | 142 , m_inOverflowRelayout(false) |
| 140 , m_repaintStatus(NeedsNormalRepaint) | 143 , m_repaintStatus(NeedsNormalRepaint) |
| 141 , m_visibleContentStatusDirty(true) | 144 , m_visibleContentStatusDirty(true) |
| 142 , m_hasVisibleContent(false) | 145 , m_hasVisibleContent(false) |
| 143 , m_visibleDescendantStatusDirty(false) | 146 , m_visibleDescendantStatusDirty(false) |
| (...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2074 // We gather a boolean value for use with Google UMA histograms to | 2077 // We gather a boolean value for use with Google UMA histograms to |
| 2075 // quantify the actual effects of a set of patches attempting to | 2078 // quantify the actual effects of a set of patches attempting to |
| 2076 // relax composited scrolling requirements, thereby increasing the | 2079 // relax composited scrolling requirements, thereby increasing the |
| 2077 // number of composited overflow divs. | 2080 // number of composited overflow divs. |
| 2078 if (acceleratedCompositingForOverflowScrollEnabled()) | 2081 if (acceleratedCompositingForOverflowScrollEnabled()) |
| 2079 HistogramSupport::histogramEnumeration("Renderer.NeedsCompositedScrollin
g", needsCompositedScrolling, 2); | 2082 HistogramSupport::histogramEnumeration("Renderer.NeedsCompositedScrollin
g", needsCompositedScrolling, 2); |
| 2080 | 2083 |
| 2081 setNeedsCompositedScrolling(needsCompositedScrolling); | 2084 setNeedsCompositedScrolling(needsCompositedScrolling); |
| 2082 } | 2085 } |
| 2083 | 2086 |
| 2087 enum CompositedScrollingHistogramBuckets { |
| 2088 IsScrollableAreaBucket = 0, |
| 2089 NeedsToBeStackingContainerBucket = 1, |
| 2090 WillUseCompositedScrollingBucket = 2, |
| 2091 CompositedScrollingHistogramMax = 3 |
| 2092 }; |
| 2093 |
| 2084 void RenderLayer::setNeedsCompositedScrolling(bool needsCompositedScrolling) | 2094 void RenderLayer::setNeedsCompositedScrolling(bool needsCompositedScrolling) |
| 2085 { | 2095 { |
| 2086 if (m_needsCompositedScrolling == needsCompositedScrolling) | 2096 if (m_needsCompositedScrolling == needsCompositedScrolling) |
| 2087 return; | 2097 return; |
| 2088 | 2098 |
| 2099 // Count the total number of RenderLayers which need to be stacking |
| 2100 // containers some point. This should be recorded at most once per |
| 2101 // RenderLayer, so we check m_needsCompositedScrollingHasBeenRecorded. |
| 2102 if (acceleratedCompositingForOverflowScrollEnabled() && !m_needsCompositedSc
rollingHasBeenRecorded) { |
| 2103 HistogramSupport::histogramEnumeration("Renderer.CompositedScrolling", N
eedsToBeStackingContainerBucket, CompositedScrollingHistogramMax); |
| 2104 m_needsCompositedScrollingHasBeenRecorded = true; |
| 2105 } |
| 2106 |
| 2107 // Count the total number of RenderLayers which need composited scrolling at |
| 2108 // some point. This should be recorded at most once per RenderLayer, so we |
| 2109 // check m_willUseCompositedScrollingHasBeenRecorded. |
| 2110 // |
| 2111 // FIXME: Currently, this computes the exact same value as the above. |
| 2112 // However, it will soon be expanded to cover more than just stacking |
| 2113 // containers (see crbug.com/249354). When this happens, we should see a |
| 2114 // spike in "WillUseCompositedScrolling", while "NeedsToBeStackingContainer" |
| 2115 // will remain relatively static. |
| 2116 if (acceleratedCompositingForOverflowScrollEnabled() && !m_willUseComposited
ScrollingHasBeenRecorded) { |
| 2117 HistogramSupport::histogramEnumeration("Renderer.CompositedScrolling", W
illUseCompositedScrollingBucket, CompositedScrollingHistogramMax); |
| 2118 m_willUseCompositedScrollingHasBeenRecorded = true; |
| 2119 } |
| 2120 |
| 2089 m_needsCompositedScrolling = needsCompositedScrolling; | 2121 m_needsCompositedScrolling = needsCompositedScrolling; |
| 2090 | 2122 |
| 2091 // Note, the z-order lists may need to be rebuilt, but our code guarantees | 2123 // Note, the z-order lists may need to be rebuilt, but our code guarantees |
| 2092 // that we have not affected stacking, so we will not dirty | 2124 // that we have not affected stacking, so we will not dirty |
| 2093 // m_canBePromotedToStackingContainer for either us or our stacking context | 2125 // m_canBePromotedToStackingContainer for either us or our stacking context |
| 2094 // or container. | 2126 // or container. |
| 2095 didUpdateNeedsCompositedScrolling(); | 2127 didUpdateNeedsCompositedScrolling(); |
| 2096 } | 2128 } |
| 2097 | 2129 |
| 2098 void RenderLayer::setForceNeedsCompositedScrolling(RenderLayer::ForceNeedsCompos
itedScrollingMode mode) | 2130 void RenderLayer::setForceNeedsCompositedScrolling(RenderLayer::ForceNeedsCompos
itedScrollingMode mode) |
| (...skipping 3915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6014 | 6046 |
| 6015 FrameView* frameView = frame->view(); | 6047 FrameView* frameView = frame->view(); |
| 6016 if (!frameView) | 6048 if (!frameView) |
| 6017 return; | 6049 return; |
| 6018 | 6050 |
| 6019 bool isVisibleToHitTest = renderer()->visibleToHitTesting(); | 6051 bool isVisibleToHitTest = renderer()->visibleToHitTesting(); |
| 6020 if (HTMLFrameOwnerElement* owner = frame->ownerElement()) | 6052 if (HTMLFrameOwnerElement* owner = frame->ownerElement()) |
| 6021 isVisibleToHitTest &= owner->renderer() && owner->renderer()->visibleToH
itTesting(); | 6053 isVisibleToHitTest &= owner->renderer() && owner->renderer()->visibleToH
itTesting(); |
| 6022 | 6054 |
| 6023 if (hasOverflow && isVisibleToHitTest) { | 6055 if (hasOverflow && isVisibleToHitTest) { |
| 6024 if (frameView->addScrollableArea(scrollableArea())) | 6056 if (frameView->addScrollableArea(scrollableArea())) { |
| 6025 compositor()->setNeedsUpdateCompositingRequirementsState(); | 6057 compositor()->setNeedsUpdateCompositingRequirementsState(); |
| 6058 |
| 6059 // Count the total number of RenderLayers that are scrollable areas
for |
| 6060 // any period. We only want to record this at most once per RenderLa
yer. |
| 6061 if (!m_isScrollableAreaHasBeenRecorded) { |
| 6062 HistogramSupport::histogramEnumeration("Renderer.CompositedScrol
ling", IsScrollableAreaBucket, CompositedScrollingHistogramMax); |
| 6063 m_isScrollableAreaHasBeenRecorded = true; |
| 6064 } |
| 6065 } |
| 6026 } else { | 6066 } else { |
| 6027 if (frameView->removeScrollableArea(scrollableArea())) | 6067 if (frameView->removeScrollableArea(scrollableArea())) |
| 6028 setNeedsCompositedScrolling(false); | 6068 setNeedsCompositedScrolling(false); |
| 6029 } | 6069 } |
| 6030 } | 6070 } |
| 6031 | 6071 |
| 6032 void RenderLayer::updateScrollCornerStyle() | 6072 void RenderLayer::updateScrollCornerStyle() |
| 6033 { | 6073 { |
| 6034 RenderObject* actualRenderer = rendererForScrollbar(renderer()); | 6074 RenderObject* actualRenderer = rendererForScrollbar(renderer()); |
| 6035 RefPtr<RenderStyle> corner = renderer()->hasOverflowClip() ? actualRenderer-
>getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->st
yle()) : PassRefPtr<RenderStyle>(0); | 6075 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... |
| 6309 } | 6349 } |
| 6310 } | 6350 } |
| 6311 | 6351 |
| 6312 void showLayerTree(const WebCore::RenderObject* renderer) | 6352 void showLayerTree(const WebCore::RenderObject* renderer) |
| 6313 { | 6353 { |
| 6314 if (!renderer) | 6354 if (!renderer) |
| 6315 return; | 6355 return; |
| 6316 showLayerTree(renderer->enclosingLayer()); | 6356 showLayerTree(renderer->enclosingLayer()); |
| 6317 } | 6357 } |
| 6318 #endif | 6358 #endif |
| OLD | NEW |