Chromium Code Reviews| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 const DeprecatedPaintLayerReflectionInfo* reflectionInfo() const { return m_ reflectionInfo.get(); } | 135 const DeprecatedPaintLayerReflectionInfo* reflectionInfo() const { return m_ reflectionInfo.get(); } |
| 136 | 136 |
| 137 const DeprecatedPaintLayer* root() const | 137 const DeprecatedPaintLayer* root() const |
| 138 { | 138 { |
| 139 const DeprecatedPaintLayer* curr = this; | 139 const DeprecatedPaintLayer* curr = this; |
| 140 while (curr->parent()) | 140 while (curr->parent()) |
| 141 curr = curr->parent(); | 141 curr = curr->parent(); |
| 142 return curr; | 142 return curr; |
| 143 } | 143 } |
| 144 | 144 |
| 145 const LayoutPoint& location() const { ASSERT(!m_needsPositionUpdate); return m_location; } | 145 enum LocationQueryBehavior { |
| 146 IncludeScroll, | |
| 147 ExcludeScroll | |
| 148 }; | |
| 149 LayoutPoint location(LocationQueryBehavior behavior = IncludeScroll) const { ASSERT(!m_needsPositionUpdate); return behavior == IncludeScroll ? m_location : locationExcludeOverflowScroll(); } | |
|
pdr.
2015/09/03 06:16:59
With SPV2, won't all location(...)/convertToLayerC
trchen
2015/09/04 06:10:14
Better, we can exclude scroll offset in the beginn
| |
| 150 // Note: This function is only needed during the transition period to SPv2. | |
| 151 // Once we have eliminated layer-based hit testing and clipping, | |
| 152 // we can cache the unscrolled location instead. | |
| 153 LayoutPoint locationExcludeOverflowScroll() const; | |
| 146 // FIXME: size() should ASSERT(!m_needsPositionUpdate) as well, but that fai ls in some tests, | 154 // FIXME: size() should ASSERT(!m_needsPositionUpdate) as well, but that fai ls in some tests, |
| 147 // for example, fast/repaint/clipped-relative.html. | 155 // for example, fast/repaint/clipped-relative.html. |
| 148 const IntSize& size() const { return m_size; } | 156 const IntSize& size() const { return m_size; } |
| 149 void setSizeHackForLayoutTreeAsText(const IntSize& size) { m_size = size; } | 157 void setSizeHackForLayoutTreeAsText(const IntSize& size) { m_size = size; } |
| 150 | 158 |
| 151 LayoutRect rect() const { return LayoutRect(location(), LayoutSize(size())); } | 159 LayoutRect rect() const { return LayoutRect(location(), LayoutSize(size())); } |
| 152 | 160 |
| 153 bool isRootLayer() const { return m_isRootLayer; } | 161 bool isRootLayer() const { return m_isRootLayer; } |
| 154 | 162 |
| 155 DeprecatedPaintLayerCompositor* compositor() const; | 163 DeprecatedPaintLayerCompositor* compositor() const; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 DeprecatedPaintLayer* enclosingLayerForPaintInvalidationCrossingFrameBoundar ies() const; | 228 DeprecatedPaintLayer* enclosingLayerForPaintInvalidationCrossingFrameBoundar ies() const; |
| 221 | 229 |
| 222 bool hasAncestorWithFilterOutsets() const; | 230 bool hasAncestorWithFilterOutsets() const; |
| 223 | 231 |
| 224 bool canUseConvertToLayerCoords() const | 232 bool canUseConvertToLayerCoords() const |
| 225 { | 233 { |
| 226 // These LayoutObjects have an impact on their layers without the layout Objects knowing about it. | 234 // These LayoutObjects have an impact on their layers without the layout Objects knowing about it. |
| 227 return !layoutObject()->hasTransformRelatedProperty() && !layoutObject() ->isSVGRoot(); | 235 return !layoutObject()->hasTransformRelatedProperty() && !layoutObject() ->isSVGRoot(); |
| 228 } | 236 } |
| 229 | 237 |
| 230 void convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutP oint&) const; | 238 void convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutP oint&, LocationQueryBehavior = IncludeScroll) const; |
| 231 void convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutR ect&) const; | 239 void convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutR ect&) const; |
| 232 | 240 |
| 233 // Does the same as convertToLayerCoords() when not in multicol. For multico l, however, | 241 // Does the same as convertToLayerCoords() when not in multicol. For multico l, however, |
| 234 // convertToLayerCoords() calculates the offset in flow-thread coordinates ( what the layout | 242 // convertToLayerCoords() calculates the offset in flow-thread coordinates ( what the layout |
| 235 // engine uses internally), while this method calculates the visual coordina tes; i.e. it figures | 243 // engine uses internally), while this method calculates the visual coordina tes; i.e. it figures |
| 236 // out which column the layer starts in and adds in the offset. See | 244 // out which column the layer starts in and adds in the offset. See |
| 237 // http://www.chromium.org/developers/design-documents/multi-column-layout f or more info. | 245 // http://www.chromium.org/developers/design-documents/multi-column-layout f or more info. |
| 238 LayoutPoint visualOffsetFromAncestor(const DeprecatedPaintLayer* ancestorLay er) const; | 246 LayoutPoint visualOffsetFromAncestor(const DeprecatedPaintLayer* ancestorLay er) const; |
| 239 | 247 |
| 240 // The hitTest() method looks for mouse events by walking layers that inters ect the point from front to back. | 248 // The hitTest() method looks for mouse events by walking layers that inters ect the point from front to back. |
| 241 bool hitTest(HitTestResult&); | 249 bool hitTest(HitTestResult&); |
| 242 | 250 |
| 243 // Pass offsetFromRoot if known. | 251 // Pass offsetFromRoot if known. |
| 244 bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& d amageRect, const DeprecatedPaintLayer* rootLayer, const LayoutPoint* offsetFromR oot = 0) const; | 252 bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& d amageRect, const DeprecatedPaintLayer* rootLayer, const LayoutPoint* offsetFromR oot = 0) const; |
| 245 | 253 |
| 246 // Bounding box relative to some ancestor layer. Pass offsetFromRoot if know n. | 254 // Bounding box relative to some ancestor layer. Pass offsetFromRoot if know n. |
| 247 LayoutRect physicalBoundingBox(const DeprecatedPaintLayer* ancestorLayer, co nst LayoutPoint* offsetFromRoot = 0) const; | 255 LayoutRect physicalBoundingBox(const DeprecatedPaintLayer* ancestorLayer, co nst LayoutPoint* offsetFromRoot = 0) const; |
| 248 LayoutRect physicalBoundingBoxIncludingReflectionAndStackingChildren(const D eprecatedPaintLayer* ancestorLayer, const LayoutPoint& offsetFromRoot) const; | 256 LayoutRect physicalBoundingBoxIncludingReflectionAndStackingChildren(const L ayoutPoint& offsetFromRoot) const; |
|
pdr.
2015/09/03 06:16:59
Lets pull the physicalBoundingBoxIncludingReflecti
trchen
2015/09/04 06:10:14
Good point! Done.
| |
| 249 LayoutRect fragmentsBoundingBox(const DeprecatedPaintLayer* ancestorLayer) c onst; | 257 LayoutRect fragmentsBoundingBox(const DeprecatedPaintLayer* ancestorLayer) c onst; |
| 250 | 258 |
| 251 LayoutRect boundingBoxForCompositingOverlapTest() const; | 259 LayoutRect boundingBoxForCompositingOverlapTest() const; |
| 252 | 260 |
| 253 // If true, this layer's children are included in its bounds for overlap tes ting. | 261 // If true, this layer's children are included in its bounds for overlap tes ting. |
| 254 // We can't rely on the children's positions if this layer has a filter that could have moved the children's pixels around. | 262 // We can't rely on the children's positions if this layer has a filter that could have moved the children's pixels around. |
| 255 bool overlapBoundsIncludeChildren() const { return hasFilter() && layoutObje ct()->style()->filter().hasFilterThatMovesPixels(); } | 263 bool overlapBoundsIncludeChildren() const { return hasFilter() && layoutObje ct()->style()->filter().hasFilterThatMovesPixels(); } |
| 256 | 264 |
| 257 // MaybeIncludeTransformForAncestorLayer means that a transform on |ancestor Layer| may be applied to the bounding box, | 265 // MaybeIncludeTransformForAncestorLayer means that a transform on |ancestor Layer| may be applied to the bounding box, |
| 258 // in particular if paintsWithTransform() is true. | 266 // in particular if paintsWithTransform() is true. |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 737 | 745 |
| 738 } // namespace blink | 746 } // namespace blink |
| 739 | 747 |
| 740 #ifndef NDEBUG | 748 #ifndef NDEBUG |
| 741 // Outside the WebCore namespace for ease of invocation from gdb. | 749 // Outside the WebCore namespace for ease of invocation from gdb. |
| 742 void showLayerTree(const blink::DeprecatedPaintLayer*); | 750 void showLayerTree(const blink::DeprecatedPaintLayer*); |
| 743 void showLayerTree(const blink::LayoutObject*); | 751 void showLayerTree(const blink::LayoutObject*); |
| 744 #endif | 752 #endif |
| 745 | 753 |
| 746 #endif // Layer_h | 754 #endif // Layer_h |
| OLD | NEW |