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

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

Issue 1804963005: Avoid paintInvalidationContainer parameter of invalidatePaintIfNeeded() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 } 372 }
373 setHasOverflowClip(shouldClipOverflow); 373 setHasOverflowClip(shouldClipOverflow);
374 } 374 }
375 375
376 bool LayoutBlock::allowsOverflowClip() const 376 bool LayoutBlock::allowsOverflowClip() const
377 { 377 {
378 // If overflow has been propagated to the viewport, it has no effect here. 378 // If overflow has been propagated to the viewport, it has no effect here.
379 return node() != document().viewportDefiningElement(); 379 return node() != document().viewportDefiningElement();
380 } 380 }
381 381
382 void LayoutBlock::invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& chil dPaintInvalidationState) 382 void LayoutBlock::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState & childPaintInvalidationState)
383 { 383 {
384 LayoutBox::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState); 384 LayoutBox::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState);
385 385
386 // Take care of positioned objects. This is required as PaintInvalidationSta te keeps a single clip rect. 386 // Take care of positioned objects. This is required as PaintInvalidationSta te keeps a single clip rect.
387 if (TrackedLayoutBoxListHashSet* positionedObjects = this->positionedObjects ()) { 387 if (TrackedLayoutBoxListHashSet* positionedObjects = this->positionedObjects ()) {
388 for (auto* box : *positionedObjects) { 388 for (auto* box : *positionedObjects) {
389 389
390 // One of the layoutObjects we're skipping over here may be the chil d's paint invalidation container, 390 // One of the layoutObjects we're skipping over here may be the chil d's paint invalidation container,
391 // so we can't pass our own paint invalidation container along. 391 // so we can't pass our own paint invalidation container along.
392 const LayoutBoxModelObject& paintInvalidationContainerForChild = box ->containerForPaintInvalidation(); 392 const LayoutBoxModelObject& paintInvalidationContainerForChild = box ->containerForPaintInvalidation();
393 393
394 // If it's a new paint invalidation container, we won't have properl y accumulated the offset into the 394 // If it's a new paint invalidation container, we won't have properl y accumulated the offset into the
395 // PaintInvalidationState. 395 // PaintInvalidationState.
396 // FIXME: Teach PaintInvalidationState to handle this case. crbug.co m/371485 396 // FIXME: Teach PaintInvalidationState to handle this case. crbug.co m/371485
397 // Note: when the box itself establishes a paint invalidation contai ner, the second part of the condition below 397 if (paintInvalidationContainerForChild != childPaintInvalidationStat e.paintInvalidationContainer()) {
398 // will be true because childPaintInvalidationState.paintInvalidatio nContainer() is the parent paintInvalidationContainer.
399 // We need the first part of the condition to exclude the case from using ForceHorriblySlowRectMapping.
400 if (&paintInvalidationContainerForChild != box && paintInvalidationC ontainerForChild != childPaintInvalidationState.paintInvalidationContainer()) {
401 ForceHorriblySlowRectMapping slowRectMapping(&childPaintInvalida tionState); 398 ForceHorriblySlowRectMapping slowRectMapping(&childPaintInvalida tionState);
402 PaintInvalidationState disabledPaintInvalidationState(childPaint InvalidationState, *this, paintInvalidationContainerForChild); 399 PaintInvalidationState disabledPaintInvalidationState(childPaint InvalidationState, *this, paintInvalidationContainerForChild);
403 box->invalidateTreeIfNeeded(disabledPaintInvalidationState); 400 box->invalidateTreeIfNeeded(disabledPaintInvalidationState);
404 continue; 401 continue;
405 } 402 }
406 403
407 // If the positioned layoutObject is absolutely positioned and it is inside 404 // If the positioned layoutObject is absolutely positioned and it is inside
408 // a relatively positioned inline element, we need to account for 405 // a relatively positioned inline element, we need to account for
409 // the inline elements position in PaintInvalidationState. 406 // the inline elements position in PaintInvalidationState.
410 if (box->style()->position() == AbsolutePosition) { 407 if (box->style()->position() == AbsolutePosition) {
(...skipping 2453 matching lines...) Expand 10 before | Expand all | Expand 10 after
2864 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2861 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2865 { 2862 {
2866 showLayoutObject(); 2863 showLayoutObject();
2867 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2864 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2868 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2865 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2869 } 2866 }
2870 2867
2871 #endif 2868 #endif
2872 2869
2873 } // namespace blink 2870 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698