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

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

Issue 1306433002: Let collapsed border drawings be cacheable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaseline layout tests Created 5 years, 4 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/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&) { }

Powered by Google App Engine
This is Rietveld 408576698