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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 , m_hasAcceleratedCompositing(true) | 211 , m_hasAcceleratedCompositing(true) |
212 , m_compositingTriggers(static_cast<ChromeClient::CompositingTriggerFlags>(C
hromeClient::AllTriggers)) | 212 , m_compositingTriggers(static_cast<ChromeClient::CompositingTriggerFlags>(C
hromeClient::AllTriggers)) |
213 , m_compositedLayerCount(0) | 213 , m_compositedLayerCount(0) |
214 , m_showDebugBorders(false) | 214 , m_showDebugBorders(false) |
215 , m_showRepaintCounter(false) | 215 , m_showRepaintCounter(false) |
216 , m_reevaluateCompositingAfterLayout(false) | 216 , m_reevaluateCompositingAfterLayout(false) |
217 , m_compositing(false) | 217 , m_compositing(false) |
218 , m_compositingLayersNeedRebuild(false) | 218 , m_compositingLayersNeedRebuild(false) |
219 , m_forceCompositingMode(false) | 219 , m_forceCompositingMode(false) |
220 , m_inPostLayoutUpdate(false) | 220 , m_inPostLayoutUpdate(false) |
| 221 , m_needsUpdateCompositingRequirementsState(false) |
221 , m_isTrackingRepaints(false) | 222 , m_isTrackingRepaints(false) |
222 , m_rootLayerAttachment(RootLayerUnattached) | 223 , m_rootLayerAttachment(RootLayerUnattached) |
223 #if !LOG_DISABLED | 224 #if !LOG_DISABLED |
224 , m_rootLayerUpdateCount(0) | 225 , m_rootLayerUpdateCount(0) |
225 , m_obligateCompositedLayerCount(0) | 226 , m_obligateCompositedLayerCount(0) |
226 , m_secondaryCompositedLayerCount(0) | 227 , m_secondaryCompositedLayerCount(0) |
227 , m_obligatoryBackingStoreBytes(0) | 228 , m_obligatoryBackingStoreBytes(0) |
228 , m_secondaryBackingStoreBytes(0) | 229 , m_secondaryBackingStoreBytes(0) |
229 #endif | 230 #endif |
230 { | 231 { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 if (Page* page = this->page()) | 324 if (Page* page = this->page()) |
324 page->chrome()->client()->scheduleCompositingLayerFlush(); | 325 page->chrome()->client()->scheduleCompositingLayerFlush(); |
325 } | 326 } |
326 } | 327 } |
327 | 328 |
328 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer*
rootLayer) const | 329 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer*
rootLayer) const |
329 { | 330 { |
330 return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0); | 331 return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0); |
331 } | 332 } |
332 | 333 |
| 334 void RenderLayerCompositor::updateCompositingRequirementsState(CompositingUpdate
Type updateType, RenderLayer* updateRoot) |
| 335 { |
| 336 if (!m_needsUpdateCompositingRequirementsState) |
| 337 return; |
| 338 |
| 339 const bool firstIteration = !updateRoot; |
| 340 if (!updateRoot) { |
| 341 bool needsUpdateHasOutOfFlowPositionedDescendant = false; |
| 342 switch (updateType) { |
| 343 case CompositingUpdateAfterStyleChange: |
| 344 needsUpdateHasOutOfFlowPositionedDescendant = true; |
| 345 break; |
| 346 case CompositingUpdateAfterLayout: |
| 347 break; |
| 348 case CompositingUpdateOnScroll: |
| 349 case CompositingUpdateOnCompositedScroll: |
| 350 ASSERT_NOT_REACHED(); |
| 351 break; |
| 352 } |
| 353 |
| 354 updateRoot = rootRenderLayer(); |
| 355 updateRoot->updateDescendantDependentFlags(); |
| 356 if (needsUpdateHasOutOfFlowPositionedDescendant) { |
| 357 updateRoot->updateHasOutOfFlowPositionedDescendant(); |
| 358 } |
| 359 } |
| 360 |
| 361 updateRoot->updateNeedsCompositedScrolling(); |
| 362 |
| 363 // In this function we update state that determines whether layers are |
| 364 // stacking containers. We may therefore not use this concept here. Instead, |
| 365 // we'll iterate through the tree topologically. |
| 366 for (RenderLayer* child = updateRoot->firstChild(); child; child = child->ne
xtSibling()) |
| 367 updateCompositingRequirementsState(updateType, child); |
| 368 |
| 369 if (firstIteration) |
| 370 m_needsUpdateCompositingRequirementsState = false; |
| 371 } |
| 372 |
333 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
Type, RenderLayer* updateRoot) | 373 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
Type, RenderLayer* updateRoot) |
334 { | 374 { |
335 // Avoid updating the layers with old values. Compositing layers will be upd
ated after the layout is finished. | 375 // Avoid updating the layers with old values. Compositing layers will be upd
ated after the layout is finished. |
336 if (m_renderView->needsLayout()) | 376 if (m_renderView->needsLayout()) |
337 return; | 377 return; |
338 | 378 |
339 if (m_forceCompositingMode && !m_compositing) | 379 if (m_forceCompositingMode && !m_compositing) |
340 enableCompositingMode(true); | 380 enableCompositingMode(true); |
341 | 381 |
342 if (!m_reevaluateCompositingAfterLayout && !m_compositing) | 382 if (!m_reevaluateCompositingAfterLayout && !m_compositing) |
(...skipping 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2758 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); | 2798 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); |
2759 #if ENABLE(RUBBER_BANDING) | 2799 #if ENABLE(RUBBER_BANDING) |
2760 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); | 2800 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); |
2761 info.addMember(m_contentShadowLayer, "contentShadowLayer"); | 2801 info.addMember(m_contentShadowLayer, "contentShadowLayer"); |
2762 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); | 2802 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); |
2763 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); | 2803 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); |
2764 #endif | 2804 #endif |
2765 } | 2805 } |
2766 | 2806 |
2767 } // namespace WebCore | 2807 } // namespace WebCore |
OLD | NEW |