| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 UpdatePagination = 1 << 4 | 164 UpdatePagination = 1 << 4 |
| 165 }; | 165 }; |
| 166 typedef unsigned UpdateLayerPositionsFlags; | 166 typedef unsigned UpdateLayerPositionsFlags; |
| 167 static const UpdateLayerPositionsFlags defaultFlags = CheckForRepaint | IsCo
mpositingUpdateRoot | UpdateCompositingLayers; | 167 static const UpdateLayerPositionsFlags defaultFlags = CheckForRepaint | IsCo
mpositingUpdateRoot | UpdateCompositingLayers; |
| 168 | 168 |
| 169 void updateLayerPositionsAfterLayout(const RenderLayer* rootLayer, UpdateLay
erPositionsFlags); | 169 void updateLayerPositionsAfterLayout(const RenderLayer* rootLayer, UpdateLay
erPositionsFlags); |
| 170 | 170 |
| 171 void updateLayerPositionsAfterOverflowScroll(); | 171 void updateLayerPositionsAfterOverflowScroll(); |
| 172 void updateLayerPositionsAfterDocumentScroll(); | 172 void updateLayerPositionsAfterDocumentScroll(); |
| 173 | 173 |
| 174 bool isPaginated() const { return m_isPaginated; } | |
| 175 RenderLayer* enclosingPaginationLayer() const { return m_enclosingPagination
Layer; } | 174 RenderLayer* enclosingPaginationLayer() const { return m_enclosingPagination
Layer; } |
| 176 | 175 |
| 177 void updateTransform(); | 176 void updateTransform(); |
| 178 | 177 |
| 179 const LayoutSize& offsetForInFlowPosition() const { return m_offsetForInFlow
Position; } | 178 const LayoutSize& offsetForInFlowPosition() const { return m_offsetForInFlow
Position; } |
| 180 | 179 |
| 181 void addBlockSelectionGapsBounds(const LayoutRect&); | 180 void addBlockSelectionGapsBounds(const LayoutRect&); |
| 182 void clearBlockSelectionGapsBounds(); | 181 void clearBlockSelectionGapsBounds(); |
| 183 void repaintBlockSelectionGaps(); | 182 void repaintBlockSelectionGaps(); |
| 184 bool hasBlockSelectionGapBounds() const; | 183 bool hasBlockSelectionGapBounds() const; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 // Ancestor scrolling layer at or above our containing block. | 238 // Ancestor scrolling layer at or above our containing block. |
| 240 RenderLayer* ancestorScrollingLayer() const; | 239 RenderLayer* ancestorScrollingLayer() const; |
| 241 | 240 |
| 242 RenderLayer* enclosingFilterLayer(IncludeSelfOrNot = IncludeSelf) const; | 241 RenderLayer* enclosingFilterLayer(IncludeSelfOrNot = IncludeSelf) const; |
| 243 RenderLayer* enclosingFilterRepaintLayer() const; | 242 RenderLayer* enclosingFilterRepaintLayer() const; |
| 244 bool hasAncestorWithFilterOutsets() const; | 243 bool hasAncestorWithFilterOutsets() const; |
| 245 | 244 |
| 246 bool canUseConvertToLayerCoords() const | 245 bool canUseConvertToLayerCoords() const |
| 247 { | 246 { |
| 248 // These RenderObjects have an impact on their layers without the render
ers knowing about it. | 247 // These RenderObjects have an impact on their layers without the render
ers knowing about it. |
| 249 return !renderer()->hasColumns() && !renderer()->hasTransform() && !rend
erer()->isSVGRoot(); | 248 return !renderer()->hasTransform() && !renderer()->isSVGRoot(); |
| 250 } | 249 } |
| 251 | 250 |
| 252 void convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntP
oint& location) const; | 251 void convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntP
oint& location) const; |
| 253 void convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntR
ect&) const; | 252 void convertToPixelSnappedLayerCoords(const RenderLayer* ancestorLayer, IntR
ect&) const; |
| 254 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint& loc
ation) const; | 253 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint& loc
ation) const; |
| 255 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&) con
st; | 254 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&) con
st; |
| 256 | 255 |
| 257 // The two main functions that use the layer system. The paint method | 256 // The two main functions that use the layer system. The paint method |
| 258 // paints the layers that intersect the damage rect from back to | 257 // paints the layers that intersect the damage rect from back to |
| 259 // front. The hitTest method looks for mouse events by walking | 258 // front. The hitTest method looks for mouse events by walking |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 void setParent(RenderLayer* parent); | 485 void setParent(RenderLayer* parent); |
| 487 void setFirstChild(RenderLayer* first) { m_first = first; } | 486 void setFirstChild(RenderLayer* first) { m_first = first; } |
| 488 void setLastChild(RenderLayer* last) { m_last = last; } | 487 void setLastChild(RenderLayer* last) { m_last = last; } |
| 489 | 488 |
| 490 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende
rBox(renderer())->location() : LayoutPoint(); } | 489 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende
rBox(renderer())->location() : LayoutPoint(); } |
| 491 | 490 |
| 492 void paintLayerContentsAndReflection(GraphicsContext*, const LayerPaintingIn
fo&, PaintLayerFlags); | 491 void paintLayerContentsAndReflection(GraphicsContext*, const LayerPaintingIn
fo&, PaintLayerFlags); |
| 493 void paintLayerByApplyingTransform(GraphicsContext*, const LayerPaintingInfo
&, PaintLayerFlags, const LayoutPoint& translationOffset = LayoutPoint()); | 492 void paintLayerByApplyingTransform(GraphicsContext*, const LayerPaintingInfo
&, PaintLayerFlags, const LayoutPoint& translationOffset = LayoutPoint()); |
| 494 void paintLayerContents(GraphicsContext*, const LayerPaintingInfo&, PaintLay
erFlags); | 493 void paintLayerContents(GraphicsContext*, const LayerPaintingInfo&, PaintLay
erFlags); |
| 495 void paintChildren(unsigned childrenToVisit, GraphicsContext*, const LayerPa
intingInfo&, PaintLayerFlags); | 494 void paintChildren(unsigned childrenToVisit, GraphicsContext*, const LayerPa
intingInfo&, PaintLayerFlags); |
| 496 void paintPaginatedChildLayer(RenderLayer* childLayer, GraphicsContext*, con
st LayerPaintingInfo&, PaintLayerFlags); | |
| 497 void paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsContext*, c
onst LayerPaintingInfo&, PaintLayerFlags, const Vector<RenderLayer*>& columnLaye
rs, size_t columnIndex); | |
| 498 | 495 |
| 499 void collectFragments(LayerFragments&, const RenderLayer* rootLayer, RenderR
egion*, const LayoutRect& dirtyRect, | 496 void collectFragments(LayerFragments&, const RenderLayer* rootLayer, RenderR
egion*, const LayoutRect& dirtyRect, |
| 500 ClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelev
ancy = IgnoreOverlayScrollbarSize, | 497 ClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelev
ancy = IgnoreOverlayScrollbarSize, |
| 501 ShouldRespectOverflowClip = RespectOverflowClip, const LayoutPoint* offs
etFromRoot = 0, | 498 ShouldRespectOverflowClip = RespectOverflowClip, const LayoutPoint* offs
etFromRoot = 0, |
| 502 const LayoutSize& subPixelAccumulation = LayoutSize(), const LayoutRect*
layerBoundingBox = 0); | 499 const LayoutSize& subPixelAccumulation = LayoutSize(), const LayoutRect*
layerBoundingBox = 0); |
| 503 void updatePaintingInfoForFragments(LayerFragments&, const LayerPaintingInfo
&, PaintLayerFlags, bool shouldPaintContent, const LayoutPoint* offsetFromRoot); | 500 void updatePaintingInfoForFragments(LayerFragments&, const LayerPaintingInfo
&, PaintLayerFlags, bool shouldPaintContent, const LayoutPoint* offsetFromRoot); |
| 504 void paintBackgroundForFragments(const LayerFragments&, GraphicsContext*, Gr
aphicsContext* transparencyLayerContext, | 501 void paintBackgroundForFragments(const LayerFragments&, GraphicsContext*, Gr
aphicsContext* transparencyLayerContext, |
| 505 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con
st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); | 502 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con
st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); |
| 506 void paintForegroundForFragments(const LayerFragments&, GraphicsContext*, Gr
aphicsContext* transparencyLayerContext, | 503 void paintForegroundForFragments(const LayerFragments&, GraphicsContext*, Gr
aphicsContext* transparencyLayerContext, |
| 507 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con
st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer, | 504 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con
st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer, |
| 508 bool selectionOnly, bool forceBlackText); | 505 bool selectionOnly, bool forceBlackText); |
| 509 void paintForegroundForFragmentsWithPhase(PaintPhase, const LayerFragments&,
GraphicsContext*, const LayerPaintingInfo&, PaintBehavior, RenderObject* painti
ngRootForRenderer); | 506 void paintForegroundForFragmentsWithPhase(PaintPhase, const LayerFragments&,
GraphicsContext*, const LayerPaintingInfo&, PaintBehavior, RenderObject* painti
ngRootForRenderer); |
| 510 void paintOutlineForFragments(const LayerFragments&, GraphicsContext*, const
LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); | 507 void paintOutlineForFragments(const LayerFragments&, GraphicsContext*, const
LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); |
| 511 void paintOverflowControlsForFragments(const LayerFragments&, GraphicsContex
t*, const LayerPaintingInfo&); | 508 void paintOverflowControlsForFragments(const LayerFragments&, GraphicsContex
t*, const LayerPaintingInfo&); |
| 512 void paintMaskForFragments(const LayerFragments&, GraphicsContext*, const La
yerPaintingInfo&, RenderObject* paintingRootForRenderer); | 509 void paintMaskForFragments(const LayerFragments&, GraphicsContext*, const La
yerPaintingInfo&, RenderObject* paintingRootForRenderer); |
| 513 void paintChildClippingMaskForFragments(const LayerFragments&, GraphicsConte
xt*, const LayerPaintingInfo&, RenderObject* paintingRootForRenderer); | 510 void paintChildClippingMaskForFragments(const LayerFragments&, GraphicsConte
xt*, const LayerPaintingInfo&, RenderObject* paintingRootForRenderer); |
| 514 void paintTransformedLayerIntoFragments(GraphicsContext*, const LayerPaintin
gInfo&, PaintLayerFlags); | 511 void paintTransformedLayerIntoFragments(GraphicsContext*, const LayerPaintin
gInfo&, PaintLayerFlags); |
| 515 | 512 |
| 516 RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLaye
r, const HitTestRequest& request, HitTestResult& result, | 513 RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLaye
r, const HitTestRequest& request, HitTestResult& result, |
| 517 const LayoutRect& hitTestRect, const HitTestLocati
on&, bool appliedTransform, | 514 const LayoutRect& hitTestRect, const HitTestLocati
on&, bool appliedTransform, |
| 518 const HitTestingTransformState* transformState = 0
, double* zOffset = 0); | 515 const HitTestingTransformState* transformState = 0
, double* zOffset = 0); |
| 519 RenderLayer* hitTestLayerByApplyingTransform(RenderLayer* rootLayer, RenderL
ayer* containerLayer, const HitTestRequest&, HitTestResult&, | 516 RenderLayer* hitTestLayerByApplyingTransform(RenderLayer* rootLayer, RenderL
ayer* containerLayer, const HitTestRequest&, HitTestResult&, |
| 520 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0, | 517 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0, |
| 521 const LayoutPoint& translationOffset = LayoutPoint()); | 518 const LayoutPoint& translationOffset = LayoutPoint()); |
| 522 RenderLayer* hitTestChildren(ChildrenIteration, RenderLayer* rootLayer, cons
t HitTestRequest&, HitTestResult&, | 519 RenderLayer* hitTestChildren(ChildrenIteration, RenderLayer* rootLayer, cons
t HitTestRequest&, HitTestResult&, |
| 523 const LayoutRect& hitTestRect, const HitTestLocatio
n&, | 520 const LayoutRect& hitTestRect, const HitTestLocatio
n&, |
| 524 const HitTestingTransformState* transformState, dou
ble* zOffsetForDescendants, double* zOffset, | 521 const HitTestingTransformState* transformState, dou
ble* zOffsetForDescendants, double* zOffset, |
| 525 const HitTestingTransformState* unflattenedTransfor
mState, bool depthSortDescendants); | 522 const HitTestingTransformState* unflattenedTransfor
mState, bool depthSortDescendants); |
| 526 RenderLayer* hitTestPaginatedChildLayer(RenderLayer* childLayer, RenderLayer
* rootLayer, const HitTestRequest& request, HitTestResult& result, | |
| 527 const LayoutRect& hitTestRect, const
HitTestLocation&, | |
| 528 const HitTestingTransformState* tran
sformState, double* zOffset); | |
| 529 RenderLayer* hitTestChildLayerColumns(RenderLayer* childLayer, RenderLayer*
rootLayer, const HitTestRequest& request, HitTestResult& result, | |
| 530 const LayoutRect& hitTestRect, const H
itTestLocation&, | |
| 531 const HitTestingTransformState* transf
ormState, double* zOffset, | |
| 532 const Vector<RenderLayer*>& columnLaye
rs, size_t columnIndex); | |
| 533 | 523 |
| 534 PassRefPtr<HitTestingTransformState> createLocalTransformState(RenderLayer*
rootLayer, RenderLayer* containerLayer, | 524 PassRefPtr<HitTestingTransformState> createLocalTransformState(RenderLayer*
rootLayer, RenderLayer* containerLayer, |
| 535 const LayoutRect& hitTestRect, const HitTestLocation
&, | 525 const LayoutRect& hitTestRect, const HitTestLocation
&, |
| 536 const HitTestingTransformState* containerTransformSt
ate, | 526 const HitTestingTransformState* containerTransformSt
ate, |
| 537 const LayoutPoint& translationOffset = LayoutPoint()
) const; | 527 const LayoutPoint& translationOffset = LayoutPoint()
) const; |
| 538 | 528 |
| 539 bool hitTestContents(const HitTestRequest&, HitTestResult&, const LayoutRect
& layerBounds, const HitTestLocation&, HitTestFilter) const; | 529 bool hitTestContents(const HitTestRequest&, HitTestResult&, const LayoutRect
& layerBounds, const HitTestLocation&, HitTestFilter) const; |
| 540 bool hitTestContentsForFragments(const LayerFragments&, const HitTestRequest
&, HitTestResult&, const HitTestLocation&, HitTestFilter, bool& insideClipRect)
const; | 530 bool hitTestContentsForFragments(const LayerFragments&, const HitTestRequest
&, HitTestResult&, const HitTestLocation&, HitTestFilter, bool& insideClipRect)
const; |
| 541 RenderLayer* hitTestTransformedLayerInFragments(RenderLayer* rootLayer, Rend
erLayer* containerLayer, const HitTestRequest&, HitTestResult&, | 531 RenderLayer* hitTestTransformedLayerInFragments(RenderLayer* rootLayer, Rend
erLayer* containerLayer, const HitTestRequest&, HitTestResult&, |
| 542 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0); | 532 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 // we ended up painting this layer or any desce
ndants (and therefore need to | 616 // we ended up painting this layer or any desce
ndants (and therefore need to |
| 627 // blend). | 617 // blend). |
| 628 | 618 |
| 629 unsigned m_visibleContentStatusDirty : 1; | 619 unsigned m_visibleContentStatusDirty : 1; |
| 630 unsigned m_hasVisibleContent : 1; | 620 unsigned m_hasVisibleContent : 1; |
| 631 unsigned m_visibleDescendantStatusDirty : 1; | 621 unsigned m_visibleDescendantStatusDirty : 1; |
| 632 unsigned m_hasVisibleDescendant : 1; | 622 unsigned m_hasVisibleDescendant : 1; |
| 633 | 623 |
| 634 unsigned m_hasVisibleNonLayerContent : 1; | 624 unsigned m_hasVisibleNonLayerContent : 1; |
| 635 | 625 |
| 636 unsigned m_isPaginated : 1; // If we think this layer is split by a multi-co
lumn ancestor, then this bit will be set. | |
| 637 | |
| 638 unsigned m_3DTransformedDescendantStatusDirty : 1; | 626 unsigned m_3DTransformedDescendantStatusDirty : 1; |
| 639 // Set on a stacking context layer that has 3D descendants anywhere | 627 // Set on a stacking context layer that has 3D descendants anywhere |
| 640 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. | 628 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. |
| 641 unsigned m_has3DTransformedDescendant : 1; | 629 unsigned m_has3DTransformedDescendant : 1; |
| 642 | 630 |
| 643 unsigned m_containsDirtyOverlayScrollbars : 1; | 631 unsigned m_containsDirtyOverlayScrollbars : 1; |
| 644 | 632 |
| 645 // This is an optimization added for <table>. | 633 // This is an optimization added for <table>. |
| 646 // Currently cells do not need to update their repaint rectangles when scrol
ling. This also | 634 // Currently cells do not need to update their repaint rectangles when scrol
ling. This also |
| 647 // saves a lot of time when scrolling on a table. | 635 // saves a lot of time when scrolling on a table. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 | 718 |
| 731 } // namespace WebCore | 719 } // namespace WebCore |
| 732 | 720 |
| 733 #ifndef NDEBUG | 721 #ifndef NDEBUG |
| 734 // Outside the WebCore namespace for ease of invocation from gdb. | 722 // Outside the WebCore namespace for ease of invocation from gdb. |
| 735 void showLayerTree(const WebCore::RenderLayer*); | 723 void showLayerTree(const WebCore::RenderLayer*); |
| 736 void showLayerTree(const WebCore::RenderObject*); | 724 void showLayerTree(const WebCore::RenderObject*); |
| 737 #endif | 725 #endif |
| 738 | 726 |
| 739 #endif // RenderLayer_h | 727 #endif // RenderLayer_h |
| OLD | NEW |