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

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

Issue 2476813002: Move LayoutObject::m_previousPosition... into a global map in ObjectPaintInvalidator (Closed)
Patch Set: doc Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 491
492 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, 492 PaintInvalidationState newPaintInvalidationState(paintInvalidationState,
493 *this); 493 *this);
494 if (!shouldCheckForPaintInvalidation(newPaintInvalidationState)) 494 if (!shouldCheckForPaintInvalidation(newPaintInvalidationState))
495 return; 495 return;
496 496
497 if (mayNeedPaintInvalidationSubtree()) 497 if (mayNeedPaintInvalidationSubtree())
498 newPaintInvalidationState 498 newPaintInvalidationState
499 .setForceSubtreeInvalidationCheckingWithinContainer(); 499 .setForceSubtreeInvalidationCheckingWithinContainer();
500 500
501 ObjectPaintInvalidator paintInvalidator(*this);
501 LayoutRect previousVisualRect = this->previousVisualRect(); 502 LayoutRect previousVisualRect = this->previousVisualRect();
502 LayoutPoint previousPosition = previousPositionFromPaintInvalidationBacking(); 503 LayoutPoint previousLocation = paintInvalidator.previousLocationInBacking();
503 PaintInvalidationReason reason = 504 PaintInvalidationReason reason =
504 invalidatePaintIfNeeded(newPaintInvalidationState); 505 invalidatePaintIfNeeded(newPaintInvalidationState);
505 clearPaintInvalidationFlags(); 506 clearPaintInvalidationFlags();
506 507
507 if (previousPosition != previousPositionFromPaintInvalidationBacking()) 508 if (previousLocation != paintInvalidator.previousLocationInBacking()) {
508 newPaintInvalidationState 509 newPaintInvalidationState
509 .setForceSubtreeInvalidationCheckingWithinContainer(); 510 .setForceSubtreeInvalidationCheckingWithinContainer();
511 }
510 512
511 // TODO(wangxianzhu): Combine this function into LayoutObject:: 513 // TODO(wangxianzhu): Combine this function into LayoutObject::
512 // invalidateTreeIfNeeded() when removing the following workarounds. 514 // invalidateTreeIfNeeded() when removing the following workarounds.
513 515
514 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove 516 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove
515 // when we enable paint offset caching. 517 // when we enable paint offset caching.
516 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef())) 518 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef())) {
517 newPaintInvalidationState 519 newPaintInvalidationState
518 .setForceSubtreeInvalidationCheckingWithinContainer(); 520 .setForceSubtreeInvalidationCheckingWithinContainer();
521 }
519 522
520 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't have 523 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't have
521 // enough saved information to do accurate check of clipping change. Will 524 // enough saved information to do accurate check of clipping change. Will
522 // remove when we remove rect-based paint invalidation. 525 // remove when we remove rect-based paint invalidation.
523 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && 526 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
524 previousVisualRect != this->previousVisualRect() && 527 previousVisualRect != this->previousVisualRect() &&
525 !usesCompositedScrolling() 528 !usesCompositedScrolling()
526 // Note that isLayoutView() below becomes unnecessary after the launch of 529 // Note that isLayoutView() below becomes unnecessary after the launch of
527 // root layer scrolling. 530 // root layer scrolling.
528 && (hasOverflowClip() || isLayoutView())) 531 && (hasOverflowClip() || isLayoutView())) {
529 newPaintInvalidationState 532 newPaintInvalidationState
530 .setForceSubtreeInvalidationRectUpdateWithinContainer(); 533 .setForceSubtreeInvalidationRectUpdateWithinContainer();
534 }
531 535
532 newPaintInvalidationState.updateForChildren(reason); 536 newPaintInvalidationState.updateForChildren(reason);
533 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); 537 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState);
534 } 538 }
535 539
536 void LayoutBoxModelObject::addOutlineRectsForNormalChildren( 540 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(
537 Vector<LayoutRect>& rects, 541 Vector<LayoutRect>& rects,
538 const LayoutPoint& additionalOffset, 542 const LayoutPoint& additionalOffset,
539 IncludeBlockVisualOverflowOrNot includeBlockOverflows) const { 543 IncludeBlockVisualOverflowOrNot includeBlockOverflows) const {
540 for (LayoutObject* child = slowFirstChild(); child; 544 for (LayoutObject* child = slowFirstChild(); child;
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 if (rootElementStyle->hasBackground()) 1340 if (rootElementStyle->hasBackground())
1337 return false; 1341 return false;
1338 1342
1339 if (node() != document().firstBodyElement()) 1343 if (node() != document().firstBodyElement())
1340 return false; 1344 return false;
1341 1345
1342 return true; 1346 return true;
1343 } 1347 }
1344 1348
1345 } // namespace blink 1349 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698