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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.cpp

Issue 2786463004: Paint backgrounds of a table section/row in one display item (Closed)
Patch Set: - Created 3 years, 8 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/layout/LayoutTableBoxComponent.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.cpp b/third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.cpp
index 3a4bf18879baaedeb302bda9eb6014d0ed1337bb..9d54c00f2d9a0a7d91ebdbeaa390c237290faed4 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.cpp
@@ -5,6 +5,7 @@
#include "core/layout/LayoutTableBoxComponent.h"
#include "core/layout/LayoutTable.h"
+#include "core/paint/ObjectPaintInvalidator.h"
#include "core/style/ComputedStyle.h"
namespace blink {
@@ -25,4 +26,24 @@ bool LayoutTableBoxComponent::doCellsHaveDirtyWidth(
!oldStyle.border().sizeEquals(tablePart.style()->border());
}
+void LayoutTableBoxComponent::MutableForPainting::updatePaintResult(
+ PaintResult paintResult,
+ const CullRect& paintRect) {
+ DCHECK_EQ(m_layoutObject.document().lifecycle().state(),
+ DocumentLifecycle::LifecycleState::InPaint);
+
+ // A table row or section may paint large background display item which
+ // contains paint operations of the background in each contained cell.
+ // The display item can be clipped by the paint rect to avoid painting
+ // on areas not interested. If we didn't fully paint and paint rect changes,
+ // we need to invalidate the display item (using setDisplayItemUncached()
+ // because we are already in painting.)
+ auto& box = static_cast<LayoutTableBoxComponent&>(m_layoutObject);
+ if (box.m_lastPaintResult != FullyPainted && box.m_lastPaintRect != paintRect)
+ m_layoutObject.setDisplayItemsUncached();
+
+ box.m_lastPaintResult = paintResult;
+ box.m_lastPaintRect = paintRect;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698