| 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 * Copyright (C) 2014 Google Inc. All rights reserved. | 3 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 m_hasCompositedScrollingAncestor(false) {} | 150 m_hasCompositedScrollingAncestor(false) {} |
| 151 | 151 |
| 152 PaintLayer* m_compositingAncestor; | 152 PaintLayer* m_compositingAncestor; |
| 153 bool m_subtreeIsCompositing; | 153 bool m_subtreeIsCompositing; |
| 154 bool m_hasUnisolatedCompositedBlendingDescendant; | 154 bool m_hasUnisolatedCompositedBlendingDescendant; |
| 155 bool m_testingOverlap; | 155 bool m_testingOverlap; |
| 156 bool m_hasCompositedScrollingAncestor; | 156 bool m_hasCompositedScrollingAncestor; |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 static bool requiresCompositingOrSquashing(CompositingReasons reasons) { | 159 static bool requiresCompositingOrSquashing(CompositingReasons reasons) { |
| 160 #if ENABLE(ASSERT) | 160 #if DCHECK_IS_ON() |
| 161 bool fastAnswer = reasons != CompositingReasonNone; | 161 bool fastAnswer = reasons != CompositingReasonNone; |
| 162 bool slowAnswer = requiresCompositing(reasons) || requiresSquashing(reasons); | 162 bool slowAnswer = requiresCompositing(reasons) || requiresSquashing(reasons); |
| 163 DCHECK_EQ(slowAnswer, fastAnswer); | 163 DCHECK_EQ(slowAnswer, fastAnswer); |
| 164 #endif | 164 #endif |
| 165 return reasons != CompositingReasonNone; | 165 return reasons != CompositingReasonNone; |
| 166 } | 166 } |
| 167 | 167 |
| 168 static CompositingReasons subtreeReasonsForCompositing( | 168 static CompositingReasons subtreeReasonsForCompositing( |
| 169 PaintLayer* layer, | 169 PaintLayer* layer, |
| 170 bool hasCompositedDescendants, | 170 bool hasCompositedDescendants, |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 // Here we know that all children and the layer's own contents can blindly | 372 // Here we know that all children and the layer's own contents can blindly |
| 373 // paint into this layer's backing, until a descendant is composited. So, we | 373 // paint into this layer's backing, until a descendant is composited. So, we |
| 374 // don't need to check for overlap with anything behind this layer. | 374 // don't need to check for overlap with anything behind this layer. |
| 375 overlapMap.beginNewOverlapTestingContext(); | 375 overlapMap.beginNewOverlapTestingContext(); |
| 376 // This layer is going to be composited, so children can safely ignore the | 376 // This layer is going to be composited, so children can safely ignore the |
| 377 // fact that there's an animation running behind this layer, meaning they | 377 // fact that there's an animation running behind this layer, meaning they |
| 378 // can rely on the overlap map testing again. | 378 // can rely on the overlap map testing again. |
| 379 childRecursionData.m_testingOverlap = true; | 379 childRecursionData.m_testingOverlap = true; |
| 380 } | 380 } |
| 381 | 381 |
| 382 #if ENABLE(ASSERT) | 382 #if DCHECK_IS_ON() |
| 383 LayerListMutationDetector mutationChecker(layer->stackingNode()); | 383 LayerListMutationDetector mutationChecker(layer->stackingNode()); |
| 384 #endif | 384 #endif |
| 385 | 385 |
| 386 bool anyDescendantHas3DTransform = false; | 386 bool anyDescendantHas3DTransform = false; |
| 387 bool willHaveForegroundLayer = false; | 387 bool willHaveForegroundLayer = false; |
| 388 | 388 |
| 389 if (layer->stackingNode()->isStackingContext()) { | 389 if (layer->stackingNode()->isStackingContext()) { |
| 390 PaintLayerStackingNodeIterator iterator(*layer->stackingNode(), | 390 PaintLayerStackingNodeIterator iterator(*layer->stackingNode(), |
| 391 NegativeZOrderChildren); | 391 NegativeZOrderChildren); |
| 392 while (PaintLayerStackingNode* curNode = iterator.next()) { | 392 while (PaintLayerStackingNode* curNode = iterator.next()) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 descendantHas3DTransform |= | 538 descendantHas3DTransform |= |
| 539 anyDescendantHas3DTransform || layer->has3DTransform(); | 539 anyDescendantHas3DTransform || layer->has3DTransform(); |
| 540 } | 540 } |
| 541 | 541 |
| 542 // At this point we have finished collecting all reasons to composite this | 542 // At this point we have finished collecting all reasons to composite this |
| 543 // layer. | 543 // layer. |
| 544 layer->setCompositingReasons(reasonsToComposite); | 544 layer->setCompositingReasons(reasonsToComposite); |
| 545 } | 545 } |
| 546 | 546 |
| 547 } // namespace blink | 547 } // namespace blink |
| OLD | NEW |