X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fcore%2Frendering%2FRenderLayerModelObject.cpp;h=fbb615ef15259e005588f409c5e7aa85e6cfa8d3;hb=3545e9f2671f595d2a2f3ee75ca0393b01e35ef6;hp=4abbe556194443e22a477f7d61c3ed7a6f4d2e71;hpb=7d210d4c7e9ba36e635eabc5b5780495f8a63292;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/core/rendering/RenderLayerModelObject.cpp b/src/third_party/WebKit/Source/core/rendering/RenderLayerModelObject.cpp index 4abbe55..fbb615e 100644 --- a/src/third_party/WebKit/Source/core/rendering/RenderLayerModelObject.cpp +++ b/src/third_party/WebKit/Source/core/rendering/RenderLayerModelObject.cpp @@ -28,6 +28,7 @@ #include "core/frame/LocalFrame.h" #include "core/rendering/RenderLayer.h" #include "core/rendering/RenderView.h" +#include "core/rendering/compositing/CompositedLayerMapping.h" namespace blink { @@ -92,7 +93,7 @@ void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderS if (RenderStyle* oldStyle = style()) { if (parent() && diff.needsPaintInvalidationLayer()) { - if (oldStyle->hasClip() != newStyle.hasClip() + if (oldStyle->hasAutoClip() != newStyle.hasAutoClip() || oldStyle->clip() != newStyle.clip()) layer()->clipper().clearClipRectsIncludingDescendants(); } @@ -117,9 +118,6 @@ void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt setChildNeedsLayout(); createLayer(type); if (parent() && !needsLayout()) { - // FIXME: This invalidation is overly broad. We should update to - // do the correct invalidation at RenderStyle::diff time. crbug.com/349061 - layer()->renderer()->setShouldDoFullPaintInvalidation(true); // FIXME: We should call a specialized version of this function. layer()->updateLayerPositionsAfterLayout(); } @@ -174,25 +172,8 @@ void RenderLayerModelObject::addLayerHitTestRects(LayerHitTestRects& rects, cons } } -InvalidationReason RenderLayerModelObject::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationContainer) -{ - const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); - const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositionFromPaintInvalidationContainer(); - setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInvalidationContainer, &paintInvalidationState)); - setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromPaintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidationState)); - - // If we are set to do a full paint invalidation that means the RenderView will issue - // paint invalidations. We can then skip issuing of paint invalidations for the child - // renderers as they'll be covered by the RenderView. - if (view()->doingFullPaintInvalidation()) - return InvalidationNone; - - return RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvalidationState); -} - void RenderLayerModelObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState) { - // FIXME: SVG should probably also go through this unified paint invalidation system. ASSERT(!needsLayout()); if (!shouldCheckForPaintInvalidation(paintInvalidationState)) @@ -203,11 +184,35 @@ void RenderLayerModelObject::invalidateTreeIfNeeded(const PaintInvalidationState ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()); InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer); + clearPaintInvalidationState(paintInvalidationState); PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, newPaintInvalidationContainer); if (reason == InvalidationLocationChange || reason == InvalidationFull) childTreeWalkState.setForceCheckForPaintInvalidation(); - RenderObject::invalidateTreeIfNeeded(childTreeWalkState); + invalidatePaintOfSubtreesIfNeeded(childTreeWalkState); +} + +void RenderLayerModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRect& r) const +{ + // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here, + // so assert but check that the layer is composited. + ASSERT(compositingState() != NotComposited); + + WebInvalidationDebugAnnotations annotations = WebInvalidationDebugAnnotationsNone; + if (!hadPaintInvalidation()) + annotations = WebInvalidationDebugAnnotationsFirstPaint; + // FIXME: The callers assume they are calling a const function but this function has a side effect. + const_cast(this)->setHadPaintInvalidation(); + + // FIXME: generalize accessors to backing GraphicsLayers so that this code is squashing-agnostic. + if (layer()->groupedMapping()) { + LayoutRect paintInvalidationRect = r; + paintInvalidationRect.move(layer()->subpixelAccumulation()); + if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashingLayer()) + squashingLayer->setNeedsDisplayInRect(pixelSnappedIntRect(paintInvalidationRect), annotations); + } else { + layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, annotations); + } } } // namespace blink