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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h

Issue 2495343002: Revert of Paint collapsed borders of a table as one display item (Closed)
Patch Set: 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/platform/graphics/paint/DisplayItem.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h b/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
index 591a3e7750328476ed52a22fae487484cbc5bc53..69d04570510f9311d02c16038e32b708bf2da1ce 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
@@ -110,7 +110,15 @@
kTableCellBackgroundFromColumn,
kTableCellBackgroundFromSection,
kTableCellBackgroundFromRow,
- kTableCollapsedBorders,
+ // Table collapsed borders can be painted together (e.g., left & top) but
+ // there are at most 4 phases of collapsed border painting for a single
+ // cell. To disambiguate these phases of collapsed border painting, a mask
+ // is used. TableCollapsedBorderBase can be larger than
+ // TableCollapsedBorderUnalignedBase to ensure the base lower bits are 0's.
+ kTableCollapsedBorderUnalignedBase,
+ kTableCollapsedBorderBase =
+ (((kTableCollapsedBorderUnalignedBase - 1) >> 4) + 1) << 4,
+ kTableCollapsedBorderLast = kTableCollapsedBorderBase + 0x0f,
kTableSectionBoxShadowInset,
kTableSectionBoxShadowNormal,
kTableRowBoxShadowInset,
@@ -194,6 +202,19 @@
kTypeLast = kUninitializedType
};
+ static_assert(kTableCollapsedBorderBase >= kTableCollapsedBorderUnalignedBase,
+ "TableCollapsedBorder types overlap with other types");
+ static_assert((kTableCollapsedBorderBase & 0xf) == 0,
+ "The lowest 4 bits of TableCollapsedBorderBase should be zero");
+ // Bits or'ed onto TableCollapsedBorderBase to generate a real table collapsed
+ // border type.
+ enum TableCollapsedBorderSides {
+ TableCollapsedBorderTop = 1 << 0,
+ TableCollapsedBorderRight = 1 << 1,
+ TableCollapsedBorderBottom = 1 << 2,
+ TableCollapsedBorderLeft = 1 << 3,
+ };
+
DisplayItem(const DisplayItemClient& client, Type type, size_t derivedSize)
: m_client(&client),
m_type(type),

Powered by Google App Engine
This is Rietveld 408576698