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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 #include "core/rendering/RenderLayerRepainter.h" | 55 #include "core/rendering/RenderLayerRepainter.h" |
56 #include "core/rendering/RenderLayerScrollableArea.h" | 56 #include "core/rendering/RenderLayerScrollableArea.h" |
57 #include "core/rendering/RenderLayerStackingNode.h" | 57 #include "core/rendering/RenderLayerStackingNode.h" |
58 | 58 |
59 #include "wtf/OwnPtr.h" | 59 #include "wtf/OwnPtr.h" |
60 | 60 |
61 #include "core/rendering/RenderLayerFilterInfo.h" | 61 #include "core/rendering/RenderLayerFilterInfo.h" |
62 | 62 |
63 namespace WebCore { | 63 namespace WebCore { |
64 | 64 |
| 65 struct ClipperContext; |
| 66 class CompositedLayerMapping; |
65 class FilterEffectRenderer; | 67 class FilterEffectRenderer; |
66 class FilterOperations; | 68 class FilterOperations; |
67 class HitTestRequest; | 69 class HitTestRequest; |
68 class HitTestResult; | 70 class HitTestResult; |
69 class HitTestingTransformState; | 71 class HitTestingTransformState; |
70 class PlatformEvent; | 72 class PlatformEvent; |
71 class RenderFlowThread; | 73 class RenderFlowThread; |
72 class RenderGeometryMap; | 74 class RenderGeometryMap; |
73 class CompositedLayerMapping; | |
74 class RenderLayerCompositor; | 75 class RenderLayerCompositor; |
75 class RenderReplica; | 76 class RenderReplica; |
76 class RenderScrollbarPart; | 77 class RenderScrollbarPart; |
77 class RenderStyle; | 78 class RenderStyle; |
| 79 class RenderSVGResourceClipper; |
78 class RenderView; | 80 class RenderView; |
79 class Scrollbar; | 81 class Scrollbar; |
80 class TransformationMatrix; | 82 class TransformationMatrix; |
81 | 83 |
82 enum BorderRadiusClippingRule { IncludeSelfForBorderRadius, DoNotIncludeSelfForB
orderRadius }; | 84 enum BorderRadiusClippingRule { IncludeSelfForBorderRadius, DoNotIncludeSelfForB
orderRadius }; |
83 | 85 |
84 class RenderLayer { | 86 class RenderLayer { |
85 public: | 87 public: |
86 friend class RenderReplica; | 88 friend class RenderReplica; |
87 // FIXME: Needed until we move all the necessary bits to the new class. | 89 // FIXME: Needed until we move all the necessary bits to the new class. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // FIXME: We should ASSERT(!m_hasSelfPaintingLayerDescendantDirty); here but
we hit the same bugs as visible content above. | 202 // FIXME: We should ASSERT(!m_hasSelfPaintingLayerDescendantDirty); here but
we hit the same bugs as visible content above. |
201 // Part of the issue is with subtree relayout: we don't check if our ancesto
rs have some descendant flags dirty, missing some updates. | 203 // Part of the issue is with subtree relayout: we don't check if our ancesto
rs have some descendant flags dirty, missing some updates. |
202 bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerD
escendant; } | 204 bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerD
escendant; } |
203 | 205 |
204 // FIXME: We should ASSERT(!m_hasOutOfFlowPositionedDescendantDirty) here. S
ee above. | 206 // FIXME: We should ASSERT(!m_hasOutOfFlowPositionedDescendantDirty) here. S
ee above. |
205 bool hasOutOfFlowPositionedDescendant() const { return m_hasOutOfFlowPositio
nedDescendant; } | 207 bool hasOutOfFlowPositionedDescendant() const { return m_hasOutOfFlowPositio
nedDescendant; } |
206 | 208 |
207 void setHasOutOfFlowPositionedDescendant(bool hasDescendant) { m_hasOutOfFlo
wPositionedDescendant = hasDescendant; } | 209 void setHasOutOfFlowPositionedDescendant(bool hasDescendant) { m_hasOutOfFlo
wPositionedDescendant = hasDescendant; } |
208 void setHasOutOfFlowPositionedDescendantDirty(bool dirty) { m_hasOutOfFlowPo
sitionedDescendantDirty = dirty; } | 210 void setHasOutOfFlowPositionedDescendantDirty(bool dirty) { m_hasOutOfFlowPo
sitionedDescendantDirty = dirty; } |
209 | 211 |
| 212 void setHasComplexClippedAncestor(bool hasAncestor) { m_hasComplexClippedAnc
estor = hasAncestor; } |
| 213 bool hasComplexClippedAncestor() const { return m_hasComplexClippedAncestor;
} |
| 214 |
210 bool childLayerHasBlendMode() const { ASSERT(!m_childLayerHasBlendModeStatus
Dirty); return m_childLayerHasBlendMode; } | 215 bool childLayerHasBlendMode() const { ASSERT(!m_childLayerHasBlendModeStatus
Dirty); return m_childLayerHasBlendMode; } |
211 | 216 |
212 bool hasUnclippedDescendant() const { return m_hasUnclippedDescendant; } | 217 bool hasUnclippedDescendant() const { return m_hasUnclippedDescendant; } |
213 void setHasUnclippedDescendant(bool hasDescendant) { m_hasUnclippedDescendan
t = hasDescendant; } | 218 void setHasUnclippedDescendant(bool hasDescendant) { m_hasUnclippedDescendan
t = hasDescendant; } |
214 void updateHasUnclippedDescendant(); | 219 void updateHasUnclippedDescendant(); |
215 bool isUnclippedDescendant() const { return m_isUnclippedDescendant; } | 220 bool isUnclippedDescendant() const { return m_isUnclippedDescendant; } |
216 | 221 |
217 bool hasVisibleNonLayerContent() const { return m_hasVisibleNonLayerContent;
} | 222 bool hasVisibleNonLayerContent() const { return m_hasVisibleNonLayerContent;
} |
218 void updateHasVisibleNonLayerContent(); | 223 void updateHasVisibleNonLayerContent(); |
219 | 224 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 // FIXME: This is a temporary flag and should be removed once accelerated | 464 // FIXME: This is a temporary flag and should be removed once accelerated |
460 // overflow scroll is ready (crbug.com/254111). | 465 // overflow scroll is ready (crbug.com/254111). |
461 bool compositorDrivenAcceleratedScrollingEnabled() const; | 466 bool compositorDrivenAcceleratedScrollingEnabled() const; |
462 | 467 |
463 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect&
paintDirtyRect, const ClipRect&, | 468 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect&
paintDirtyRect, const ClipRect&, |
464 BorderRadiusClippingRule = IncludeSelfForBorderRadius); | 469 BorderRadiusClippingRule = IncludeSelfForBorderRadius); |
465 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); | 470 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); |
466 | 471 |
467 void updateSelfPaintingLayer(); | 472 void updateSelfPaintingLayer(); |
468 void updateVisibilityAfterStyleChange(const RenderStyle* oldStyle); | 473 void updateVisibilityAfterStyleChange(const RenderStyle* oldStyle); |
| 474 void updateHasComplexClippedAncestor(); |
469 | 475 |
470 void updateOutOfFlowPositioned(const RenderStyle* oldStyle); | 476 void updateOutOfFlowPositioned(const RenderStyle* oldStyle); |
471 | 477 |
472 void didUpdateNeedsCompositedScrolling(); | 478 void didUpdateNeedsCompositedScrolling(); |
473 | 479 |
474 // Returns true if the position changed. | 480 // Returns true if the position changed. |
475 bool updateLayerPosition(); | 481 bool updateLayerPosition(); |
476 | 482 |
477 void updateLayerPositions(RenderGeometryMap* = 0, UpdateLayerPositionsFlags
= defaultFlags); | 483 void updateLayerPositions(RenderGeometryMap* = 0, UpdateLayerPositionsFlags
= defaultFlags); |
478 | 484 |
(...skipping 30 matching lines...) Expand all Loading... |
509 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con
st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); | 515 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con
st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); |
510 void paintForegroundForFragments(const LayerFragments&, GraphicsContext*, Gr
aphicsContext* transparencyLayerContext, | 516 void paintForegroundForFragments(const LayerFragments&, GraphicsContext*, Gr
aphicsContext* transparencyLayerContext, |
511 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con
st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer, | 517 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con
st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer, |
512 bool selectionOnly, bool forceBlackText); | 518 bool selectionOnly, bool forceBlackText); |
513 void paintForegroundForFragmentsWithPhase(PaintPhase, const LayerFragments&,
GraphicsContext*, const LayerPaintingInfo&, PaintBehavior, RenderObject* painti
ngRootForRenderer); | 519 void paintForegroundForFragmentsWithPhase(PaintPhase, const LayerFragments&,
GraphicsContext*, const LayerPaintingInfo&, PaintBehavior, RenderObject* painti
ngRootForRenderer); |
514 void paintOutlineForFragments(const LayerFragments&, GraphicsContext*, const
LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); | 520 void paintOutlineForFragments(const LayerFragments&, GraphicsContext*, const
LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer); |
515 void paintOverflowControlsForFragments(const LayerFragments&, GraphicsContex
t*, const LayerPaintingInfo&); | 521 void paintOverflowControlsForFragments(const LayerFragments&, GraphicsContex
t*, const LayerPaintingInfo&); |
516 void paintMaskForFragments(const LayerFragments&, GraphicsContext*, const La
yerPaintingInfo&, RenderObject* paintingRootForRenderer); | 522 void paintMaskForFragments(const LayerFragments&, GraphicsContext*, const La
yerPaintingInfo&, RenderObject* paintingRootForRenderer); |
517 void paintChildClippingMaskForFragments(const LayerFragments&, GraphicsConte
xt*, const LayerPaintingInfo&, RenderObject* paintingRootForRenderer); | 523 void paintChildClippingMaskForFragments(const LayerFragments&, GraphicsConte
xt*, const LayerPaintingInfo&, RenderObject* paintingRootForRenderer); |
518 void paintTransformedLayerIntoFragments(GraphicsContext*, const LayerPaintin
gInfo&, PaintLayerFlags); | 524 void paintTransformedLayerIntoFragments(GraphicsContext*, const LayerPaintin
gInfo&, PaintLayerFlags); |
| 525 void applyComplexClip(GraphicsContext*, RenderLayer*, ClipperContext*, const
LayerPaintingInfo&, const LayoutPoint& offsetFromRoot, bool* needsContextRestor
e, bool* rootRelativeBoundsComputed, IntRect* rootRelativeBounds, Vector<RenderS
VGResourceClipper*>*); |
519 | 526 |
520 RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLaye
r, const HitTestRequest& request, HitTestResult& result, | 527 RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLaye
r, const HitTestRequest& request, HitTestResult& result, |
521 const LayoutRect& hitTestRect, const HitTestLocati
on&, bool appliedTransform, | 528 const LayoutRect& hitTestRect, const HitTestLocati
on&, bool appliedTransform, |
522 const HitTestingTransformState* transformState = 0
, double* zOffset = 0); | 529 const HitTestingTransformState* transformState = 0
, double* zOffset = 0); |
523 RenderLayer* hitTestLayerByApplyingTransform(RenderLayer* rootLayer, RenderL
ayer* containerLayer, const HitTestRequest&, HitTestResult&, | 530 RenderLayer* hitTestLayerByApplyingTransform(RenderLayer* rootLayer, RenderL
ayer* containerLayer, const HitTestRequest&, HitTestResult&, |
524 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0, | 531 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0, |
525 const LayoutPoint& translationOffset = LayoutPoint()); | 532 const LayoutPoint& translationOffset = LayoutPoint()); |
526 RenderLayer* hitTestList(Vector<RenderLayerStackingNode*>*, RenderLayer* roo
tLayer, const HitTestRequest&, HitTestResult&, | 533 RenderLayer* hitTestList(Vector<RenderLayerStackingNode*>*, RenderLayer* roo
tLayer, const HitTestRequest&, HitTestResult&, |
527 const LayoutRect& hitTestRect, const HitTestLocatio
n&, | 534 const LayoutRect& hitTestRect, const HitTestLocatio
n&, |
528 const HitTestingTransformState* transformState, dou
ble* zOffsetForDescendants, double* zOffset, | 535 const HitTestingTransformState* transformState, dou
ble* zOffsetForDescendants, double* zOffset, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 unsigned m_hasOutOfFlowPositionedDescendantDirty : 1; | 628 unsigned m_hasOutOfFlowPositionedDescendantDirty : 1; |
622 | 629 |
623 // This is true if we have an out-of-flow positioned descendant whose | 630 // This is true if we have an out-of-flow positioned descendant whose |
624 // containing block is our ancestor. If this is the case, the descendant | 631 // containing block is our ancestor. If this is the case, the descendant |
625 // may fall outside of our clip preventing things like opting into | 632 // may fall outside of our clip preventing things like opting into |
626 // composited scrolling (which causes clipping of all descendants). | 633 // composited scrolling (which causes clipping of all descendants). |
627 unsigned m_hasUnclippedDescendant : 1; | 634 unsigned m_hasUnclippedDescendant : 1; |
628 | 635 |
629 unsigned m_isUnclippedDescendant : 1; | 636 unsigned m_isUnclippedDescendant : 1; |
630 | 637 |
| 638 unsigned m_hasComplexClippedAncestor : 1; |
| 639 |
631 const unsigned m_isRootLayer : 1; | 640 const unsigned m_isRootLayer : 1; |
632 | 641 |
633 unsigned m_usedTransparency : 1; // Tracks whether we need to close a transp
arent layer, i.e., whether | 642 unsigned m_usedTransparency : 1; // Tracks whether we need to close a transp
arent layer, i.e., whether |
634 // we ended up painting this layer or any desce
ndants (and therefore need to | 643 // we ended up painting this layer or any desce
ndants (and therefore need to |
635 // blend). | 644 // blend). |
636 | 645 |
637 unsigned m_childLayerHasBlendMode : 1; | 646 unsigned m_childLayerHasBlendMode : 1; |
638 unsigned m_childLayerHasBlendModeStatusDirty : 1; | 647 unsigned m_childLayerHasBlendModeStatusDirty : 1; |
639 | 648 |
640 unsigned m_visibleContentStatusDirty : 1; | 649 unsigned m_visibleContentStatusDirty : 1; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 | 744 |
736 } // namespace WebCore | 745 } // namespace WebCore |
737 | 746 |
738 #ifndef NDEBUG | 747 #ifndef NDEBUG |
739 // Outside the WebCore namespace for ease of invocation from gdb. | 748 // Outside the WebCore namespace for ease of invocation from gdb. |
740 void showLayerTree(const WebCore::RenderLayer*); | 749 void showLayerTree(const WebCore::RenderLayer*); |
741 void showLayerTree(const WebCore::RenderObject*); | 750 void showLayerTree(const WebCore::RenderObject*); |
742 #endif | 751 #endif |
743 | 752 |
744 #endif // RenderLayer_h | 753 #endif // RenderLayer_h |
OLD | NEW |