Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(699)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp

Issue 1416053003: Let synchronized painting generate correct paint invalidation rects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: For landing Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 && previousPaintInvalidationRect != this->previousPaintInvalidationRect( ) 377 && previousPaintInvalidationRect != this->previousPaintInvalidationRect( )
378 && !usesCompositedScrolling() 378 && !usesCompositedScrolling()
379 && hasOverflowClip()) 379 && hasOverflowClip())
380 childTreeWalkState.setForceSubtreeInvalidationRectUpdateWithinContainer( ); 380 childTreeWalkState.setForceSubtreeInvalidationRectUpdateWithinContainer( );
381 381
382 invalidatePaintOfSubtreesIfNeeded(childTreeWalkState); 382 invalidatePaintOfSubtreesIfNeeded(childTreeWalkState);
383 } 383 }
384 384
385 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r, PaintInvalidationReason invalidationReason) const 385 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r, PaintInvalidationReason invalidationReason) const
386 { 386 {
387 ASSERT(!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()); 387 // TODO(wangxianzhu): Enable the following assert after paint invalidation f or spv2 is ready.
388 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
388 389
389 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here, 390 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here,
390 // so assert but check that the layer is composited. 391 // so assert but check that the layer is composited.
391 ASSERT(compositingState() != NotComposited); 392 ASSERT(compositingState() != NotComposited);
392 393
393 // FIXME: generalize accessors to backing GraphicsLayers so that this code i s squashing-agnostic. 394 // FIXME: generalize accessors to backing GraphicsLayers so that this code i s squashing-agnostic.
394 if (layer()->groupedMapping()) { 395 if (layer()->groupedMapping()) {
395 LayoutRect paintInvalidationRect = r; 396 LayoutRect paintInvalidationRect = r;
396 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer()) { 397 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer()) {
397 // Note: the subpixel accumulation of layer() does not need to be ad ded here. It is already taken into account. 398 // Note: the subpixel accumulation of layer() does not need to be ad ded here. It is already taken into account.
398 squashingLayer->setNeedsDisplayInRect(enclosingIntRect(paintInvalida tionRect), invalidationReason); 399 squashingLayer->setNeedsDisplayInRect(enclosingIntRect(paintInvalida tionRect), invalidationReason);
399 } 400 }
400 } else { 401 } else {
401 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval idationReason); 402 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval idationReason);
402 } 403 }
403 } 404 }
404 405
405 void LayoutBoxModelObject::invalidateDisplayItemClientOnBacking(const DisplayIte mClientWrapper& displayItemClient, PaintInvalidationReason invalidationReason, c onst LayoutRect& previousPaintInvalidationRect, const LayoutRect& newPaintInvali dationRect) const 406 void LayoutBoxModelObject::invalidateDisplayItemClientOnBacking(const DisplayIte mClientWrapper& displayItemClient, PaintInvalidationReason invalidationReason, c onst LayoutRect* paintInvalidationRect) const
406 { 407 {
407 if (layer()->groupedMapping()) { 408 if (layer()->groupedMapping()) {
408 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer()) 409 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer()) {
409 squashingLayer->invalidateDisplayItemClient(displayItemClient, inval idationReason, enclosingIntRect(previousPaintInvalidationRect), enclosingIntRect (newPaintInvalidationRect)); 410 // Note: the subpixel accumulation of layer() does not need to be ad ded here. It is already taken into account.
411 IntRect paintInvalidationRectOnSquashingLayer;
412 if (paintInvalidationRect)
413 paintInvalidationRectOnSquashingLayer = enclosingIntRect(*paintI nvalidationRect);
414 squashingLayer->invalidateDisplayItemClient(displayItemClient, inval idationReason, paintInvalidationRect ? &paintInvalidationRectOnSquashingLayer : nullptr);
415 }
410 } else if (CompositedLayerMapping* compositedLayerMapping = layer()->composi tedLayerMapping()) { 416 } else if (CompositedLayerMapping* compositedLayerMapping = layer()->composi tedLayerMapping()) {
411 if (this->displayItemClient() != displayItemClient.displayItemClient() & & isBox() && toLayoutBox(this)->usesCompositedScrolling()) { 417 if (this->displayItemClient() != displayItemClient.displayItemClient() & & isBox() && toLayoutBox(this)->usesCompositedScrolling()) {
412 // This paint invalidation container is using composited scrolling, and we are invalidating a scrolling content, 418 // This paint invalidation container is using composited scrolling, and we are invalidating a scrolling content,
413 // so we should invalidate on the scrolling contents layer only. 419 // so we should invalidate on the scrolling contents layer only.
414 compositedLayerMapping->invalidateDisplayItemClientOnScrollingConten tsLayer(displayItemClient, invalidationReason, previousPaintInvalidationRect, ne wPaintInvalidationRect); 420 compositedLayerMapping->invalidateDisplayItemClientOnScrollingConten tsLayer(displayItemClient, invalidationReason, paintInvalidationRect);
415 } else { 421 } else {
416 compositedLayerMapping->invalidateDisplayItemClient(displayItemClien t, invalidationReason, previousPaintInvalidationRect, newPaintInvalidationRect); 422 compositedLayerMapping->invalidateDisplayItemClient(displayItemClien t, invalidationReason, paintInvalidationRect);
417 } 423 }
418 } 424 }
419 } 425 }
420 426
421 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl udeBlockOverflows) const 427 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl udeBlockOverflows) const
422 { 428 {
423 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { 429 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) {
424 // Outlines of out-of-flow positioned descendants are handled in LayoutB lock::addOutlineRects(). 430 // Outlines of out-of-flow positioned descendants are handled in LayoutB lock::addOutlineRects().
425 if (child->isOutOfFlowPositioned()) 431 if (child->isOutOfFlowPositioned())
426 continue; 432 continue;
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 if (rootElementStyle->hasBackground()) 1063 if (rootElementStyle->hasBackground())
1058 return false; 1064 return false;
1059 1065
1060 if (node() != document().firstBodyElement()) 1066 if (node() != document().firstBodyElement())
1061 return false; 1067 return false;
1062 1068
1063 return true; 1069 return true;
1064 } 1070 }
1065 1071
1066 } // namespace blink 1072 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698