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

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

Issue 1368163002: Workaround rect-based paint invalidation on ancestor clip change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 ASSERT(!needsLayout()); 356 ASSERT(!needsLayout());
357 357
358 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) 358 if (!shouldCheckForPaintInvalidation(paintInvalidationState))
359 return; 359 return;
360 360
361 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer (); 361 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer ();
362 const LayoutBoxModelObject& newPaintInvalidationContainer = *adjustComposite dContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer()); 362 const LayoutBoxModelObject& newPaintInvalidationContainer = *adjustComposite dContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer());
363 // FIXME: This assert should be re-enabled when we move paint invalidation t o after compositing update. crbug.com/360286 363 // FIXME: This assert should be re-enabled when we move paint invalidation t o after compositing update. crbug.com/360286
364 // ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()) ; 364 // ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()) ;
365 365
366 LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRe ct();
367
366 PaintInvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationSt ate, newPaintInvalidationContainer); 368 PaintInvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationSt ate, newPaintInvalidationContainer);
367 clearPaintInvalidationState(paintInvalidationState); 369 clearPaintInvalidationState(paintInvalidationState);
368 370
369 if (reason == PaintInvalidationDelayedFull) 371 if (reason == PaintInvalidationDelayedFull)
370 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); 372 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this);
371 373
372 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer); 374 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer);
373 if (reason == PaintInvalidationLocationChange) 375 if (reason == PaintInvalidationLocationChange)
374 childTreeWalkState.setForceSubtreeInvalidationWithinContainer(); 376 childTreeWalkState.setForceSubtreeInvalidationWithinContainer();
375 377
376 // Workaround for crbug.com/533277. 378 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove when we enable paint offset caching.
377 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef())) 379 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef()))
378 childTreeWalkState.setForceSubtreeInvalidationWithinContainer(); 380 childTreeWalkState.setForceSubtreeInvalidationWithinContainer();
379 381
382 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't ha ve enough saved information to do accurate check
383 // of clipping change. Will remove when we remove rect-based paint invalidat ion.
384 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()
385 && previousPaintInvalidationRect != this->previousPaintInvalidationRect( )
chrishtr 2015/09/28 17:38:13 If the rect changes, why didn't invalidatePaintIfN
Xianzhu 2015/09/28 17:49:05 These condition are for the ancestor whose clip ch
chrishtr 2015/09/28 22:16:29 Ok, but in what situation is invalidatePaintIfNeed
Xianzhu 2015/09/28 22:56:26 Let's take the added layout test as an example: <
chrishtr 2015/09/28 23:38:13 This all sounds great, and makes sense. What I don
Xianzhu 2015/09/28 23:51:48 I see your question now :) Simple style change (e
386 && !usesCompositedScrolling()
387 && hasOverflowClip())
388 childTreeWalkState.setForceSubtreeInvalidationRectUpdateWithinContainer( );
389
380 invalidatePaintOfSubtreesIfNeeded(childTreeWalkState); 390 invalidatePaintOfSubtreesIfNeeded(childTreeWalkState);
381 } 391 }
382 392
383 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r, PaintInvalidationReason invalidationReason) const 393 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r, PaintInvalidationReason invalidationReason) const
384 { 394 {
385 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here, 395 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here,
386 // so assert but check that the layer is composited. 396 // so assert but check that the layer is composited.
387 ASSERT(compositingState() != NotComposited); 397 ASSERT(compositingState() != NotComposited);
388 398
389 // FIXME: generalize accessors to backing GraphicsLayers so that this code i s squashing-agnostic. 399 // FIXME: generalize accessors to backing GraphicsLayers so that this code i s squashing-agnostic.
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 if (rootElementStyle->hasBackground()) 1057 if (rootElementStyle->hasBackground())
1048 return false; 1058 return false;
1049 1059
1050 if (node() != document().firstBodyElement()) 1060 if (node() != document().firstBodyElement())
1051 return false; 1061 return false;
1052 1062
1053 return true; 1063 return true;
1054 } 1064 }
1055 1065
1056 } // namespace blink 1066 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698