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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTable.h

Issue 2430313004: Paint collapsed borders of a table as one display item (Closed)
Patch Set: Improve raster performance Created 4 years, 1 month 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/LayoutTable.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.h b/third_party/WebKit/Source/core/layout/LayoutTable.h
index adc7a6be3d99262fb577a9743930eba1a6a9ec7d..5f1bcde3bc71a28969cea278b6abbfa04566289b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.h
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.h
@@ -29,7 +29,9 @@
#include "core/CSSPropertyNames.h"
#include "core/CoreExport.h"
#include "core/layout/LayoutBlock.h"
+#include "core/paint/PaintResult.h"
#include "core/style/CollapsedBorderValue.h"
+#include "platform/graphics/paint/CullRect.h"
#include "wtf/Vector.h"
#include <memory>
@@ -375,7 +377,6 @@ class CORE_EXPORT LayoutTable final : public LayoutBlock {
LayoutTableCell* cellBefore(const LayoutTableCell*) const;
LayoutTableCell* cellAfter(const LayoutTableCell*) const;
- typedef Vector<CollapsedBorderValue> CollapsedBorderValues;
void invalidateCollapsedBorders();
bool hasSections() const { return m_head || m_foot || m_firstBody; }
@@ -405,9 +406,23 @@ class CORE_EXPORT LayoutTable final : public LayoutBlock {
void paintMask(const PaintInfo&, const LayoutPoint&) const final;
- const CollapsedBorderValues& collapsedBorders() const {
- ASSERT(m_collapsedBordersValid);
- return m_collapsedBorders;
+ struct CollapsedBordersInfo {
+ explicit CollapsedBordersInfo(const Vector<CollapsedBorderValue>& values)
+ : values(std::move(values)) {}
+
+ PaintResult lastPaintResult = FullyPainted;
+ CullRect lastPaintRect;
+ const Vector<CollapsedBorderValue> values;
+ };
+
+ bool hasCollapsedBorders() const {
+ DCHECK(m_collapsedBordersValid);
+ DCHECK(!m_collapsedBordersInfo || collapseBorders());
+ return !!m_collapsedBordersInfo;
+ }
+ CollapsedBordersInfo& getCollapsedBordersInfo() const {
+ DCHECK(hasCollapsedBorders());
+ return *m_collapsedBordersInfo;
}
void subtractCaptionRect(LayoutRect&) const;
@@ -550,7 +565,7 @@ class CORE_EXPORT LayoutTable final : public LayoutBlock {
// need to compare a cells border against all the adjoining cells, rows,
// row groups, column, column groups and table. Thus we cache them in this
// field.
- CollapsedBorderValues m_collapsedBorders;
+ std::unique_ptr<CollapsedBordersInfo> m_collapsedBordersInfo;
bool m_collapsedBordersValid : 1;
mutable bool m_hasColElements : 1;

Powered by Google App Engine
This is Rietveld 408576698