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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 #if ASSERT_ENABLED | 249 #if ASSERT_ENABLED |
250 assertNoUnresolvedDirtyBits(); | 250 assertNoUnresolvedDirtyBits(); |
251 for (LocalFrame* child = m_renderView.frameView()->frame().tree().firstChild
(); child; child = child->tree().nextSibling()) | 251 for (LocalFrame* child = m_renderView.frameView()->frame().tree().firstChild
(); child; child = child->tree().nextSibling()) |
252 child->contentRenderer()->compositor()->assertNoUnresolvedDirtyBits(); | 252 child->contentRenderer()->compositor()->assertNoUnresolvedDirtyBits(); |
253 #endif | 253 #endif |
254 } | 254 } |
255 | 255 |
256 void RenderLayerCompositor::setNeedsCompositingUpdate(CompositingUpdateType upda
teType) | 256 void RenderLayerCompositor::setNeedsCompositingUpdate(CompositingUpdateType upda
teType) |
257 { | 257 { |
258 ASSERT(updateType != CompositingUpdateNone); | 258 ASSERT(updateType != CompositingUpdateNone); |
| 259 // FIXME: Technically we only need to do this when the FrameView's isScrolla
ble method |
| 260 // would return a different value. |
| 261 if (updateType == CompositingUpdateAfterLayout) |
| 262 m_rootShouldAlwaysCompositeDirty = true; |
| 263 |
| 264 // FIXME: This function should only set dirty bits. We shouldn't |
| 265 // enable compositing mode here. |
| 266 // We check needsLayout here because we don't know if we need to enable |
| 267 // compositing mode until layout is up-to-date because we need to know |
| 268 // if this frame scrolls. |
| 269 if (!m_renderView.needsLayout()) |
| 270 enableCompositingModeIfNeeded(); |
| 271 |
259 m_pendingUpdateType = std::max(m_pendingUpdateType, updateType); | 272 m_pendingUpdateType = std::max(m_pendingUpdateType, updateType); |
| 273 |
260 page()->animator().scheduleVisualUpdate(); | 274 page()->animator().scheduleVisualUpdate(); |
261 lifecycle().ensureStateAtMost(DocumentLifecycle::LayoutClean); | 275 lifecycle().ensureStateAtMost(DocumentLifecycle::LayoutClean); |
262 } | 276 } |
263 | 277 |
264 void RenderLayerCompositor::didLayout() | |
265 { | |
266 // FIXME: Technically we only need to do this when the FrameView's | |
267 // isScrollable method would return a different value. | |
268 m_rootShouldAlwaysCompositeDirty = true; | |
269 enableCompositingModeIfNeeded(); | |
270 | |
271 // FIXME: Rather than marking the entire RenderView as dirty, we should | |
272 // track which RenderLayers moved during layout and only dirty those | |
273 // specific RenderLayers. | |
274 rootRenderLayer()->setNeedsToUpdateAncestorDependentProperties(); | |
275 setNeedsCompositingUpdate(CompositingUpdateAfterCompositingInputChange); | |
276 } | |
277 | |
278 #if ASSERT_ENABLED | 278 #if ASSERT_ENABLED |
279 | 279 |
280 void RenderLayerCompositor::assertNoUnresolvedDirtyBits() | 280 void RenderLayerCompositor::assertNoUnresolvedDirtyBits() |
281 { | 281 { |
282 ASSERT(!compositingLayersNeedRebuild()); | 282 ASSERT(!compositingLayersNeedRebuild()); |
283 ASSERT(m_pendingUpdateType == CompositingUpdateNone); | 283 ASSERT(m_pendingUpdateType == CompositingUpdateNone); |
284 ASSERT(!m_rootShouldAlwaysCompositeDirty); | 284 ASSERT(!m_rootShouldAlwaysCompositeDirty); |
285 } | 285 } |
286 | 286 |
287 #endif | 287 #endif |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 if (!hasAcceleratedCompositing()) | 340 if (!hasAcceleratedCompositing()) |
341 return; | 341 return; |
342 | 342 |
343 bool needsToUpdateScrollingCoordinator = scrollingCoordinator() && scrolling
Coordinator()->needsToUpdateAfterCompositingChange(); | 343 bool needsToUpdateScrollingCoordinator = scrollingCoordinator() && scrolling
Coordinator()->needsToUpdateAfterCompositingChange(); |
344 if (updateType == CompositingUpdateNone && !needHierarchyAndGeometryUpdate &
& !needsToUpdateScrollingCoordinator) | 344 if (updateType == CompositingUpdateNone && !needHierarchyAndGeometryUpdate &
& !needsToUpdateScrollingCoordinator) |
345 return; | 345 return; |
346 | 346 |
347 GraphicsLayerUpdater::UpdateType graphicsLayerUpdateType = GraphicsLayerUpda
ter::DoNotForceUpdate; | 347 GraphicsLayerUpdater::UpdateType graphicsLayerUpdateType = GraphicsLayerUpda
ter::DoNotForceUpdate; |
348 CompositingPropertyUpdater::UpdateType compositingPropertyUpdateType = Compo
sitingPropertyUpdater::DoNotForceUpdate; | 348 CompositingPropertyUpdater::UpdateType compositingPropertyUpdateType = Compo
sitingPropertyUpdater::DoNotForceUpdate; |
349 | 349 |
| 350 // FIXME: Teach non-style compositing updates how to do partial tree walks. |
| 351 if (updateType >= CompositingUpdateAfterLayout) { |
| 352 graphicsLayerUpdateType = GraphicsLayerUpdater::ForceUpdate; |
| 353 compositingPropertyUpdateType = CompositingPropertyUpdater::ForceUpdate; |
| 354 } |
| 355 |
350 RenderLayer* updateRoot = rootRenderLayer(); | 356 RenderLayer* updateRoot = rootRenderLayer(); |
351 | 357 |
352 Vector<RenderLayer*> layersNeedingRepaint; | 358 Vector<RenderLayer*> layersNeedingRepaint; |
353 | 359 |
354 if (updateType >= CompositingUpdateAfterCompositingInputChange) { | 360 if (updateType >= CompositingUpdateAfterCompositingInputChange) { |
355 bool layersChanged = false; | 361 bool layersChanged = false; |
356 { | 362 { |
357 TRACE_EVENT0("blink_rendering", "CompositingPropertyUpdater::updateA
ncestorDependentProperties"); | 363 TRACE_EVENT0("blink_rendering", "CompositingPropertyUpdater::updateA
ncestorDependentProperties"); |
358 CompositingPropertyUpdater(updateRoot).updateAncestorDependentProper
ties(updateRoot, compositingPropertyUpdateType); | 364 CompositingPropertyUpdater(updateRoot).updateAncestorDependentProper
ties(updateRoot, compositingPropertyUpdateType); |
359 #if ASSERT_ENABLED | 365 #if ASSERT_ENABLED |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 } else if (graphicsLayer == m_scrollLayer.get()) { | 1336 } else if (graphicsLayer == m_scrollLayer.get()) { |
1331 name = "LocalFrame Scrolling Layer"; | 1337 name = "LocalFrame Scrolling Layer"; |
1332 } else { | 1338 } else { |
1333 ASSERT_NOT_REACHED(); | 1339 ASSERT_NOT_REACHED(); |
1334 } | 1340 } |
1335 | 1341 |
1336 return name; | 1342 return name; |
1337 } | 1343 } |
1338 | 1344 |
1339 } // namespace WebCore | 1345 } // namespace WebCore |
OLD | NEW |