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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 CompositingReasons directReasons = m_compositingReasonFinder.directReasons(l
ayer); | 220 CompositingReasons directReasons = m_compositingReasonFinder.directReasons(l
ayer); |
221 | 221 |
222 // Video is special. It's the only PaintLayer type that can both have | 222 // Video is special. It's the only PaintLayer type that can both have |
223 // PaintLayer children and whose children can't use its backing to render | 223 // PaintLayer children and whose children can't use its backing to render |
224 // into. These children (the controls) always need to be promoted into their | 224 // into. These children (the controls) always need to be promoted into their |
225 // own layers to draw on top of the accelerated video. | 225 // own layers to draw on top of the accelerated video. |
226 if (currentRecursionData.m_compositingAncestor && currentRecursionData.m_com
positingAncestor->layoutObject()->isVideo()) | 226 if (currentRecursionData.m_compositingAncestor && currentRecursionData.m_com
positingAncestor->layoutObject()->isVideo()) |
227 directReasons |= CompositingReasonVideoOverlay; | 227 directReasons |= CompositingReasonVideoOverlay; |
228 | 228 |
229 if (currentRecursionData.m_hasCompositedScrollingAncestor && layer->layoutOb
ject()->styleRef().hasViewportConstrainedPosition()) | 229 if (currentRecursionData.m_hasCompositedScrollingAncestor && layer->layoutOb
ject()->styleRef().hasViewportConstrainedPosition()) |
230 directReasons |= CompositingReasonPositionFixed; | 230 directReasons |= CompositingReasonScrollDependentPosition; |
231 | 231 |
232 bool canBeComposited = compositor->canBeComposited(layer); | 232 bool canBeComposited = compositor->canBeComposited(layer); |
233 if (canBeComposited) { | 233 if (canBeComposited) { |
234 reasonsToComposite |= directReasons; | 234 reasonsToComposite |= directReasons; |
235 | 235 |
236 if (layer->isRootLayer() && compositor->rootShouldAlwaysComposite()) | 236 if (layer->isRootLayer() && compositor->rootShouldAlwaysComposite()) |
237 reasonsToComposite |= CompositingReasonRoot; | 237 reasonsToComposite |= CompositingReasonRoot; |
238 | 238 |
239 // Add CompositingReasonOverflowScrollingTouch for layers that do not al
ready have it but need it. | 239 // Add CompositingReasonOverflowScrollingTouch for layers that do not al
ready have it but need it. |
240 // Note that m_compositingReasonFinder.directReasons(layer) already incl
udes CompositingReasonOverflowScrollingTouch for | 240 // Note that m_compositingReasonFinder.directReasons(layer) already incl
udes CompositingReasonOverflowScrollingTouch for |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 overlapMap.finishCurrentOverlapTestingContext(); | 447 overlapMap.finishCurrentOverlapTestingContext(); |
448 | 448 |
449 descendantHas3DTransform |= anyDescendantHas3DTransform || layer->has3DT
ransform(); | 449 descendantHas3DTransform |= anyDescendantHas3DTransform || layer->has3DT
ransform(); |
450 } | 450 } |
451 | 451 |
452 // At this point we have finished collecting all reasons to composite this l
ayer. | 452 // At this point we have finished collecting all reasons to composite this l
ayer. |
453 layer->setCompositingReasons(reasonsToComposite); | 453 layer->setCompositingReasons(reasonsToComposite); |
454 } | 454 } |
455 | 455 |
456 } // namespace blink | 456 } // namespace blink |
OLD | NEW |