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

Unified Diff: third_party/WebKit/Source/core/paint/BoxPainter.cpp

Issue 1787733003: Consolidate background fill layer opaqueness into one method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows build 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/BoxPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/BoxPainter.cpp b/third_party/WebKit/Source/core/paint/BoxPainter.cpp
index 10ca0a7f09affd139c0b6c806c1805288f09a314..9742626bb99f5824eb6d33ac320f87231f88dc2c 100644
--- a/third_party/WebKit/Source/core/paint/BoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxPainter.cpp
@@ -134,16 +134,6 @@ void BoxPainter::paintBackground(const PaintInfo& paintInfo, const LayoutRect& p
paintFillLayers(paintInfo, backgroundColor, m_layoutBox.style()->backgroundLayers(), paintRect, bleedAvoidance);
}
-bool BoxPainter::isFillLayerOpaque(const FillLayer& layer, const LayoutObject& imageClient)
-{
- // The default object size passed down to imageSize is empty with the implication that images
- // with no intrinsic size are treated as empty.
- return layer.hasOpaqueImage(&imageClient)
- && layer.image()->canRender()
- && !layer.image()->imageSize(imageClient, imageClient.style()->effectiveZoom(), LayoutSize()).isEmpty()
- && layer.hasRepeatXY();
-}
-
bool BoxPainter::calculateFillLayerOcclusionCulling(FillLayerOcclusionOutputList &reversedPaintList, const FillLayer& fillLayer)
{
bool isNonAssociative = false;
@@ -163,7 +153,7 @@ bool BoxPainter::calculateFillLayerOcclusionCulling(FillLayerOcclusionOutputList
// TODO(trchen): A fill layer cannot paint if the calculated tile size is empty.
// This occlusion check can be wrong.
if (currentLayer->clipOccludesNextLayers()
- && isFillLayerOpaque(*currentLayer, m_layoutBox)) {
+ && currentLayer->imageOccludesNextLayers(m_layoutBox)) {
if (currentLayer->clip() == BorderFillBox)
isNonAssociative = false;
break;
@@ -433,7 +423,7 @@ void BoxPainter::paintFillLayer(const LayoutBoxModelObject& obj, const PaintInfo
if (isBottomLayer) {
IntRect backgroundRect(pixelSnappedIntRect(scrolledPaintRect));
bool boxShadowShouldBeAppliedToBackground = obj.boxShadowShouldBeAppliedToBackground(bleedAvoidance, box);
- bool backgroundImageOccludesBackgroundColor = shouldPaintBackgroundImage && isFillLayerOpaque(bgLayer, obj);
+ bool backgroundImageOccludesBackgroundColor = shouldPaintBackgroundImage && bgLayer.imageOccludesNextLayers(obj);
if (boxShadowShouldBeAppliedToBackground || !backgroundImageOccludesBackgroundColor) {
GraphicsContextStateSaver shadowStateSaver(context, boxShadowShouldBeAppliedToBackground);
if (boxShadowShouldBeAppliedToBackground)
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxDecorationData.cpp ('k') | third_party/WebKit/Source/core/style/FillLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698