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

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

Issue 143323014: *** DO NOT LAND *** Attempt to understand Regions complexity Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 if (!boundsComputed) { 754 if (!boundsComputed) {
755 // FIXME: If this layer's overlap bounds include its children, we don't need to add its 755 // FIXME: If this layer's overlap bounds include its children, we don't need to add its
756 // children's bounds to the overlap map. 756 // children's bounds to the overlap map.
757 layerBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(lay er->overlapBounds())); 757 layerBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(lay er->overlapBounds()));
758 // Empty rects never intersect, but we need them to for the purposes of overlap testing. 758 // Empty rects never intersect, but we need them to for the purposes of overlap testing.
759 if (layerBounds.isEmpty()) 759 if (layerBounds.isEmpty())
760 layerBounds.setSize(IntSize(1, 1)); 760 layerBounds.setSize(IntSize(1, 1));
761 boundsComputed = true; 761 boundsComputed = true;
762 } 762 }
763 763
764 IntRect clipRect = pixelSnappedIntRect(layer->clipper().backgroundClipRect(C lipRectsContext(rootRenderLayer(), 0, AbsoluteClipRects)).rect()); // FIXME: Inc orrect for CSS regions. 764 IntRect clipRect = pixelSnappedIntRect(layer->clipper().backgroundClipRect(C lipRectsContext(rootRenderLayer(), AbsoluteClipRects)).rect()); // FIXME: Incorr ect for CSS regions.
765 clipRect.intersect(layerBounds); 765 clipRect.intersect(layerBounds);
766 overlapMap.add(layer, clipRect); 766 overlapMap.add(layer, clipRect);
767 } 767 }
768 768
769 void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, Ren derLayer* layer, RenderLayer* ancestorLayer) 769 void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, Ren derLayer* layer, RenderLayer* ancestorLayer)
770 { 770 {
771 if (!canBeComposited(layer) || overlapMap.contains(layer)) 771 if (!canBeComposited(layer) || overlapMap.contains(layer))
772 return; 772 return;
773 773
774 // A null ancestorLayer is an indication that 'layer' has already been pushe d. 774 // A null ancestorLayer is an indication that 'layer' has already been pushe d.
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
1666 // If squashing is disabled, then layers that would have been squashed shoul d just be separately composited. 1666 // If squashing is disabled, then layers that would have been squashed shoul d just be separately composited.
1667 bool needsOwnBackingForDisabledSquashing = !layerSquashingEnabled() && requi resSquashing(layer->compositingReasons()); 1667 bool needsOwnBackingForDisabledSquashing = !layerSquashingEnabled() && requi resSquashing(layer->compositingReasons());
1668 1668
1669 return requiresCompositing(layer->compositingReasons()) || needsOwnBackingFo rDisabledSquashing || (inCompositingMode() && layer->isRootLayer()); 1669 return requiresCompositing(layer->compositingReasons()) || needsOwnBackingFo rDisabledSquashing || (inCompositingMode() && layer->isRootLayer());
1670 } 1670 }
1671 1671
1672 bool RenderLayerCompositor::canBeComposited(const RenderLayer* layer) const 1672 bool RenderLayerCompositor::canBeComposited(const RenderLayer* layer) const
1673 { 1673 {
1674 // FIXME: We disable accelerated compositing for elements in a RenderFlowThr ead as it doesn't work properly. 1674 // FIXME: We disable accelerated compositing for elements in a RenderFlowThr ead as it doesn't work properly.
1675 // See http://webkit.org/b/84900 to re-enable it. 1675 // See http://webkit.org/b/84900 to re-enable it.
1676 return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer- >renderer()->flowThreadState() == RenderObject::NotInsideFlowThread; 1676 return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer();
1677 } 1677 }
1678 1678
1679 CompositingReasons RenderLayerCompositor::directReasonsForCompositing(const Rend erLayer* layer) const 1679 CompositingReasons RenderLayerCompositor::directReasonsForCompositing(const Rend erLayer* layer) const
1680 { 1680 {
1681 RenderObject* renderer = layer->renderer(); 1681 RenderObject* renderer = layer->renderer();
1682 CompositingReasons directReasons = CompositingReasonNone; 1682 CompositingReasons directReasons = CompositingReasonNone;
1683 1683
1684 if (requiresCompositingForTransform(renderer)) 1684 if (requiresCompositingForTransform(renderer))
1685 directReasons |= CompositingReason3DTransform; 1685 directReasons |= CompositingReason3DTransform;
1686 1686
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 if (next == compositingAncestor) { 1746 if (next == compositingAncestor) {
1747 computeClipRoot = curr; 1747 computeClipRoot = curr;
1748 break; 1748 break;
1749 } 1749 }
1750 curr = next; 1750 curr = next;
1751 } 1751 }
1752 1752
1753 if (!computeClipRoot || computeClipRoot == layer) 1753 if (!computeClipRoot || computeClipRoot == layer)
1754 return false; 1754 return false;
1755 1755
1756 return layer->clipper().backgroundClipRect(ClipRectsContext(computeClipRoot, 0, TemporaryClipRects)).rect() != PaintInfo::infiniteRect(); // FIXME: Incorrec t for CSS regions. 1756 return layer->clipper().backgroundClipRect(ClipRectsContext(computeClipRoot, TemporaryClipRects)).rect() != PaintInfo::infiniteRect();
1757 } 1757 }
1758 1758
1759 // Return true if the given layer is a stacking context and has compositing chil d 1759 // Return true if the given layer is a stacking context and has compositing chil d
1760 // layers that it needs to clip. In this case we insert a clipping GraphicsLayer 1760 // layers that it needs to clip. In this case we insert a clipping GraphicsLayer
1761 // into the hierarchy between this layer and its children in the z-order hierarc hy. 1761 // into the hierarchy between this layer and its children in the z-order hierarc hy.
1762 bool RenderLayerCompositor::clipsCompositingDescendants(const RenderLayer* layer ) const 1762 bool RenderLayerCompositor::clipsCompositingDescendants(const RenderLayer* layer ) const
1763 { 1763 {
1764 return layer->hasCompositingDescendant() && layer->renderer()->hasClipOrOver flowClip(); 1764 return layer->hasCompositingDescendant() && layer->renderer()->hasClipOrOver flowClip();
1765 } 1765 }
1766 1766
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
2656 } else if (graphicsLayer == m_scrollLayer.get()) { 2656 } else if (graphicsLayer == m_scrollLayer.get()) {
2657 name = "Frame Scrolling Layer"; 2657 name = "Frame Scrolling Layer";
2658 } else { 2658 } else {
2659 ASSERT_NOT_REACHED(); 2659 ASSERT_NOT_REACHED();
2660 } 2660 }
2661 2661
2662 return name; 2662 return name;
2663 } 2663 }
2664 2664
2665 } // namespace WebCore 2665 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerClipper.cpp ('k') | Source/core/rendering/RenderLayerStackingNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698