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

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

Issue 1756763004: Merge image sizing algorithms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extend test to cover svg and non-svg case 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/BoxPainter.h" 5 #include "core/paint/BoxPainter.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/html/HTMLFrameOwnerElement.h" 9 #include "core/html/HTMLFrameOwnerElement.h"
10 #include "core/layout/ImageQualityController.h" 10 #include "core/layout/ImageQualityController.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 return; 129 return;
130 if (m_layoutBox.backgroundStolenForBeingBody()) 130 if (m_layoutBox.backgroundStolenForBeingBody())
131 return; 131 return;
132 if (m_layoutBox.boxDecorationBackgroundIsKnownToBeObscured()) 132 if (m_layoutBox.boxDecorationBackgroundIsKnownToBeObscured())
133 return; 133 return;
134 paintFillLayers(paintInfo, backgroundColor, m_layoutBox.style()->backgroundL ayers(), paintRect, bleedAvoidance); 134 paintFillLayers(paintInfo, backgroundColor, m_layoutBox.style()->backgroundL ayers(), paintRect, bleedAvoidance);
135 } 135 }
136 136
137 bool BoxPainter::isFillLayerOpaque(const FillLayer& layer, const LayoutObject& i mageClient) 137 bool BoxPainter::isFillLayerOpaque(const FillLayer& layer, const LayoutObject& i mageClient)
138 { 138 {
139 // The default object size passed down to imageSize is empty with the implic ation that images
140 // with no intrinsic size are treated as empty.
139 return layer.hasOpaqueImage(&imageClient) 141 return layer.hasOpaqueImage(&imageClient)
140 && layer.image()->canRender() 142 && layer.image()->canRender()
141 && !layer.image()->imageSize(&imageClient, imageClient.style()->effectiv eZoom()).isEmpty() 143 && !layer.image()->imageSize(&imageClient, imageClient.style()->effectiv eZoom(), LayoutSize()).isEmpty()
fs 2016/03/03 15:22:53 Not your doing, and no action necessarily required
davve 2016/03/04 06:49:43 Good observation. Using canRender() alone would be
142 && layer.hasRepeatXY(); 144 && layer.hasRepeatXY();
143 } 145 }
144 146
145 bool BoxPainter::calculateFillLayerOcclusionCulling(FillLayerOcclusionOutputList &reversedPaintList, const FillLayer& fillLayer) 147 bool BoxPainter::calculateFillLayerOcclusionCulling(FillLayerOcclusionOutputList &reversedPaintList, const FillLayer& fillLayer)
146 { 148 {
147 bool isNonAssociative = false; 149 bool isNonAssociative = false;
148 for (auto currentLayer = &fillLayer; currentLayer; currentLayer = currentLay er->next()) { 150 for (auto currentLayer = &fillLayer; currentLayer; currentLayer = currentLay er->next()) {
149 reversedPaintList.append(currentLayer); 151 reversedPaintList.append(currentLayer);
150 // Stop traversal when an opaque layer is encountered. 152 // Stop traversal when an opaque layer is encountered.
151 // FIXME : It would be possible for the following occlusion culling test to be more aggressive 153 // FIXME : It would be possible for the following occlusion culling test to be more aggressive
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 } 692 }
691 } 693 }
692 694
693 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document) 695 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document)
694 { 696 {
695 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc onomy 697 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc onomy
696 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ()); 698 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ());
697 } 699 }
698 700
699 } // namespace blink 701 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698