| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 namespace blink { | 79 namespace blink { |
| 80 | 80 |
| 81 RenderLayer::RenderLayer(RenderLayerModelObject* renderer, LayerType type) | 81 RenderLayer::RenderLayer(RenderLayerModelObject* renderer, LayerType type) |
| 82 : m_layerType(type) | 82 : m_layerType(type) |
| 83 , m_hasSelfPaintingLayerDescendant(false) | 83 , m_hasSelfPaintingLayerDescendant(false) |
| 84 , m_hasSelfPaintingLayerDescendantDirty(false) | 84 , m_hasSelfPaintingLayerDescendantDirty(false) |
| 85 , m_isRootLayer(renderer->isRenderView()) | 85 , m_isRootLayer(renderer->isRenderView()) |
| 86 , m_usedTransparency(false) | 86 , m_usedTransparency(false) |
| 87 , m_3DTransformedDescendantStatusDirty(true) | 87 , m_3DTransformedDescendantStatusDirty(true) |
| 88 , m_has3DTransformedDescendant(false) | 88 , m_has3DTransformedDescendant(false) |
| 89 , m_containsDirtyOverlayScrollbars(false) | |
| 90 , m_hasFilterInfo(false) | 89 , m_hasFilterInfo(false) |
| 91 , m_needsAncestorDependentCompositingInputsUpdate(true) | 90 , m_needsAncestorDependentCompositingInputsUpdate(true) |
| 92 , m_needsDescendantDependentCompositingInputsUpdate(true) | 91 , m_needsDescendantDependentCompositingInputsUpdate(true) |
| 93 , m_childNeedsCompositingInputsUpdate(true) | 92 , m_childNeedsCompositingInputsUpdate(true) |
| 94 , m_hasCompositingDescendant(false) | 93 , m_hasCompositingDescendant(false) |
| 95 , m_lostGroupedMapping(false) | 94 , m_lostGroupedMapping(false) |
| 96 , m_renderer(renderer) | 95 , m_renderer(renderer) |
| 97 , m_parent(0) | 96 , m_parent(0) |
| 98 , m_previous(0) | 97 , m_previous(0) |
| 99 , m_next(0) | 98 , m_next(0) |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 m_stackingNode = nullptr; | 805 m_stackingNode = nullptr; |
| 807 } | 806 } |
| 808 | 807 |
| 809 void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect,
RenderObject* paintingRoot) | 808 void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect,
RenderObject* paintingRoot) |
| 810 { | 809 { |
| 811 TRACE_EVENT0("blink", "RenderLayer::paint"); | 810 TRACE_EVENT0("blink", "RenderLayer::paint"); |
| 812 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), LayoutSiz
e(), paintingRoot); | 811 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), LayoutSiz
e(), paintingRoot); |
| 813 paintLayer(context, paintingInfo, PaintContent); | 812 paintLayer(context, paintingInfo, PaintContent); |
| 814 } | 813 } |
| 815 | 814 |
| 816 void RenderLayer::paintOverlayScrollbars(GraphicsContext* context, const LayoutR
ect& damageRect, RenderObject* paintingRoot) | |
| 817 { | |
| 818 if (!m_containsDirtyOverlayScrollbars) | |
| 819 return; | |
| 820 | |
| 821 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), LayoutSiz
e(), paintingRoot); | |
| 822 paintLayer(context, paintingInfo, PaintOverlayScrollbars); | |
| 823 | |
| 824 m_containsDirtyOverlayScrollbars = false; | |
| 825 } | |
| 826 | |
| 827 static bool inContainingBlockChain(RenderLayer* startLayer, RenderLayer* endLaye
r) | 815 static bool inContainingBlockChain(RenderLayer* startLayer, RenderLayer* endLaye
r) |
| 828 { | 816 { |
| 829 if (startLayer == endLayer) | 817 if (startLayer == endLayer) |
| 830 return true; | 818 return true; |
| 831 | 819 |
| 832 RenderView* view = startLayer->renderer()->view(); | 820 RenderView* view = startLayer->renderer()->view(); |
| 833 for (RenderBlock* currentBlock = startLayer->renderer()->containingBlock();
currentBlock && currentBlock != view; currentBlock = currentBlock->containingBlo
ck()) { | 821 for (RenderBlock* currentBlock = startLayer->renderer()->containingBlock();
currentBlock && currentBlock != view; currentBlock = currentBlock->containingBlo
ck()) { |
| 834 if (currentBlock->layer() == endLayer) | 822 if (currentBlock->layer() == endLayer) |
| 835 return true; | 823 return true; |
| 836 } | 824 } |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 FilterEffectRendererHelper filterPainter(filterRenderer() && paintsWithFilte
rs()); | 952 FilterEffectRendererHelper filterPainter(filterRenderer() && paintsWithFilte
rs()); |
| 965 | 953 |
| 966 LayoutRect layerBounds; | 954 LayoutRect layerBounds; |
| 967 // FIXME(sky): Remove foregroundRect. It's unused. | 955 // FIXME(sky): Remove foregroundRect. It's unused. |
| 968 ClipRect backgroundRect, foregroundRect, outlineRect; | 956 ClipRect backgroundRect, foregroundRect, outlineRect; |
| 969 ClipRectsContext clipRectsContext(localPaintingInfo.rootLayer, PaintingClipR
ects, localPaintingInfo.subPixelAccumulation); | 957 ClipRectsContext clipRectsContext(localPaintingInfo.rootLayer, PaintingClipR
ects, localPaintingInfo.subPixelAccumulation); |
| 970 clipper().calculateRects(clipRectsContext, localPaintingInfo.paintDirtyRect, | 958 clipper().calculateRects(clipRectsContext, localPaintingInfo.paintDirtyRect, |
| 971 layerBounds, backgroundRect, foregroundRect, outlineRect, | 959 layerBounds, backgroundRect, foregroundRect, outlineRect, |
| 972 &offsetFromRoot); | 960 &offsetFromRoot); |
| 973 | 961 |
| 974 bool isPaintingOverlayScrollbars = paintFlags == PaintOverlayScrollbars; | 962 bool shouldPaintContent = isSelfPaintingLayer() && intersectsDamageRect(laye
rBounds, backgroundRect.rect(), localPaintingInfo.rootLayer, &offsetFromRoot); |
| 975 bool shouldPaintContent = isSelfPaintingLayer() && !isPaintingOverlayScrollb
ars | |
| 976 && intersectsDamageRect(layerBounds, backgroundRect.rect(), localPaintin
gInfo.rootLayer, &offsetFromRoot); | |
| 977 | 963 |
| 978 bool haveTransparency = isTransparent(); | 964 bool haveTransparency = isTransparent(); |
| 979 | 965 |
| 980 if (filterPainter.haveFilterEffect()) { | 966 if (filterPainter.haveFilterEffect()) { |
| 981 ASSERT(this->filterInfo()); | 967 ASSERT(this->filterInfo()); |
| 982 | 968 |
| 983 if (!rootRelativeBoundsComputed) | 969 if (!rootRelativeBoundsComputed) |
| 984 rootRelativeBounds = physicalBoundingBoxIncludingReflectionAndStacki
ngChildren(paintingInfo.rootLayer, offsetFromRoot); | 970 rootRelativeBounds = physicalBoundingBoxIncludingReflectionAndStacki
ngChildren(paintingInfo.rootLayer, offsetFromRoot); |
| 985 | 971 |
| 986 if (filterPainter.prepareFilterEffect(this, rootRelativeBounds, painting
Info.paintDirtyRect)) { | 972 if (filterPainter.prepareFilterEffect(this, rootRelativeBounds, painting
Info.paintDirtyRect)) { |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1797 } | 1783 } |
| 1798 } | 1784 } |
| 1799 | 1785 |
| 1800 void showLayerTree(const blink::RenderObject* renderer) | 1786 void showLayerTree(const blink::RenderObject* renderer) |
| 1801 { | 1787 { |
| 1802 if (!renderer) | 1788 if (!renderer) |
| 1803 return; | 1789 return; |
| 1804 showLayerTree(renderer->enclosingLayer()); | 1790 showLayerTree(renderer->enclosingLayer()); |
| 1805 } | 1791 } |
| 1806 #endif | 1792 #endif |
| OLD | NEW |