Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(929)

Side by Side Diff: Source/WebCore/rendering/RenderLayerCompositor.cpp

Issue 13912020: Revert "Remove empty layer hack in RenderLayerCompositor" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 644
645 void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, RenderLayer* layer, IntRect& layerBounds, bool& boundsComputed) 645 void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, RenderLayer* layer, IntRect& layerBounds, bool& boundsComputed)
646 { 646 {
647 if (layer->isRootLayer()) 647 if (layer->isRootLayer())
648 return; 648 return;
649 649
650 if (!boundsComputed) { 650 if (!boundsComputed) {
651 // FIXME: If this layer's overlap bounds include its children, we don't need to add its 651 // FIXME: If this layer's overlap bounds include its children, we don't need to add its
652 // children's bounds to the overlap map. 652 // children's bounds to the overlap map.
653 layerBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(lay er->overlapBounds())); 653 layerBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(lay er->overlapBounds()));
654 // Empty rects never intersect, but we need them to for the purposes of overlap testing.
655 if (layerBounds.isEmpty())
656 layerBounds.setSize(IntSize(1, 1));
654 boundsComputed = true; 657 boundsComputed = true;
655 if (layerBounds.isEmpty())
656 return;
657 } 658 }
658 659
659 IntRect clipRect = pixelSnappedIntRect(layer->backgroundClipRect(RenderLayer ::ClipRectsContext(rootRenderLayer(), 0, AbsoluteClipRects)).rect()); // FIXME: Incorrect for CSS regions. 660 IntRect clipRect = pixelSnappedIntRect(layer->backgroundClipRect(RenderLayer ::ClipRectsContext(rootRenderLayer(), 0, AbsoluteClipRects)).rect()); // FIXME: Incorrect for CSS regions.
660 clipRect.intersect(layerBounds); 661 clipRect.intersect(layerBounds);
661 overlapMap.add(layer, clipRect); 662 overlapMap.add(layer, clipRect);
662 } 663 }
663 664
664 void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, Ren derLayer* layer, RenderLayer* ancestorLayer) 665 void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, Ren derLayer* layer, RenderLayer* ancestorLayer)
665 { 666 {
666 if (!canBeComposited(layer) || overlapMap.contains(layer)) 667 if (!canBeComposited(layer) || overlapMap.contains(layer))
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 layer->setHasCompositingDescendant(false); 731 layer->setHasCompositingDescendant(false);
731 732
732 RenderLayer::IndirectCompositingReason compositingReason = compositingState. m_subtreeIsCompositing ? RenderLayer::IndirectCompositingForStacking : RenderLay er::NoIndirectCompositingReason; 733 RenderLayer::IndirectCompositingReason compositingReason = compositingState. m_subtreeIsCompositing ? RenderLayer::IndirectCompositingForStacking : RenderLay er::NoIndirectCompositingReason;
733 734
734 bool haveComputedBounds = false; 735 bool haveComputedBounds = false;
735 IntRect absBounds; 736 IntRect absBounds;
736 if (overlapMap && !overlapMap->isEmpty() && compositingState.m_testingOverla p) { 737 if (overlapMap && !overlapMap->isEmpty() && compositingState.m_testingOverla p) {
737 // If we're testing for overlap, we only need to composite if we overlap something that is already composited. 738 // If we're testing for overlap, we only need to composite if we overlap something that is already composited.
738 absBounds = enclosingIntRect(overlapMap->geometryMap().absoluteRect(laye r->overlapBounds())); 739 absBounds = enclosingIntRect(overlapMap->geometryMap().absoluteRect(laye r->overlapBounds()));
739 740
741 // Empty rects never intersect, but we need them to for the purposes of overlap testing.
742 if (absBounds.isEmpty())
743 absBounds.setSize(IntSize(1, 1));
740 haveComputedBounds = true; 744 haveComputedBounds = true;
741 compositingReason = overlapMap->overlapsLayers(absBounds) ? RenderLayer: :IndirectCompositingForOverlap : RenderLayer::NoIndirectCompositingReason; 745 compositingReason = overlapMap->overlapsLayers(absBounds) ? RenderLayer: :IndirectCompositingForOverlap : RenderLayer::NoIndirectCompositingReason;
742 } 746 }
743 747
744 #if ENABLE(VIDEO) 748 #if ENABLE(VIDEO)
745 // Video is special. It's the only RenderLayer type that can both have 749 // Video is special. It's the only RenderLayer type that can both have
746 // RenderLayer children and whose children can't use its backing to render 750 // RenderLayer children and whose children can't use its backing to render
747 // into. These children (the controls) always need to be promoted into their 751 // into. These children (the controls) always need to be promoted into their
748 // own layers to draw on top of the accelerated video. 752 // own layers to draw on top of the accelerated video.
749 if (compositingState.m_compositingAncestor && compositingState.m_compositing Ancestor->renderer()->isVideo()) 753 if (compositingState.m_compositingAncestor && compositingState.m_compositing Ancestor->renderer()->isVideo())
(...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after
2778 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); 2782 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas");
2779 info.addMember(m_contentShadowLayer, "contentShadowLayer"); 2783 info.addMember(m_contentShadowLayer, "contentShadowLayer");
2780 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); 2784 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea");
2781 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); 2785 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea");
2782 info.addMember(m_layerForHeader, "layerForHeader"); 2786 info.addMember(m_layerForHeader, "layerForHeader");
2783 info.addMember(m_layerForFooter, "layerForFooter"); 2787 info.addMember(m_layerForFooter, "layerForFooter");
2784 #endif 2788 #endif
2785 } 2789 }
2786 2790
2787 } // namespace WebCore 2791 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698