Chromium Code Reviews| Index: Source/platform/graphics/paint/DisplayItem.h |
| diff --git a/Source/platform/graphics/paint/DisplayItem.h b/Source/platform/graphics/paint/DisplayItem.h |
| index c5cecd6d1c20a05f2f85466716919f60768c1eef..1f4f85b9a76df0dba6fae4b0ca16ad19d5b755af 100644 |
| --- a/Source/platform/graphics/paint/DisplayItem.h |
| +++ b/Source/platform/graphics/paint/DisplayItem.h |
| @@ -91,6 +91,9 @@ public: |
| SelectionGap, |
| SelectionTint, |
| TableCellBackgroundFromSelfPaintingRow, // FIXME: To be deprecated. |
| + TableCollapsedBorderUnalignedBase, |
|
pdr.
2015/08/20 07:07:15
This represents a whole bunch of new types just fo
Xianzhu
2015/08/20 16:39:51
I know the 16 new types may look scary :), but thi
|
| + TableCollapsedBorderBase = (((TableCollapsedBorderUnalignedBase - 1) >> 4) + 1) << 4, |
| + TableCollapsedBorderLast = TableCollapsedBorderBase + 0x0f, |
| VideoBitmap, |
| WebPlugin, |
| WebFont, |
| @@ -178,6 +181,16 @@ public: |
| TypeLast = UninitializedType |
| }; |
| + static_assert(TableCollapsedBorderBase >= TableCollapsedBorderUnalignedBase, "TableCollapsedBorder types overlap with other types"); |
| + static_assert((TableCollapsedBorderBase & 0xf) == 0, "The lowest 4 bits of TableCollapsedBorderBase should be zero"); |
| + enum TableCollspaedBorderSides { |
| + // Bits or'ed onto TableCollapsedBorderBase to generate a real table collapsed border type. |
| + TableCollapsedBorderTop = 1 << 0, |
| + TableCollapsedBorderRight = 1 << 1, |
| + TableCollapsedBorderBottom = 1 << 2, |
| + TableCollapsedBorderLeft = 1 << 3, |
| + }; |
| + |
| DisplayItem(const DisplayItemClientWrapper& client, Type type, size_t derivedSize) |
| : m_client(client.displayItemClient()) |
| , m_scope(0) |
| @@ -219,19 +232,19 @@ public: |
| }; |
| // Convert cached type to non-cached type (e.g., Type::CachedSVGImage -> Type::SVGImage). |
| - Type nonCachedType() const |
| + static Type nonCachedType(Type type) |
| { |
| - if (isCachedDrawingType(m_type)) |
| - return cachedDrawingTypeToDrawingType(m_type); |
| - if (isCachedSubtreeType(m_type)) |
| - return cachedSubtreeTypeToBeginSubtreeType(m_type); |
| - return m_type; |
| + if (isCachedDrawingType(type)) |
| + return cachedDrawingTypeToDrawingType(type); |
| + if (isCachedSubtreeType(type)) |
| + return cachedSubtreeTypeToBeginSubtreeType(type); |
| + return type; |
| } |
| // Return the Id with cached type converted to non-cached type. |
| Id nonCachedId() const |
| { |
| - return Id(m_client, nonCachedType(), m_scope); |
| + return Id(m_client, nonCachedType(m_type), m_scope); |
| } |
| virtual void replay(GraphicsContext&) { } |