| Index: third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
|
| index 3cc8cc1208933e5c5ff79ece7e85c47243cfdc71..437b5da1aa9519cc9ebf85d81a7d4af4219d4fab 100644
|
| --- a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
|
| @@ -111,29 +111,12 @@ static void updateAuxiliaryObjectProperties(const LayoutObject& object,
|
| context.ancestorOverflowPaintLayer = paintLayer;
|
| }
|
|
|
| -// Returns whether |a| is an ancestor of or equal to |b|.
|
| -static bool isAncestorOfOrEqualTo(const ClipPaintPropertyNode* a,
|
| - const ClipPaintPropertyNode* b) {
|
| - while (b && b != a) {
|
| - b = b->parent();
|
| - }
|
| - return b == a;
|
| -}
|
| -
|
| void PrePaintTreeWalk::computeClipRectForContext(
|
| const PaintPropertyTreeBuilderContext::ContainingBlockContext& context,
|
| const EffectPaintPropertyNode* effect,
|
| const PropertyTreeState& ancestorState,
|
| const LayoutPoint& ancestorPaintOffset,
|
| - bool& hasClip,
|
| FloatClipRect& clipRect) {
|
| - // Only return a non-infinite clip if clips differ, or the "ancestor" state is
|
| - // actually an ancestor clip. This ensures no accuracy issues due to
|
| - // transforms applied to infinite rects.
|
| - if (isAncestorOfOrEqualTo(context.clip, ancestorState.clip()))
|
| - clipRect = FloatClipRect();
|
| -
|
| - hasClip = true;
|
| PropertyTreeState localState(context.transform, context.clip, effect);
|
|
|
| clipRect =
|
| @@ -178,7 +161,6 @@ void PrePaintTreeWalk::invalidatePaintLayerOptimizationsIfNeeded(
|
| respectOverflowClip, LayoutSize());
|
| #endif
|
|
|
| - bool hasClip = false;
|
| RefPtr<ClipRects> clipRects = ClipRects::create();
|
| const LayoutPoint& ancestorPaintOffset =
|
| context.ancestorTransformedOrRootPaintLayer->layoutObject().paintOffset();
|
| @@ -187,30 +169,27 @@ void PrePaintTreeWalk::invalidatePaintLayerOptimizationsIfNeeded(
|
| const EffectPaintPropertyNode* effect =
|
| context.treeBuilderContext->currentEffect;
|
| computeClipRectForContext(context.treeBuilderContext->current, effect,
|
| - ancestorState, ancestorPaintOffset, hasClip,
|
| - clipRect);
|
| + ancestorState, ancestorPaintOffset, clipRect);
|
| clipRects->setOverflowClipRect(clipRect);
|
| #ifdef CHECK_CLIP_RECTS
|
| - CHECK(!hasClip ||
|
| - clipRects->overflowClipRect() == oldClipRects.overflowClipRect())
|
| + CHECK(clipRects->overflowClipRect() == oldClipRects.overflowClipRect())
|
| << "rect= " << clipRects->overflowClipRect().toString();
|
| #endif
|
|
|
| computeClipRectForContext(context.treeBuilderContext->fixedPosition, effect,
|
| - ancestorState, ancestorPaintOffset, hasClip,
|
| - clipRect);
|
| + ancestorState, ancestorPaintOffset, clipRect);
|
| clipRects->setFixedClipRect(clipRect);
|
| #ifdef CHECK_CLIP_RECTS
|
| - CHECK(hasClip || clipRects->fixedClipRect() == oldClipRects.fixedClipRect())
|
| + CHECK(clipRects->fixedClipRect() == oldClipRects.fixedClipRect())
|
| << " fixed=" << clipRects->fixedClipRect().toString();
|
| #endif
|
|
|
| computeClipRectForContext(context.treeBuilderContext->absolutePosition,
|
| - effect, ancestorState, ancestorPaintOffset, hasClip,
|
| + effect, ancestorState, ancestorPaintOffset,
|
| clipRect);
|
| clipRects->setPosClipRect(clipRect);
|
| #ifdef CHECK_CLIP_RECTS
|
| - CHECK(!hasClip || clipRects->posClipRect() == oldClipRects.posClipRect())
|
| + CHECK(clipRects->posClipRect() == oldClipRects.posClipRect())
|
| << " abs=" << clipRects->posClipRect().toString();
|
| #endif
|
|
|
|
|