| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 RenderLayer* enclosingOverflowClipLayer(IncludeSelfOrNot = IncludeSelf) cons
t; | 143 RenderLayer* enclosingOverflowClipLayer(IncludeSelfOrNot = IncludeSelf) cons
t; |
| 144 | 144 |
| 145 const RenderLayer* compositingContainer() const; | 145 const RenderLayer* compositingContainer() const; |
| 146 RenderLayer* enclosingFilterLayer(IncludeSelfOrNot = IncludeSelf) const; | 146 RenderLayer* enclosingFilterLayer(IncludeSelfOrNot = IncludeSelf) const; |
| 147 bool hasAncestorWithFilterOutsets() const; | 147 bool hasAncestorWithFilterOutsets() const; |
| 148 | 148 |
| 149 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint&) co
nst; | 149 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint&) co
nst; |
| 150 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&) con
st; | 150 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&) con
st; |
| 151 | 151 |
| 152 // The hitTest method looks for mouse events by walking | |
| 153 // layers that intersect the point from front to back. | |
| 154 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); | |
| 155 | |
| 156 // Pass offsetFromRoot if known. | 152 // Pass offsetFromRoot if known. |
| 157 bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& d
amageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromRoot = 0)
const; | 153 bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& d
amageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromRoot = 0)
const; |
| 158 | 154 |
| 159 // Bounding box relative to some ancestor layer. Pass offsetFromRoot if know
n. | 155 // Bounding box relative to some ancestor layer. Pass offsetFromRoot if know
n. |
| 160 LayoutRect physicalBoundingBox(const RenderLayer* ancestorLayer, const Layou
tPoint* offsetFromRoot = 0) const; | 156 LayoutRect physicalBoundingBox(const RenderLayer* ancestorLayer, const Layou
tPoint* offsetFromRoot = 0) const; |
| 161 LayoutRect physicalBoundingBoxIncludingReflectionAndStackingChildren(const R
enderLayer* ancestorLayer, const LayoutPoint& offsetFromRoot) const; | 157 LayoutRect physicalBoundingBoxIncludingReflectionAndStackingChildren(const R
enderLayer* ancestorLayer, const LayoutPoint& offsetFromRoot) const; |
| 162 | 158 |
| 163 // If true, this layer's children are included in its bounds for overlap tes
ting. | 159 // If true, this layer's children are included in its bounds for overlap tes
ting. |
| 164 // We can't rely on the children's positions if this layer has a filter that
could have moved the children's pixels around. | 160 // We can't rely on the children's positions if this layer has a filter that
could have moved the children's pixels around. |
| 165 bool overlapBoundsIncludeChildren() const { return hasFilter() && renderer()
->style()->filter().hasFilterThatMovesPixels(); } | 161 bool overlapBoundsIncludeChildren() const { return hasFilter() && renderer()
->style()->filter().hasFilterThatMovesPixels(); } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 RenderLayerModelObject* layerRenderer = renderer(); | 232 RenderLayerModelObject* layerRenderer = renderer(); |
| 237 return isRootLayer() || layerRenderer->isPositioned() || hasTransform(); | 233 return isRootLayer() || layerRenderer->isPositioned() || hasTransform(); |
| 238 } | 234 } |
| 239 | 235 |
| 240 void updateOrRemoveFilterEffectRenderer(); | 236 void updateOrRemoveFilterEffectRenderer(); |
| 241 void updateSelfPaintingLayer(); | 237 void updateSelfPaintingLayer(); |
| 242 | 238 |
| 243 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&,
BorderRadiusClippingRule = IncludeSelfForBorderRadius); | 239 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&,
BorderRadiusClippingRule = IncludeSelfForBorderRadius); |
| 244 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); | 240 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); |
| 245 | 241 |
| 242 RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLaye
r, const HitTestRequest& request, HitTestResult& result, |
| 243 const LayoutRect& hitTestRect, const HitTestLocati
on&, |
| 244 const HitTestingTransformState* transformState = 0
, double* zOffset = 0); |
| 245 |
| 246 private: | 246 private: |
| 247 // TODO(ojan): Get rid of this. These are basically layer-tree-only paint ph
ases. | 247 // TODO(ojan): Get rid of this. These are basically layer-tree-only paint ph
ases. |
| 248 enum PaintLayerFlags { | 248 enum PaintLayerFlags { |
| 249 PaintContent, | 249 PaintContent, |
| 250 }; | 250 }; |
| 251 | 251 |
| 252 // Bounding box in the coordinates of this layer. | 252 // Bounding box in the coordinates of this layer. |
| 253 LayoutRect logicalBoundingBox() const; | 253 LayoutRect logicalBoundingBox() const; |
| 254 | 254 |
| 255 void setAncestorChainHasSelfPaintingLayerDescendant(); | 255 void setAncestorChainHasSelfPaintingLayerDescendant(); |
| 256 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | 256 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
| 257 | 257 |
| 258 void setNextSibling(RenderLayer* next) { m_next = next; } | 258 void setNextSibling(RenderLayer* next) { m_next = next; } |
| 259 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } | 259 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } |
| 260 void setFirstChild(RenderLayer* first) { m_first = first; } | 260 void setFirstChild(RenderLayer* first) { m_first = first; } |
| 261 void setLastChild(RenderLayer* last) { m_last = last; } | 261 void setLastChild(RenderLayer* last) { m_last = last; } |
| 262 | 262 |
| 263 void updateHasSelfPaintingLayerDescendant() const; | 263 void updateHasSelfPaintingLayerDescendant() const; |
| 264 | 264 |
| 265 bool hasSelfPaintingLayerDescendant() const | 265 bool hasSelfPaintingLayerDescendant() const |
| 266 { | 266 { |
| 267 if (m_hasSelfPaintingLayerDescendantDirty) | 267 if (m_hasSelfPaintingLayerDescendantDirty) |
| 268 updateHasSelfPaintingLayerDescendant(); | 268 updateHasSelfPaintingLayerDescendant(); |
| 269 ASSERT(!m_hasSelfPaintingLayerDescendantDirty); | 269 ASSERT(!m_hasSelfPaintingLayerDescendantDirty); |
| 270 return m_hasSelfPaintingLayerDescendant; | 270 return m_hasSelfPaintingLayerDescendant; |
| 271 } | 271 } |
| 272 | 272 |
| 273 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende
rBox(renderer())->location() : LayoutPoint(); } | 273 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende
rBox(renderer())->location() : LayoutPoint(); } |
| 274 | 274 |
| 275 RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLaye
r, const HitTestRequest& request, HitTestResult& result, | |
| 276 const LayoutRect& hitTestRect, const HitTestLocati
on&, | |
| 277 const HitTestingTransformState* transformState = 0
, double* zOffset = 0); | |
| 278 RenderLayer* hitTestChildren(ChildrenIteration, RenderLayer* rootLayer, cons
t HitTestRequest&, HitTestResult&, | 275 RenderLayer* hitTestChildren(ChildrenIteration, RenderLayer* rootLayer, cons
t HitTestRequest&, HitTestResult&, |
| 279 const LayoutRect& hitTestRect, const HitTestLocatio
n&, | 276 const LayoutRect& hitTestRect, const HitTestLocatio
n&, |
| 280 const HitTestingTransformState* transformState, dou
ble* zOffsetForDescendants, double* zOffset, | 277 const HitTestingTransformState* transformState, dou
ble* zOffsetForDescendants, double* zOffset, |
| 281 const HitTestingTransformState* unflattenedTransfor
mState, bool depthSortDescendants); | 278 const HitTestingTransformState* unflattenedTransfor
mState, bool depthSortDescendants); |
| 282 | 279 |
| 283 PassRefPtr<HitTestingTransformState> createLocalTransformState(RenderLayer*
rootLayer, RenderLayer* containerLayer, | 280 PassRefPtr<HitTestingTransformState> createLocalTransformState(RenderLayer*
rootLayer, RenderLayer* containerLayer, |
| 284 const LayoutRect& hitTestRect, const HitTestLocation
&, | 281 const LayoutRect& hitTestRect, const HitTestLocation
&, |
| 285 const HitTestingTransformState* containerTransformSt
ate, | 282 const HitTestingTransformState* containerTransformSt
ate, |
| 286 const LayoutPoint& translationOffset = LayoutPoint()
) const; | 283 const LayoutPoint& translationOffset = LayoutPoint()
) const; |
| 287 | 284 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 347 |
| 351 } // namespace blink | 348 } // namespace blink |
| 352 | 349 |
| 353 #ifndef NDEBUG | 350 #ifndef NDEBUG |
| 354 // Outside the WebCore namespace for ease of invocation from gdb. | 351 // Outside the WebCore namespace for ease of invocation from gdb. |
| 355 void showLayerTree(const blink::RenderLayer*); | 352 void showLayerTree(const blink::RenderLayer*); |
| 356 void showLayerTree(const blink::RenderObject*); | 353 void showLayerTree(const blink::RenderObject*); |
| 357 #endif | 354 #endif |
| 358 | 355 |
| 359 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ | 356 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ |
| OLD | NEW |