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

Unified Diff: third_party/WebKit/Source/core/style/FillLayer.cpp

Issue 1787733003: Consolidate background fill layer opaqueness into one method (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/style/FillLayer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/FillLayer.cpp
diff --git a/third_party/WebKit/Source/core/style/FillLayer.cpp b/third_party/WebKit/Source/core/style/FillLayer.cpp
index 47df687455c70a50f07c791c79b9ecc19026ea42..edb268968bc39dfbf3864da211987c53f8cc370e 100644
--- a/third_party/WebKit/Source/core/style/FillLayer.cpp
+++ b/third_party/WebKit/Source/core/style/FillLayer.cpp
@@ -370,29 +370,30 @@ bool FillLayer::imagesAreLoaded() const
return true;
}
-bool FillLayer::hasOpaqueImage(const LayoutObject* layoutObject) const
+bool FillLayer::backgroundImageIsOpaque(const LayoutObject& imageClient, const float effectiveZoom) const
trchen 2016/03/11 22:13:33 I think the complexity of this function is getting
Stephen Chennney 2016/03/14 14:59:35 I'm wary of exposing multiple methods that a calle
{
- if (!m_image)
+ if (!m_image || !m_image->canRender())
+ return false;
+
+ if ((m_repeatX != RepeatFill && m_repeatX != RoundFill)
+ || (m_repeatY != RepeatFill && m_repeatY != RoundFill))
+ return false;
+
+ if (m_blendMode != WebBlendModeNormal)
return false;
- // TODO(trchen): Should check blend mode before composite mode.
if (m_composite == CompositeClear || m_composite == CompositeCopy)
return true;
- if (m_blendMode != WebBlendModeNormal)
+ if (m_image->imageSize(&imageClient, effectiveZoom, LayoutSize()).isEmpty())
return false;
if (m_composite == CompositeSourceOver)
- return m_image->knownToBeOpaque(layoutObject);
+ return m_image->knownToBeOpaque(&imageClient);
return false;
}
-bool FillLayer::hasRepeatXY() const
-{
- return m_repeatX == RepeatFill && m_repeatY == RepeatFill;
-}
-
static inline bool layerImagesIdentical(const FillLayer& layer1, const FillLayer& layer2)
{
// We just care about pointer equivalency.
« no previous file with comments | « third_party/WebKit/Source/core/style/FillLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698