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

Unified Diff: Source/core/rendering/style/FillLayer.cpp

Issue 275543003: Don't always fully repaint on viewport resize (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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: Source/core/rendering/style/FillLayer.cpp
diff --git a/Source/core/rendering/style/FillLayer.cpp b/Source/core/rendering/style/FillLayer.cpp
index 907a80d5b52cf5884b11f9d920229f42dc620e42..70a0e1cf25a0e93d5e60241d3f59298c83f747e6 100644
--- a/Source/core/rendering/style/FillLayer.cpp
+++ b/Source/core/rendering/style/FillLayer.cpp
@@ -355,6 +355,42 @@ bool FillLayer::imagesAreLoaded() const
return true;
}
+bool FillLayer::needsFullRepaintOnContainerWidthChange() const
+{
+ if (m_image) {
+ if (m_repeatX == RoundFill || m_repeatX == SpaceFill)
+ return true;
+ if (m_xPosition.isPercent() && !m_xPosition.isZero())
esprehn 2014/05/08 20:42:03 ditto
+ return true;
+ if (m_backgroundXOrigin != LeftEdge)
+ return true;
+ if (m_sizeType == SizeLength && m_sizeLength.width().isPercent())
esprehn 2014/05/08 20:42:03 Why don't you check 0% here?
+ return true;
+ if (m_sizeType == Contain || m_sizeType == Cover)
+ return true;
+ }
+
+ return m_next && m_next->needsFullRepaintOnContainerWidthChange();
+}
+
+bool FillLayer::needsFullRepaintOnContainerHeightChange() const
+{
+ if (m_image) {
+ if (m_repeatY == RoundFill || m_repeatY == SpaceFill)
+ return true;
+ if (m_yPosition.isPercent() && !m_yPosition.isZero())
esprehn 2014/05/08 20:42:03 Why do we ever represent 0 as a percent? It seems
Xianzhu 2014/05/08 22:31:08 For visual effect, 0% and 0px are the same, but fo
+ return true;
+ if (m_backgroundYOrigin != TopEdge)
+ return true;
+ if (m_sizeType == SizeLength && m_sizeLength.height().isPercent())
esprehn 2014/05/08 20:42:03 why not check 0%?
Xianzhu 2014/05/08 22:31:08 Omitted this because it's not a common usage and I
+ return true;
+ if (m_sizeType == Contain || m_sizeType == Cover)
+ return true;
esprehn 2014/05/08 20:42:03 Lists like this make me really nervous, this is ho
Xianzhu 2014/05/08 22:31:08 In the new patch set I changed the 'A||B' lists to
+ }
+
+ return m_next && m_next->needsFullRepaintOnContainerWidthChange();
+}
+
bool FillLayer::hasOpaqueImage(const RenderObject* renderer) const
{
if (!m_image)

Powered by Google App Engine
This is Rietveld 408576698