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/LayoutBox.cpp

Issue 2212223004: Fix wrong PaintInvalidationIncremental on empty object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/invalidation/empty-object-move-and-resize-expected.txt ('k') | no next file » | 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, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. 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 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 } 2035 }
2036 2036
2037 bool LayoutBox::paintedOutputOfObjectHasNoEffect() const 2037 bool LayoutBox::paintedOutputOfObjectHasNoEffect() const
2038 { 2038 {
2039 // In case scrollbars got repositioned (which will typically happen if the b ox got 2039 // In case scrollbars got repositioned (which will typically happen if the b ox got
2040 // resized), we cannot skip invalidation. 2040 // resized), we cannot skip invalidation.
2041 if (hasNonCompositedScrollbars()) 2041 if (hasNonCompositedScrollbars())
2042 return false; 2042 return false;
2043 2043
2044 // Cannot skip paint invalidation if the box has real things to paint. 2044 // Cannot skip paint invalidation if the box has real things to paint.
2045 if (getSelectionState() != SelectionNone || hasBoxDecorationBackground() || styleRef().hasVisualOverflowingEffect()) 2045 if (getSelectionState() != SelectionNone || hasBoxDecorationBackground() || styleRef().hasBoxDecorations() || styleRef().hasVisualOverflowingEffect())
2046 return false; 2046 return false;
2047 2047
2048 // If the box has clip, we need issue a paint invalidation to cover the chan ged part of 2048 // If the box has clip, we need issue a paint invalidation to cover the chan ged part of
2049 // children because of change of clip when the box got resized. In theory th e children 2049 // children because of change of clip when the box got resized. In theory th e children
2050 // should invalidate themselves when ancestor clip changes, but for now this is missing 2050 // should invalidate themselves when ancestor clip changes, but for now this is missing
2051 // and ensuring it may hurt performance. 2051 // and ensuring it may hurt performance.
2052 // TODO(wangxianzhu): Paint invalidation for clip change will be different i n spv2. 2052 // TODO(wangxianzhu): Paint invalidation for clip change will be different i n spv2.
2053 if (hasClipRelatedProperty() || hasControlClip()) 2053 if (hasClipRelatedProperty() || hasControlClip())
2054 return false; 2054 return false;
2055 2055
(...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after
4048 FloatRoundedRect newRoundedRect = style()->getRoundedBorderFor(LayoutRec t(LayoutPoint(0, 0), newBorderBoxSize)); 4048 FloatRoundedRect newRoundedRect = style()->getRoundedBorderFor(LayoutRec t(LayoutPoint(0, 0), newBorderBoxSize));
4049 if (oldRoundedRect.getRadii() != newRoundedRect.getRadii()) 4049 if (oldRoundedRect.getRadii() != newRoundedRect.getRadii())
4050 return PaintInvalidationBorderBoxChange; 4050 return PaintInvalidationBorderBoxChange;
4051 } 4051 }
4052 4052
4053 if (oldBorderBoxSize.width() != newBorderBoxSize.width() && mustInvalidateBa ckgroundOrBorderPaintOnWidthChange()) 4053 if (oldBorderBoxSize.width() != newBorderBoxSize.width() && mustInvalidateBa ckgroundOrBorderPaintOnWidthChange())
4054 return PaintInvalidationBorderBoxChange; 4054 return PaintInvalidationBorderBoxChange;
4055 if (oldBorderBoxSize.height() != newBorderBoxSize.height() && mustInvalidate BackgroundOrBorderPaintOnHeightChange()) 4055 if (oldBorderBoxSize.height() != newBorderBoxSize.height() && mustInvalidate BackgroundOrBorderPaintOnHeightChange())
4056 return PaintInvalidationBorderBoxChange; 4056 return PaintInvalidationBorderBoxChange;
4057 4057
4058 return PaintInvalidationIncremental; 4058 return styleRef().hasBackground() || styleRef().hasBoxDecorations() ? PaintI nvalidationIncremental : invalidationReason;
4059 } 4059 }
4060 4060
4061 void LayoutBox::incrementallyInvalidatePaint(const LayoutBoxModelObject& paintIn validationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, c onst LayoutPoint& positionFromPaintInvalidationBacking) 4061 void LayoutBox::incrementallyInvalidatePaint(const LayoutBoxModelObject& paintIn validationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, c onst LayoutPoint& positionFromPaintInvalidationBacking)
4062 { 4062 {
4063 LayoutObject::incrementallyInvalidatePaint(paintInvalidationContainer, oldBo unds, newBounds, positionFromPaintInvalidationBacking); 4063 LayoutObject::incrementallyInvalidatePaint(paintInvalidationContainer, oldBo unds, newBounds, positionFromPaintInvalidationBacking);
4064 4064
4065 bool hasBoxDecorations = style()->hasBoxDecorations(); 4065 bool hasBoxDecorations = style()->hasBoxDecorations();
4066 if (!style()->hasBackground() && !hasBoxDecorations) 4066 if (!style()->hasBackground() && !hasBoxDecorations)
4067 return; 4067 return;
4068 4068
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
4987 m_rareData->m_snapAreas->remove(&snapArea); 4987 m_rareData->m_snapAreas->remove(&snapArea);
4988 } 4988 }
4989 } 4989 }
4990 4990
4991 SnapAreaSet* LayoutBox::snapAreas() const 4991 SnapAreaSet* LayoutBox::snapAreas() const
4992 { 4992 {
4993 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4993 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4994 } 4994 }
4995 4995
4996 } // namespace blink 4996 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/invalidation/empty-object-move-and-resize-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698