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

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

Issue 1813383002: Move all fast-path paint invalidation mapping into PaintInvalidationState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable fast-path/slow-path comparison because of saturated operations of LayoutUnit Created 4 years, 8 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } 353 }
354 return style.transform().dependsOnBoxSize() 354 return style.transform().dependsOnBoxSize()
355 || (style.transformOriginX() != Length(50, Percent) && style.transformOr iginX().hasPercent()) 355 || (style.transformOriginX() != Length(50, Percent) && style.transformOr iginX().hasPercent())
356 || (style.transformOriginY() != Length(50, Percent) && style.transformOr iginY().hasPercent()); 356 || (style.transformOriginY() != Length(50, Percent) && style.transformOr iginY().hasPercent());
357 } 357 }
358 358
359 void LayoutBoxModelObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState) 359 void LayoutBoxModelObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState)
360 { 360 {
361 ASSERT(!needsLayout()); 361 ASSERT(!needsLayout());
362 362
363 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) 363 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th is);
364 if (!shouldCheckForPaintInvalidation(newPaintInvalidationState))
364 return; 365 return;
365 366
366 LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRe ct(); 367 LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRe ct();
367 368
368 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th is);
369 // TODO(wangxianzhu): Enable this assert after we fix all paintInvalidationC ontainer mismatch issues. crbug.com/360286 369 // TODO(wangxianzhu): Enable this assert after we fix all paintInvalidationC ontainer mismatch issues. crbug.com/360286
370 // ASSERT(&newPaintInvalidationState.paintInvalidationContainer() == &contai nerForPaintInvalidation()); 370 // ASSERT(&newPaintInvalidationState.paintInvalidationContainer() == &contai nerForPaintInvalidation());
371 371
372 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio nState); 372 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio nState);
373 clearPaintInvalidationFlags(newPaintInvalidationState); 373 clearPaintInvalidationFlags(newPaintInvalidationState);
374 374
375 if (reason == PaintInvalidationDelayedFull) 375 if (reason == PaintInvalidationDelayedFull)
376 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); 376 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this);
377 377
378 if (reason == PaintInvalidationLocationChange) 378 if (reason == PaintInvalidationLocationChange)
379 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); 379 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer();
380 380
381 // TODO(wangxianzhu): Combine this function into LayoutObject::invalidateTre eIfNeeded() when removing the following workarounds.
382
381 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove when we enable paint offset caching. 383 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove when we enable paint offset caching.
382 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef())) 384 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef()))
383 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); 385 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer();
384 386
385 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't ha ve enough saved information to do accurate check 387 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't ha ve enough saved information to do accurate check
386 // of clipping change. Will remove when we remove rect-based paint invalidat ion. 388 // of clipping change. Will remove when we remove rect-based paint invalidat ion.
387 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() 389 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()
388 && previousPaintInvalidationRect != this->previousPaintInvalidationRect( ) 390 && previousPaintInvalidationRect != this->previousPaintInvalidationRect( )
389 && !usesCompositedScrolling() 391 && !usesCompositedScrolling()
390 && hasOverflowClip()) 392 && hasOverflowClip())
391 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon tainer(); 393 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon tainer();
392 394
393 newPaintInvalidationState.updatePaintOffsetAndClipForChildren(); 395 newPaintInvalidationState.updateForChildren();
394 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); 396 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState);
395 } 397 }
396 398
397 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r, PaintInvalidationReason invalidationReason) const 399 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r, PaintInvalidationReason invalidationReason) const
398 { 400 {
399 // TODO(wangxianzhu): Enable the following assert after paint invalidation f or spv2 is ready. 401 // TODO(wangxianzhu): Enable the following assert after paint invalidation f or spv2 is ready.
400 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 402 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
401 403
402 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here, 404 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here,
403 // so assert but check that the layer is composited. 405 // so assert but check that the layer is composited.
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 if (rootElementStyle->hasBackground()) 967 if (rootElementStyle->hasBackground())
966 return false; 968 return false;
967 969
968 if (node() != document().firstBodyElement()) 970 if (node() != document().firstBodyElement())
969 return false; 971 return false;
970 972
971 return true; 973 return true;
972 } 974 }
973 975
974 } // namespace blink 976 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutFlowThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698