| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 DeprecatedPaintLayerCompositor::DeprecatedPaintLayerCompositor(LayoutView& layou
tView) | 68 DeprecatedPaintLayerCompositor::DeprecatedPaintLayerCompositor(LayoutView& layou
tView) |
| 69 : m_layoutView(layoutView) | 69 : m_layoutView(layoutView) |
| 70 , m_compositingReasonFinder(layoutView) | 70 , m_compositingReasonFinder(layoutView) |
| 71 , m_pendingUpdateType(CompositingUpdateNone) | 71 , m_pendingUpdateType(CompositingUpdateNone) |
| 72 , m_hasAcceleratedCompositing(true) | 72 , m_hasAcceleratedCompositing(true) |
| 73 , m_compositing(false) | 73 , m_compositing(false) |
| 74 , m_rootShouldAlwaysCompositeDirty(true) | 74 , m_rootShouldAlwaysCompositeDirty(true) |
| 75 , m_needsUpdateFixedBackground(false) | 75 , m_needsUpdateFixedBackground(false) |
| 76 , m_isTrackingPaintInvalidations(false) | 76 , m_isTrackingPaintInvalidations(false) |
| 77 , m_inOverlayFullscreenVideo(false) |
| 78 , m_needsUpdateDescendantDependentFlags(false) |
| 77 , m_rootLayerAttachment(RootLayerUnattached) | 79 , m_rootLayerAttachment(RootLayerUnattached) |
| 78 , m_inOverlayFullscreenVideo(false) | |
| 79 { | 80 { |
| 80 updateAcceleratedCompositingSettings(); | 81 updateAcceleratedCompositingSettings(); |
| 81 } | 82 } |
| 82 | 83 |
| 83 DeprecatedPaintLayerCompositor::~DeprecatedPaintLayerCompositor() | 84 DeprecatedPaintLayerCompositor::~DeprecatedPaintLayerCompositor() |
| 84 { | 85 { |
| 85 ASSERT(m_rootLayerAttachment == RootLayerUnattached); | 86 ASSERT(m_rootLayerAttachment == RootLayerUnattached); |
| 86 } | 87 } |
| 87 | 88 |
| 88 bool DeprecatedPaintLayerCompositor::inCompositingMode() const | 89 bool DeprecatedPaintLayerCompositor::inCompositingMode() const |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // Get the current fullscreen element from the document. | 176 // Get the current fullscreen element from the document. |
| 176 fullscreenElement = Fullscreen::currentFullScreenElementFrom(*contentDocumen
t); | 177 fullscreenElement = Fullscreen::currentFullScreenElementFrom(*contentDocumen
t); |
| 177 if (!isHTMLVideoElement(fullscreenElement)) | 178 if (!isHTMLVideoElement(fullscreenElement)) |
| 178 return 0; | 179 return 0; |
| 179 LayoutObject* layoutObject = fullscreenElement->layoutObject(); | 180 LayoutObject* layoutObject = fullscreenElement->layoutObject(); |
| 180 if (!layoutObject) | 181 if (!layoutObject) |
| 181 return 0; | 182 return 0; |
| 182 return toLayoutVideo(layoutObject); | 183 return toLayoutVideo(layoutObject); |
| 183 } | 184 } |
| 184 | 185 |
| 186 // The descendant-dependent flags system is badly broken because we clean dirty |
| 187 // bits in upward tree walks, which means we need to call updateDescendantDepend
entFlags |
| 188 // at every node in the tree to fully clean all the dirty bits. While we'll in |
| 189 // the process of fixing this issue, updateDescendantDependentFlagsForEntireSubt
ree |
| 190 // provides a big hammer for actually cleaning all the dirty bits in a subtree. |
| 191 // |
| 192 // FIXME: Remove this function once the descendant-dependent flags system keeps |
| 193 // its dirty bits scoped to subtrees. |
| 194 void updateDescendantDependentFlagsForEntireSubtree(DeprecatedPaintLayer& layer) |
| 195 { |
| 196 layer.updateDescendantDependentFlags(); |
| 197 |
| 198 for (DeprecatedPaintLayer* child = layer.firstChild(); child; child = child-
>nextSibling()) |
| 199 updateDescendantDependentFlagsForEntireSubtree(*child); |
| 200 } |
| 201 |
| 185 void DeprecatedPaintLayerCompositor::updateIfNeededRecursive() | 202 void DeprecatedPaintLayerCompositor::updateIfNeededRecursive() |
| 186 { | 203 { |
| 187 for (Frame* child = m_layoutView.frameView()->frame().tree().firstChild(); c
hild; child = child->tree().nextSibling()) { | 204 for (Frame* child = m_layoutView.frameView()->frame().tree().firstChild(); c
hild; child = child->tree().nextSibling()) { |
| 188 if (!child->isLocalFrame()) | 205 if (!child->isLocalFrame()) |
| 189 continue; | 206 continue; |
| 190 LocalFrame* localFrame = toLocalFrame(child); | 207 LocalFrame* localFrame = toLocalFrame(child); |
| 191 // It's possible for trusted Pepper plugins to force hit testing in situ
ations where | 208 // It's possible for trusted Pepper plugins to force hit testing in situ
ations where |
| 192 // the frame tree is in an inconsistent state, such as in the middle of
frame detach. | 209 // the frame tree is in an inconsistent state, such as in the middle of
frame detach. |
| 193 // TODO(bbudge) Remove this check when trusted Pepper plugins are gone. | 210 // TODO(bbudge) Remove this check when trusted Pepper plugins are gone. |
| 194 if (localFrame->document()->isActive()) | 211 if (localFrame->document()->isActive()) |
| 195 localFrame->contentLayoutObject()->compositor()->updateIfNeededRecur
sive(); | 212 localFrame->contentLayoutObject()->compositor()->updateIfNeededRecur
sive(); |
| 196 } | 213 } |
| 197 | 214 |
| 198 TRACE_EVENT0("blink", "DeprecatedPaintLayerCompositor::updateIfNeededRecursi
ve"); | 215 TRACE_EVENT0("blink", "DeprecatedPaintLayerCompositor::updateIfNeededRecursi
ve"); |
| 199 | 216 |
| 200 ASSERT(!m_layoutView.needsLayout()); | 217 ASSERT(!m_layoutView.needsLayout()); |
| 201 | 218 |
| 202 ScriptForbiddenScope forbidScript; | 219 ScriptForbiddenScope forbidScript; |
| 203 | 220 |
| 204 // FIXME: enableCompositingModeIfNeeded can trigger a CompositingUpdateRebui
ldTree, | 221 // FIXME: enableCompositingModeIfNeeded can trigger a CompositingUpdateRebui
ldTree, |
| 205 // which asserts that it's not InCompositingUpdate. | 222 // which asserts that it's not InCompositingUpdate. |
| 206 enableCompositingModeIfNeeded(); | 223 enableCompositingModeIfNeeded(); |
| 207 | 224 |
| 208 rootLayer()->updateDescendantDependentFlagsForEntireSubtree(); | 225 if (m_needsUpdateDescendantDependentFlags) { |
| 226 updateDescendantDependentFlagsForEntireSubtree(*rootLayer()); |
| 227 m_needsUpdateDescendantDependentFlags = false; |
| 228 } |
| 229 |
| 209 m_layoutView.commitPendingSelection(); | 230 m_layoutView.commitPendingSelection(); |
| 210 | 231 |
| 211 lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdate); | 232 lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdate); |
| 212 updateIfNeeded(); | 233 updateIfNeeded(); |
| 213 lifecycle().advanceTo(DocumentLifecycle::CompositingClean); | 234 lifecycle().advanceTo(DocumentLifecycle::CompositingClean); |
| 214 | 235 |
| 215 DocumentAnimations::updateCompositorAnimations(m_layoutView.document()); | 236 DocumentAnimations::updateCompositorAnimations(m_layoutView.document()); |
| 216 | 237 |
| 217 m_layoutView.frameView()->updateCompositorScrollAnimations(); | 238 m_layoutView.frameView()->updateCompositorScrollAnimations(); |
| 218 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = m_layoutV
iew.frameView()->animatingScrollableAreas()) { | 239 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = m_layoutV
iew.frameView()->animatingScrollableAreas()) { |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 } else if (graphicsLayer == m_scrollLayer.get()) { | 1206 } else if (graphicsLayer == m_scrollLayer.get()) { |
| 1186 name = "LocalFrame Scrolling Layer"; | 1207 name = "LocalFrame Scrolling Layer"; |
| 1187 } else { | 1208 } else { |
| 1188 ASSERT_NOT_REACHED(); | 1209 ASSERT_NOT_REACHED(); |
| 1189 } | 1210 } |
| 1190 | 1211 |
| 1191 return name; | 1212 return name; |
| 1192 } | 1213 } |
| 1193 | 1214 |
| 1194 } // namespace blink | 1215 } // namespace blink |
| OLD | NEW |