OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 void updateDescendantDependentFlagsForEntireSubtree(DeprecatedPaintLayer& layer) | 187 void updateDescendantDependentFlagsForEntireSubtree(DeprecatedPaintLayer& layer) |
188 { | 188 { |
189 layer.updateDescendantDependentFlags(); | 189 layer.updateDescendantDependentFlags(); |
190 | 190 |
191 for (DeprecatedPaintLayer* child = layer.firstChild(); child; child = child-
>nextSibling()) | 191 for (DeprecatedPaintLayer* child = layer.firstChild(); child; child = child-
>nextSibling()) |
192 updateDescendantDependentFlagsForEntireSubtree(*child); | 192 updateDescendantDependentFlagsForEntireSubtree(*child); |
193 } | 193 } |
194 | 194 |
195 void DeprecatedPaintLayerCompositor::updateIfNeededRecursive() | 195 void DeprecatedPaintLayerCompositor::updateIfNeededRecursive() |
196 { | 196 { |
| 197 FrameView* view = m_layoutView.frameView(); |
| 198 if (view->shouldThrottleStyleLayoutAndCompositingUpdates()) |
| 199 return; |
| 200 |
197 for (Frame* child = m_layoutView.frameView()->frame().tree().firstChild(); c
hild; child = child->tree().nextSibling()) { | 201 for (Frame* child = m_layoutView.frameView()->frame().tree().firstChild(); c
hild; child = child->tree().nextSibling()) { |
198 if (!child->isLocalFrame()) | 202 if (!child->isLocalFrame()) |
199 continue; | 203 continue; |
200 LocalFrame* localFrame = toLocalFrame(child); | 204 LocalFrame* localFrame = toLocalFrame(child); |
201 // It's possible for trusted Pepper plugins to force hit testing in situ
ations where | 205 // It's possible for trusted Pepper plugins to force hit testing in situ
ations where |
202 // the frame tree is in an inconsistent state, such as in the middle of
frame detach. | 206 // the frame tree is in an inconsistent state, such as in the middle of
frame detach. |
203 // TODO(bbudge) Remove this check when trusted Pepper plugins are gone. | 207 // TODO(bbudge) Remove this check when trusted Pepper plugins are gone. |
204 if (localFrame->document()->isActive()) | 208 if (localFrame->document()->isActive()) |
205 localFrame->contentLayoutObject()->compositor()->updateIfNeededRecur
sive(); | 209 localFrame->contentLayoutObject()->compositor()->updateIfNeededRecur
sive(); |
206 } | 210 } |
(...skipping 24 matching lines...) Expand all Loading... |
231 m_layoutView.frameView()->scrollableArea()->updateCompositorScrollAnimations
(); | 235 m_layoutView.frameView()->scrollableArea()->updateCompositorScrollAnimations
(); |
232 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = m_layoutV
iew.frameView()->animatingScrollableAreas()) { | 236 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = m_layoutV
iew.frameView()->animatingScrollableAreas()) { |
233 for (ScrollableArea* scrollableArea : *animatingScrollableAreas) | 237 for (ScrollableArea* scrollableArea : *animatingScrollableAreas) |
234 scrollableArea->updateCompositorScrollAnimations(); | 238 scrollableArea->updateCompositorScrollAnimations(); |
235 } | 239 } |
236 | 240 |
237 #if ENABLE(ASSERT) | 241 #if ENABLE(ASSERT) |
238 ASSERT(lifecycle().state() == DocumentLifecycle::CompositingClean); | 242 ASSERT(lifecycle().state() == DocumentLifecycle::CompositingClean); |
239 assertNoUnresolvedDirtyBits(); | 243 assertNoUnresolvedDirtyBits(); |
240 for (Frame* child = m_layoutView.frameView()->frame().tree().firstChild(); c
hild; child = child->tree().nextSibling()) { | 244 for (Frame* child = m_layoutView.frameView()->frame().tree().firstChild(); c
hild; child = child->tree().nextSibling()) { |
241 if (child->isLocalFrame()) | 245 if (!child->isLocalFrame()) |
242 toLocalFrame(child)->contentLayoutObject()->compositor()->assertNoUn
resolvedDirtyBits(); | 246 continue; |
| 247 LocalFrame* localFrame = toLocalFrame(child); |
| 248 if (localFrame->shouldThrottleStyleLayoutAndCompositingUpdates()) |
| 249 continue; |
| 250 localFrame->contentLayoutObject()->compositor()->assertNoUnresolvedDirty
Bits(); |
243 } | 251 } |
244 #endif | 252 #endif |
245 } | 253 } |
246 | 254 |
247 void DeprecatedPaintLayerCompositor::setNeedsCompositingUpdate(CompositingUpdate
Type updateType) | 255 void DeprecatedPaintLayerCompositor::setNeedsCompositingUpdate(CompositingUpdate
Type updateType) |
248 { | 256 { |
249 ASSERT(updateType != CompositingUpdateNone); | 257 ASSERT(updateType != CompositingUpdateNone); |
250 m_pendingUpdateType = std::max(m_pendingUpdateType, updateType); | 258 m_pendingUpdateType = std::max(m_pendingUpdateType, updateType); |
251 page()->animator().scheduleVisualUpdate(m_layoutView.frame()); | 259 page()->animator().scheduleVisualUpdate(m_layoutView.frame()); |
252 lifecycle().ensureStateAtMost(DocumentLifecycle::LayoutClean); | 260 lifecycle().ensureStateAtMost(DocumentLifecycle::LayoutClean); |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 | 609 |
602 bool DeprecatedPaintLayerCompositor::scrollingLayerDidChange(DeprecatedPaintLaye
r* layer) | 610 bool DeprecatedPaintLayerCompositor::scrollingLayerDidChange(DeprecatedPaintLaye
r* layer) |
603 { | 611 { |
604 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(
)) | 612 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(
)) |
605 return scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer->s
crollableArea()); | 613 return scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer->s
crollableArea()); |
606 return false; | 614 return false; |
607 } | 615 } |
608 | 616 |
609 String DeprecatedPaintLayerCompositor::layerTreeAsText(LayerTreeFlags flags) | 617 String DeprecatedPaintLayerCompositor::layerTreeAsText(LayerTreeFlags flags) |
610 { | 618 { |
611 ASSERT(lifecycle().state() >= DocumentLifecycle::PaintInvalidationClean); | 619 ASSERT(lifecycle().state() >= DocumentLifecycle::PaintInvalidationClean || (
m_layoutView.frameView() && m_layoutView.frameView()->shouldThrottleRenderingPip
eline())); |
612 | 620 |
613 if (!m_rootContentLayer) | 621 if (!m_rootContentLayer) |
614 return String(); | 622 return String(); |
615 | 623 |
616 // We skip dumping the scroll and clip layers to keep layerTreeAsText output | 624 // We skip dumping the scroll and clip layers to keep layerTreeAsText output |
617 // similar between platforms (unless we explicitly request dumping from the | 625 // similar between platforms (unless we explicitly request dumping from the |
618 // root. | 626 // root. |
619 GraphicsLayer* rootLayer = m_rootContentLayer.get(); | 627 GraphicsLayer* rootLayer = m_rootContentLayer.get(); |
620 if (flags & LayerTreeIncludesRootLayer) | 628 if (flags & LayerTreeIncludesRootLayer) |
621 rootLayer = rootGraphicsLayer(); | 629 rootLayer = rootGraphicsLayer(); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 | 873 |
866 void DeprecatedPaintLayerCompositor::resetTrackedPaintInvalidationRects() | 874 void DeprecatedPaintLayerCompositor::resetTrackedPaintInvalidationRects() |
867 { | 875 { |
868 if (GraphicsLayer* rootLayer = rootGraphicsLayer()) | 876 if (GraphicsLayer* rootLayer = rootGraphicsLayer()) |
869 resetTrackedPaintInvalidationRectsRecursive(rootLayer); | 877 resetTrackedPaintInvalidationRectsRecursive(rootLayer); |
870 } | 878 } |
871 | 879 |
872 void DeprecatedPaintLayerCompositor::setTracksPaintInvalidations(bool tracksPain
tInvalidations) | 880 void DeprecatedPaintLayerCompositor::setTracksPaintInvalidations(bool tracksPain
tInvalidations) |
873 { | 881 { |
874 #if ENABLE(ASSERT) | 882 #if ENABLE(ASSERT) |
| 883 FrameView* view = m_layoutView.frameView(); |
875 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 884 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
876 ASSERT(lifecycle().state() == DocumentLifecycle::CompositingForSlimmingP
aintV2Clean | 885 ASSERT(lifecycle().state() == DocumentLifecycle::CompositingForSlimmingP
aintV2Clean |
877 // TODO(wangxianzhu): Remove this when we remove the old path for sp
v2. | 886 // TODO(wangxianzhu): Remove this when we remove the old path for sp
v2. |
878 || lifecycle().state() == DocumentLifecycle::PaintInvalidationClean)
; | 887 || lifecycle().state() == DocumentLifecycle::PaintInvalidationClean |
| 888 || (view && view->shouldThrottleRenderingPipeline())); |
879 } else { | 889 } else { |
880 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean)
; | 890 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean |
| 891 || (view && view->shouldThrottleRenderingPipeline())); |
881 } | 892 } |
882 #endif | 893 #endif |
883 | 894 |
884 m_isTrackingPaintInvalidations = tracksPaintInvalidations; | 895 m_isTrackingPaintInvalidations = tracksPaintInvalidations; |
885 } | 896 } |
886 | 897 |
887 bool DeprecatedPaintLayerCompositor::isTrackingPaintInvalidations() const | 898 bool DeprecatedPaintLayerCompositor::isTrackingPaintInvalidations() const |
888 { | 899 { |
889 return m_isTrackingPaintInvalidations; | 900 return m_isTrackingPaintInvalidations; |
890 } | 901 } |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 } else if (graphicsLayer == m_scrollLayer.get()) { | 1212 } else if (graphicsLayer == m_scrollLayer.get()) { |
1202 name = "LocalFrame Scrolling Layer"; | 1213 name = "LocalFrame Scrolling Layer"; |
1203 } else { | 1214 } else { |
1204 ASSERT_NOT_REACHED(); | 1215 ASSERT_NOT_REACHED(); |
1205 } | 1216 } |
1206 | 1217 |
1207 return name; | 1218 return name; |
1208 } | 1219 } |
1209 | 1220 |
1210 } // namespace blink | 1221 } // namespace blink |
OLD | NEW |