| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * Other contributors: | 7 * Other contributors: |
| 8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 PaintLayer* firstChild() const { return m_first; } | 222 PaintLayer* firstChild() const { return m_first; } |
| 223 PaintLayer* lastChild() const { return m_last; } | 223 PaintLayer* lastChild() const { return m_last; } |
| 224 | 224 |
| 225 // TODO(wangxianzhu): Find a better name for it. 'paintContainer' might be g
ood but | 225 // TODO(wangxianzhu): Find a better name for it. 'paintContainer' might be g
ood but |
| 226 // we can't use it for now because it conflicts with PaintInfo::paintContain
er. | 226 // we can't use it for now because it conflicts with PaintInfo::paintContain
er. |
| 227 PaintLayer* compositingContainer() const; | 227 PaintLayer* compositingContainer() const; |
| 228 | 228 |
| 229 void addChild(PaintLayer* newChild, PaintLayer* beforeChild = 0); | 229 void addChild(PaintLayer* newChild, PaintLayer* beforeChild = 0); |
| 230 PaintLayer* removeChild(PaintLayer*); | 230 PaintLayer* removeChild(PaintLayer*); |
| 231 | 231 |
| 232 void removeOnlyThisLayer(); | 232 void removeOnlyThisLayerAfterStyleChange(); |
| 233 void insertOnlyThisLayer(); | 233 void insertOnlyThisLayerAfterStyleChange(); |
| 234 | 234 |
| 235 void styleChanged(StyleDifference, const ComputedStyle* oldStyle); | 235 void styleChanged(StyleDifference, const ComputedStyle* oldStyle); |
| 236 | 236 |
| 237 // FIXME: Many people call this function while it has out-of-date informatio
n. | 237 // FIXME: Many people call this function while it has out-of-date informatio
n. |
| 238 bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; } | 238 bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; } |
| 239 | 239 |
| 240 void setLayerType(PaintLayerType layerType) { m_layerType = layerType; ASSER
T(static_cast<PaintLayerType>(m_layerType) == layerType); } | 240 void setLayerType(PaintLayerType layerType) { m_layerType = layerType; ASSER
T(static_cast<PaintLayerType>(m_layerType) == layerType); } |
| 241 | 241 |
| 242 bool isTransparent() const { return layoutObject()->isTransparent() || layou
tObject()->style()->hasBlendMode() || layoutObject()->hasMask(); } | 242 bool isTransparent() const { return layoutObject()->isTransparent() || layou
tObject()->style()->hasBlendMode() || layoutObject()->hasMask(); } |
| 243 | 243 |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 void setPreviousPaintingClipRects(ClipRects& clipRects) { m_previousPainting
ClipRects = &clipRects; } | 663 void setPreviousPaintingClipRects(ClipRects& clipRects) { m_previousPainting
ClipRects = &clipRects; } |
| 664 | 664 |
| 665 LayoutRect previousPaintDirtyRect() const { return m_previousPaintDirtyRect;
} | 665 LayoutRect previousPaintDirtyRect() const { return m_previousPaintDirtyRect;
} |
| 666 void setPreviousPaintDirtyRect(const LayoutRect& rect) { m_previousPaintDirt
yRect = rect; } | 666 void setPreviousPaintDirtyRect(const LayoutRect& rect) { m_previousPaintDirt
yRect = rect; } |
| 667 | 667 |
| 668 PaintLayerPainter::PaintResult previousPaintResult() const { return static_c
ast<PaintLayerPainter::PaintResult>(m_previousPaintResult); } | 668 PaintLayerPainter::PaintResult previousPaintResult() const { return static_c
ast<PaintLayerPainter::PaintResult>(m_previousPaintResult); } |
| 669 void setPreviousPaintResult(PaintLayerPainter::PaintResult result) { m_previ
ousPaintResult = static_cast<unsigned>(result); ASSERT(m_previousPaintResult ==
static_cast<unsigned>(result)); } | 669 void setPreviousPaintResult(PaintLayerPainter::PaintResult result) { m_previ
ousPaintResult = static_cast<unsigned>(result); ASSERT(m_previousPaintResult ==
static_cast<unsigned>(result)); } |
| 670 | 670 |
| 671 // Used to skip PaintPhaseDescendantOutlinesOnly for layers that have never
had descendant outlines. | 671 // Used to skip PaintPhaseDescendantOutlinesOnly for layers that have never
had descendant outlines. |
| 672 // Once it's set we never clear it because it's not easy to track if all out
lines have been removed. | 672 // Once it's set we never clear it because it's not easy to track if all out
lines have been removed. |
| 673 // For more details, see core/paint/REAME.md#Empty paint phase optimization. |
| 673 bool needsPaintPhaseDescendantOutlines() const { return m_needsPaintPhaseDes
cendantOutlines; } | 674 bool needsPaintPhaseDescendantOutlines() const { return m_needsPaintPhaseDes
cendantOutlines; } |
| 674 void setNeedsPaintPhaseDescendantOutlines() { ASSERT(isSelfPaintingLayer());
m_needsPaintPhaseDescendantOutlines = true; } | 675 void setNeedsPaintPhaseDescendantOutlines() { ASSERT(isSelfPaintingLayer());
m_needsPaintPhaseDescendantOutlines = true; } |
| 675 | 676 |
| 676 // Similar to above, but for PaintPhaseFloat. | 677 // Similar to above, but for PaintPhaseFloat. |
| 677 bool needsPaintPhaseFloat() const { return m_needsPaintPhaseFloat; } | 678 bool needsPaintPhaseFloat() const { return m_needsPaintPhaseFloat; } |
| 678 void setNeedsPaintPhaseFloat() { ASSERT(isSelfPaintingLayer()); m_needsPaint
PhaseFloat = true; } | 679 void setNeedsPaintPhaseFloat() { ASSERT(isSelfPaintingLayer()); m_needsPaint
PhaseFloat = true; } |
| 679 | 680 |
| 680 bool needsPaintPhaseDescendantBlockBackgrounds() const { return m_needsPaint
PhaseDescendantBlockBackgrounds; } | 681 bool needsPaintPhaseDescendantBlockBackgrounds() const { return m_needsPaint
PhaseDescendantBlockBackgrounds; } |
| 681 void setNeedsPaintPhaseDescendantBlockBackgrounds() { ASSERT(isSelfPaintingL
ayer()); m_needsPaintPhaseDescendantBlockBackgrounds = true; } | 682 void setNeedsPaintPhaseDescendantBlockBackgrounds() { ASSERT(isSelfPaintingL
ayer()); m_needsPaintPhaseDescendantBlockBackgrounds = true; } |
| 682 | 683 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 | 766 |
| 766 void markCompositingContainerChainForNeedsRepaint(); | 767 void markCompositingContainerChainForNeedsRepaint(); |
| 767 | 768 |
| 768 PaintLayerRareData& ensureRareData() | 769 PaintLayerRareData& ensureRareData() |
| 769 { | 770 { |
| 770 if (!m_rareData) | 771 if (!m_rareData) |
| 771 m_rareData = adoptPtr(new PaintLayerRareData); | 772 m_rareData = adoptPtr(new PaintLayerRareData); |
| 772 return *m_rareData; | 773 return *m_rareData; |
| 773 } | 774 } |
| 774 | 775 |
| 776 void mergeNeedsPaintPhaseFlagsFrom(const PaintLayer& layer) |
| 777 { |
| 778 m_needsPaintPhaseDescendantOutlines |= layer.m_needsPaintPhaseDescendant
Outlines; |
| 779 m_needsPaintPhaseFloat |= layer.m_needsPaintPhaseFloat; |
| 780 m_needsPaintPhaseDescendantBlockBackgrounds |= layer.m_needsPaintPhaseDe
scendantBlockBackgrounds; |
| 781 } |
| 782 |
| 775 unsigned m_layerType : 2; // PaintLayerType | 783 unsigned m_layerType : 2; // PaintLayerType |
| 776 | 784 |
| 777 // Self-painting layer is an optimization where we avoid the heavy Layer pai
nting | 785 // Self-painting layer is an optimization where we avoid the heavy Layer pai
nting |
| 778 // machinery for a Layer allocated only to handle the overflow clip case. | 786 // machinery for a Layer allocated only to handle the overflow clip case. |
| 779 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. | 787 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. |
| 780 unsigned m_isSelfPaintingLayer : 1; | 788 unsigned m_isSelfPaintingLayer : 1; |
| 781 | 789 |
| 782 // If have no self-painting descendants, we don't have to walk our children
during painting. This can lead to | 790 // If have no self-painting descendants, we don't have to walk our children
during painting. This can lead to |
| 783 // significant savings, especially if the tree has lots of non-self-painting
layers grouped together (e.g. table cells). | 791 // significant savings, especially if the tree has lots of non-self-painting
layers grouped together (e.g. table cells). |
| 784 mutable unsigned m_hasSelfPaintingLayerDescendant : 1; | 792 mutable unsigned m_hasSelfPaintingLayerDescendant : 1; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 | 882 |
| 875 } // namespace blink | 883 } // namespace blink |
| 876 | 884 |
| 877 #ifndef NDEBUG | 885 #ifndef NDEBUG |
| 878 // Outside the WebCore namespace for ease of invocation from gdb. | 886 // Outside the WebCore namespace for ease of invocation from gdb. |
| 879 void showLayerTree(const blink::PaintLayer*); | 887 void showLayerTree(const blink::PaintLayer*); |
| 880 void showLayerTree(const blink::LayoutObject*); | 888 void showLayerTree(const blink::LayoutObject*); |
| 881 #endif | 889 #endif |
| 882 | 890 |
| 883 #endif // Layer_h | 891 #endif // Layer_h |
| OLD | NEW |