| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 if (m_rootPlatformLayer) | 446 if (m_rootPlatformLayer) |
| 447 m_rootPlatformLayer->addChild(layerAnchor); | 447 m_rootPlatformLayer->addChild(layerAnchor); |
| 448 } | 448 } |
| 449 } | 449 } |
| 450 | 450 |
| 451 void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, stru
ct CompositingState& ioCompState) | 451 void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, stru
ct CompositingState& ioCompState) |
| 452 { | 452 { |
| 453 updateLayerCompositingState(layer, StyleDifferenceEqual); | 453 updateLayerCompositingState(layer, StyleDifferenceEqual); |
| 454 | 454 |
| 455 // host the document layer in the RenderView's root layer | 455 // host the document layer in the RenderView's root layer |
| 456 if (layer->isDocumentLayer()) | 456 if (layer->isRootLayer()) |
| 457 parentInRootLayer(layer); | 457 parentInRootLayer(layer); |
| 458 | 458 |
| 459 CompositingState childState = ioCompState; | 459 CompositingState childState = ioCompState; |
| 460 if (layer->isComposited()) | 460 if (layer->isComposited()) |
| 461 childState.m_compositingAncestor = layer; | 461 childState.m_compositingAncestor = layer; |
| 462 | 462 |
| 463 #ifndef NDEBUG | 463 #ifndef NDEBUG |
| 464 ++childState.m_depth; | 464 ++childState.m_depth; |
| 465 #endif | 465 #endif |
| 466 | 466 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 | 630 |
| 631 // Note: this specifies whether the RL needs a compositing layer for intrinsic r
easons. | 631 // Note: this specifies whether the RL needs a compositing layer for intrinsic r
easons. |
| 632 // Use needsToBeComposited() to determine if a RL actually needs a compositing l
ayer. | 632 // Use needsToBeComposited() to determine if a RL actually needs a compositing l
ayer. |
| 633 // static | 633 // static |
| 634 bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer* layer) c
onst | 634 bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer* layer) c
onst |
| 635 { | 635 { |
| 636 // FIXME: cache the result of these tests? | 636 // FIXME: cache the result of these tests? |
| 637 #if VERBOSE_COMPOSITINGLAYER | 637 #if VERBOSE_COMPOSITINGLAYER |
| 638 bool gotReason = false; | 638 bool gotReason = false; |
| 639 | 639 |
| 640 if (!gotReason && inCompositingMode() && layer->isDocumentLayer()) { | 640 if (!gotReason && inCompositingMode() && layer->isRootLayer()) { |
| 641 fprintf(stderr, "RenderLayer %p requires compositing layer because: it's
the document root\n", layer); | 641 fprintf(stderr, "RenderLayer %p requires compositing layer because: it's
the document root\n", layer); |
| 642 gotReason = true; | 642 gotReason = true; |
| 643 } | 643 } |
| 644 | 644 |
| 645 if (!gotReason && requiresCompositingLayerForTransform(layer->renderer())) { | 645 if (!gotReason && requiresCompositingLayerForTransform(layer->renderer())) { |
| 646 fprintf(stderr, "RenderLayer %p requires compositing layer because: it h
as 3d transform, perspective, backface, or animating transform\n", layer); | 646 fprintf(stderr, "RenderLayer %p requires compositing layer because: it h
as 3d transform, perspective, backface, or animating transform\n", layer); |
| 647 gotReason = true; | 647 gotReason = true; |
| 648 } | 648 } |
| 649 | 649 |
| 650 if (!gotReason && clipsCompositingDescendants(layer)) { | 650 if (!gotReason && clipsCompositingDescendants(layer)) { |
| 651 fprintf(stderr, "RenderLayer %p requires compositing layer because: it h
as overflow clip\n", layer); | 651 fprintf(stderr, "RenderLayer %p requires compositing layer because: it h
as overflow clip\n", layer); |
| 652 gotReason = true; | 652 gotReason = true; |
| 653 } | 653 } |
| 654 | 654 |
| 655 if (!gotReason && requiresCompositingForAnimation(layer)) { | 655 if (!gotReason && requiresCompositingForAnimation(layer)) { |
| 656 fprintf(stderr, "RenderLayer %p requires compositing layer because: it h
as a running transition for opacity or transform\n", layer); | 656 fprintf(stderr, "RenderLayer %p requires compositing layer because: it h
as a running transition for opacity or transform\n", layer); |
| 657 gotReason = true; | 657 gotReason = true; |
| 658 } | 658 } |
| 659 | 659 |
| 660 if (!gotReason) | 660 if (!gotReason) |
| 661 fprintf(stderr, "RenderLayer %p does not require compositing layer\n", l
ayer); | 661 fprintf(stderr, "RenderLayer %p does not require compositing layer\n", l
ayer); |
| 662 #endif | 662 #endif |
| 663 | 663 |
| 664 // the root layer always has a compositing layer (for now). | 664 // The root layer always has a compositing layer, but it may not have backin
g. |
| 665 return (inCompositingMode() && layer->isDocumentLayer()) || | 665 return (inCompositingMode() && layer->isRootLayer()) || |
| 666 requiresCompositingLayerForTransform(layer->renderer()) || | 666 requiresCompositingLayerForTransform(layer->renderer()) || |
| 667 clipsCompositingDescendants(layer) || | 667 clipsCompositingDescendants(layer) || |
| 668 requiresCompositingForAnimation(layer); | 668 requiresCompositingForAnimation(layer); |
| 669 } | 669 } |
| 670 | 670 |
| 671 // Return true if the given layer has some ancestor in the RenderLayer hierarchy
that clips, | 671 // Return true if the given layer has some ancestor in the RenderLayer hierarchy
that clips, |
| 672 // up to the enclosing compositing ancestor. This is required because compositin
g layers are parented | 672 // up to the enclosing compositing ancestor. This is required because compositin
g layers are parented |
| 673 // according to the z-order hierarchy, yet clipping goes down the renderer hiera
rchy. | 673 // according to the z-order hierarchy, yet clipping goes down the renderer hiera
rchy. |
| 674 // Thus, a RenderLayer can be clipped by a RenderLayer that is an ancestor in th
e renderer hierarchy, | 674 // Thus, a RenderLayer can be clipped by a RenderLayer that is an ancestor in th
e renderer hierarchy, |
| 675 // but a sibling in the z-order hierarchy. | 675 // but a sibling in the z-order hierarchy. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 // Need to clip to prevent transformed content showing outside this frame | 738 // Need to clip to prevent transformed content showing outside this frame |
| 739 m_rootPlatformLayer->setMasksToBounds(true); | 739 m_rootPlatformLayer->setMasksToBounds(true); |
| 740 | 740 |
| 741 didMoveOnscreen(); | 741 didMoveOnscreen(); |
| 742 } | 742 } |
| 743 | 743 |
| 744 } // namespace WebCore | 744 } // namespace WebCore |
| 745 | 745 |
| 746 #endif // USE(ACCELERATED_COMPOSITING) | 746 #endif // USE(ACCELERATED_COMPOSITING) |
| 747 | 747 |
| OLD | NEW |