| Index: third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
|
| index b8b71d4fb8e797175369a82539f15252e8294057..fa65bb692d88b92e87a6e22d4c8ee1ce08e778dc 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
|
| @@ -160,8 +160,8 @@ ClipRects& PaintLayerClipper::storeClipRectsInCache(
|
|
|
| ClipRects& PaintLayerClipper::getClipRects(
|
| const ClipRectsContext& context) const {
|
| - if (ClipRects* result = clipRectsIfCached(context))
|
| - return *result;
|
| + // if (ClipRects* result = clipRectsIfCached(context))
|
| + // return *result;
|
| // Note that it's important that we call getClipRects on our parent
|
| // before we call calculateClipRects so that calculateClipRects will hit
|
| // the cache.
|
| @@ -169,6 +169,8 @@ ClipRects& PaintLayerClipper::getClipRects(
|
| if (context.rootLayer != &m_layer && m_layer.parent())
|
| parentClipRects = &m_layer.parent()->clipper().getClipRects(context);
|
| RefPtr<ClipRects> clipRects = ClipRects::create();
|
| + // LOG(ERROR) << "calculateClipRects:" <<
|
| + // m_layer.layoutObject()->debugName();
|
| calculateClipRects(context, *clipRects);
|
| return storeClipRectsInCache(context, parentClipRects, *clipRects);
|
| }
|
| @@ -389,6 +391,7 @@ void PaintLayerClipper::calculateClipRects(const ClipRectsContext& context,
|
| if (!m_layer.parent() &&
|
| !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
|
| // The root layer's clip rect is always infinite.
|
| + // LOG(ERROR) << "wat";
|
| clipRects.reset(LayoutRect(LayoutRect::infiniteIntRect()));
|
| return;
|
| }
|
| @@ -408,16 +411,19 @@ void PaintLayerClipper::calculateClipRects(const ClipRectsContext& context,
|
| }
|
|
|
| adjustClipRectsForChildren(layoutObject, clipRects);
|
| -
|
| + // LOG(ERROR) << "just before: " << m_layer.layoutObject()->debugName();
|
| if (shouldClipOverflow(context) || layoutObject.hasClip()) {
|
| + // LOG(ERROR) << "clipping overflow: " <<
|
| + // m_layer.layoutObject()->debugName();
|
| // This offset cannot use convertToLayerCoords, because sometimes our
|
| // rootLayer may be across some transformed layer boundary, for example, in
|
| // the PaintLayerCompositor overlapMap, where clipRects are needed in view
|
| // space.
|
| - applyClipRects(context, layoutObject,
|
| - LayoutPoint(layoutObject.localToAncestorPoint(
|
| - FloatPoint(), context.rootLayer->layoutObject())),
|
| - clipRects);
|
| + LOG(ERROR) << "mapping to ancestor: from=" << layoutObject.debugName()
|
| + << " to=" << context.rootLayer->layoutObject()->debugName();
|
| + LayoutPoint point(layoutObject.localToAncestorPoint(
|
| + FloatPoint(), context.rootLayer->layoutObject()));
|
| + applyClipRects(context, layoutObject, point, clipRects);
|
| }
|
| }
|
|
|
| @@ -479,6 +485,7 @@ ClipRect PaintLayerClipper::applyOverflowClipToBackgroundRectWithGeometryMapper(
|
| const ClipRect& clip) const {
|
| const LayoutObject& layoutObject = *m_layer.layoutObject();
|
| FloatRect clipRect(clip.rect());
|
| + // fix??
|
| if (shouldClipOverflow(context)) {
|
| LayoutRect layerBoundsWithVisualOverflow =
|
| layoutObject.isLayoutView()
|
| @@ -543,11 +550,11 @@ bool PaintLayerClipper::shouldClipOverflow(
|
| const ClipRectsContext& context) const {
|
| if (!m_layer.layoutObject()->isBox())
|
| return false;
|
| + // LOG(ERROR) << "wat";
|
| const LayoutBox& box = *toLayoutBox(m_layer.layoutObject());
|
|
|
| if (!shouldRespectOverflowClip(context))
|
| return false;
|
| -
|
| return box.shouldClipOverflow();
|
| }
|
|
|
|
|