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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 | 256 |
257 RenderLayer* enclosingFilterLayer(IncludeSelfOrNot = IncludeSelf) const; | 257 RenderLayer* enclosingFilterLayer(IncludeSelfOrNot = IncludeSelf) const; |
258 bool hasAncestorWithFilterOutsets() const; | 258 bool hasAncestorWithFilterOutsets() const; |
259 | 259 |
260 bool canUseConvertToLayerCoords() const | 260 bool canUseConvertToLayerCoords() const |
261 { | 261 { |
262 // These RenderObjects have an impact on their layers without the render
ers knowing about it. | 262 // These RenderObjects have an impact on their layers without the render
ers knowing about it. |
263 return !renderer()->hasColumns() && !renderer()->hasTransform() && !rend
erer()->isSVGRoot(); | 263 return !renderer()->hasColumns() && !renderer()->hasTransform() && !rend
erer()->isSVGRoot(); |
264 } | 264 } |
265 | 265 |
266 void convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntP
oint& location) const; | |
267 void convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntR
ect&) const; | |
268 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint& loc
ation) const; | 266 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint& loc
ation) const; |
269 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&) con
st; | 267 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&) con
st; |
270 | 268 |
271 // The two main functions that use the layer system. The paint method | 269 // The two main functions that use the layer system. The paint method |
272 // paints the layers that intersect the damage rect from back to | 270 // paints the layers that intersect the damage rect from back to |
273 // front. The hitTest method looks for mouse events by walking | 271 // front. The hitTest method looks for mouse events by walking |
274 // layers that intersect the point from front to back. | 272 // layers that intersect the point from front to back. |
275 void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = P
aintBehaviorNormal, RenderObject* paintingRoot = 0, PaintLayerFlags = 0); | 273 void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = P
aintBehaviorNormal, RenderObject* paintingRoot = 0, PaintLayerFlags = 0); |
276 bool hitTest(const HitTestRequest&, HitTestResult&); | 274 bool hitTest(const HitTestRequest&, HitTestResult&); |
277 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); | 275 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); |
(...skipping 12 matching lines...) Expand all Loading... |
290 // If true, this layer's children are included in its bounds for overlap tes
ting. | 288 // If true, this layer's children are included in its bounds for overlap tes
ting. |
291 // We can't rely on the children's positions if this layer has a filter that
could have moved the children's pixels around. | 289 // We can't rely on the children's positions if this layer has a filter that
could have moved the children's pixels around. |
292 bool overlapBoundsIncludeChildren() const { return hasFilter() && renderer()
->style()->filter().hasFilterThatMovesPixels(); } | 290 bool overlapBoundsIncludeChildren() const { return hasFilter() && renderer()
->style()->filter().hasFilterThatMovesPixels(); } |
293 | 291 |
294 enum CalculateBoundsOptions { | 292 enum CalculateBoundsOptions { |
295 ApplyBoundsChickenEggHacks, | 293 ApplyBoundsChickenEggHacks, |
296 DoNotApplyBoundsChickenEggHacks, | 294 DoNotApplyBoundsChickenEggHacks, |
297 }; | 295 }; |
298 LayoutRect boundingBoxForCompositing(const RenderLayer* ancestorLayer = 0, C
alculateBoundsOptions = DoNotApplyBoundsChickenEggHacks) const; | 296 LayoutRect boundingBoxForCompositing(const RenderLayer* ancestorLayer = 0, C
alculateBoundsOptions = DoNotApplyBoundsChickenEggHacks) const; |
299 | 297 |
300 // WARNING: This method returns the offset for the parent as this is what up
dateLayerPositions expects. | |
301 LayoutPoint computeOffsetFromRoot(bool& hasLayerOffset) const; | |
302 | |
303 LayoutUnit staticInlinePosition() const { return m_staticInlinePosition; } | 298 LayoutUnit staticInlinePosition() const { return m_staticInlinePosition; } |
304 LayoutUnit staticBlockPosition() const { return m_staticBlockPosition; } | 299 LayoutUnit staticBlockPosition() const { return m_staticBlockPosition; } |
305 | 300 |
306 void setStaticInlinePosition(LayoutUnit position) { m_staticInlinePosition =
position; } | 301 void setStaticInlinePosition(LayoutUnit position) { m_staticInlinePosition =
position; } |
307 void setStaticBlockPosition(LayoutUnit position) { m_staticBlockPosition = p
osition; } | 302 void setStaticBlockPosition(LayoutUnit position) { m_staticBlockPosition = p
osition; } |
308 | 303 |
309 LayoutSize subpixelAccumulation() const; | 304 LayoutSize subpixelAccumulation() const; |
310 void setSubpixelAccumulation(const LayoutSize&); | 305 void setSubpixelAccumulation(const LayoutSize&); |
311 | 306 |
312 bool hasTransform() const { return renderer()->hasTransform(); } | 307 bool hasTransform() const { return renderer()->hasTransform(); } |
(...skipping 24 matching lines...) Expand all Loading... |
337 void* operator new(size_t); | 332 void* operator new(size_t); |
338 // Only safe to call from RenderLayerModelObject::destroyLayer() | 333 // Only safe to call from RenderLayerModelObject::destroyLayer() |
339 void operator delete(void*); | 334 void operator delete(void*); |
340 | 335 |
341 CompositingState compositingState() const; | 336 CompositingState compositingState() const; |
342 | 337 |
343 // This returns true if our document is in a phase of its lifestyle during w
hich | 338 // This returns true if our document is in a phase of its lifestyle during w
hich |
344 // compositing state may legally be read. | 339 // compositing state may legally be read. |
345 bool isAllowedToQueryCompositingState() const; | 340 bool isAllowedToQueryCompositingState() const; |
346 | 341 |
347 // This returns true if our current phase is the compositing update. | |
348 bool isInCompositingUpdate() const; | |
349 | |
350 CompositedLayerMappingPtr compositedLayerMapping() const; | 342 CompositedLayerMappingPtr compositedLayerMapping() const; |
351 CompositedLayerMappingPtr ensureCompositedLayerMapping(); | 343 CompositedLayerMappingPtr ensureCompositedLayerMapping(); |
352 | 344 |
353 // NOTE: If you are using hasCompositedLayerMapping to determine the state o
f compositing for this layer, | 345 // NOTE: If you are using hasCompositedLayerMapping to determine the state o
f compositing for this layer, |
354 // (and not just to do bookkeeping related to the mapping like, say, allocat
ing or deallocating a mapping), | 346 // (and not just to do bookkeeping related to the mapping like, say, allocat
ing or deallocating a mapping), |
355 // then you may have incorrect logic. Use compositingState() instead. | 347 // then you may have incorrect logic. Use compositingState() instead. |
356 bool hasCompositedLayerMapping() const { return m_compositedLayerMapping.get
(); } | 348 bool hasCompositedLayerMapping() const { return m_compositedLayerMapping.get
(); } |
357 void clearCompositedLayerMapping(bool layerBeingDestroyed = false); | 349 void clearCompositedLayerMapping(bool layerBeingDestroyed = false); |
358 | 350 |
359 CompositedLayerMapping* groupedMapping() const { return m_groupedMapping; } | 351 CompositedLayerMapping* groupedMapping() const { return m_groupedMapping; } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 } | 397 } |
406 | 398 |
407 bool hasFilterInfo() const { return m_hasFilterInfo; } | 399 bool hasFilterInfo() const { return m_hasFilterInfo; } |
408 void setHasFilterInfo(bool hasFilterInfo) { m_hasFilterInfo = hasFilterInfo;
} | 400 void setHasFilterInfo(bool hasFilterInfo) { m_hasFilterInfo = hasFilterInfo;
} |
409 | 401 |
410 void updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle)
; | 402 void updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle)
; |
411 | 403 |
412 Node* enclosingElement() const; | 404 Node* enclosingElement() const; |
413 | 405 |
414 bool isInTopLayer() const; | 406 bool isInTopLayer() const; |
415 bool isInTopLayerSubtree() const; | |
416 | 407 |
417 enum ViewportConstrainedNotCompositedReason { | 408 enum ViewportConstrainedNotCompositedReason { |
418 NoNotCompositedReason = 0, | 409 NoNotCompositedReason = 0, |
419 NotCompositedForBoundsOutOfView, | 410 NotCompositedForBoundsOutOfView, |
420 NotCompositedForNonViewContainer, | 411 NotCompositedForNonViewContainer, |
421 NotCompositedForNoVisibleContent, | 412 NotCompositedForNoVisibleContent, |
422 NotCompositedForUnscrollableAncestors, | 413 NotCompositedForUnscrollableAncestors, |
423 NumNotCompositedReasons, | 414 NumNotCompositedReasons, |
424 | 415 |
425 // This is the number of bits used to store the viewport constrained not
composited | 416 // This is the number of bits used to store the viewport constrained not
composited |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 | 767 |
777 } // namespace WebCore | 768 } // namespace WebCore |
778 | 769 |
779 #ifndef NDEBUG | 770 #ifndef NDEBUG |
780 // Outside the WebCore namespace for ease of invocation from gdb. | 771 // Outside the WebCore namespace for ease of invocation from gdb. |
781 void showLayerTree(const WebCore::RenderLayer*); | 772 void showLayerTree(const WebCore::RenderLayer*); |
782 void showLayerTree(const WebCore::RenderObject*); | 773 void showLayerTree(const WebCore::RenderObject*); |
783 #endif | 774 #endif |
784 | 775 |
785 #endif // RenderLayer_h | 776 #endif // RenderLayer_h |
OLD | NEW |