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

Side by Side Diff: third_party/WebKit/Source/core/paint/ViewPaintInvalidator.cpp

Issue 2689213013: Move previous border box size out of global map into LayoutBox::m_previousSize (Closed)
Patch Set: - Created 3 years, 10 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/Source/core/paint/BoxPaintInvalidator.cpp ('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 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/ViewPaintInvalidator.h" 5 #include "core/paint/ViewPaintInvalidator.h"
6 6
7 #include "core/layout/LayoutView.h" 7 #include "core/layout/LayoutView.h"
8 #include "core/paint/BoxPaintInvalidator.h" 8 #include "core/paint/BoxPaintInvalidator.h"
9 #include "platform/geometry/LayoutSize.h" 9 #include "platform/geometry/LayoutSize.h"
10 10
(...skipping 15 matching lines...) Expand all
26 // document element. 26 // document element.
27 // See https://drafts.csswg.org/css-backgrounds-3/#root-background. 27 // See https://drafts.csswg.org/css-backgrounds-3/#root-background.
28 Element* documentElement = m_view.document().documentElement(); 28 Element* documentElement = m_view.document().documentElement();
29 if (!documentElement) 29 if (!documentElement)
30 return; 30 return;
31 const LayoutObject* backgroundObject = documentElement->layoutObject(); 31 const LayoutObject* backgroundObject = documentElement->layoutObject();
32 if (!backgroundObject || !backgroundObject->isBox()) 32 if (!backgroundObject || !backgroundObject->isBox())
33 return; 33 return;
34 34
35 const LayoutBox& backgroundBox = toLayoutBox(*backgroundObject); 35 const LayoutBox& backgroundBox = toLayoutBox(*backgroundObject);
36 LayoutSize oldSize = BoxPaintInvalidator::previousBorderBoxSize( 36 LayoutSize oldSize = backgroundBox.previousSize();
37 backgroundBox, backgroundBox.visualRect().size());
38 LayoutSize newSize = backgroundBox.size(); 37 LayoutSize newSize = backgroundBox.size();
39 const auto& backgroundLayers = m_view.styleRef().backgroundLayers(); 38 const auto& backgroundLayers = m_view.styleRef().backgroundLayers();
40 if ((oldSize.width() != newSize.width() && 39 if ((oldSize.width() != newSize.width() &&
41 LayoutBox::mustInvalidateFillLayersPaintOnWidthChange( 40 LayoutBox::mustInvalidateFillLayersPaintOnWidthChange(
42 backgroundLayers)) || 41 backgroundLayers)) ||
43 (oldSize.height() != newSize.height() && 42 (oldSize.height() != newSize.height() &&
44 LayoutBox::mustInvalidateFillLayersPaintOnHeightChange( 43 LayoutBox::mustInvalidateFillLayersPaintOnHeightChange(
45 backgroundLayers))) { 44 backgroundLayers))) {
46 m_view.getMutableForPainting().setShouldDoFullPaintInvalidation( 45 m_view.getMutableForPainting().setShouldDoFullPaintInvalidation(
47 PaintInvalidationViewBackground); 46 PaintInvalidationViewBackground);
48 } 47 }
49 } 48 }
50 49
51 } // namespace blink 50 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxPaintInvalidator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698