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

Unified Diff: Source/platform/fonts/FontData.h

Issue 401553002: Introduce DEFINE_FONT_DATA_TYPE_CASTS, and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | Source/platform/fonts/FontFallbackList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/FontData.h
diff --git a/Source/platform/fonts/FontData.h b/Source/platform/fonts/FontData.h
index fb4a65441cb3eb9c9d516b0b1d21d6f741dc31ca..a24d7030ebd959f2143bcb9c8009841df1fcfbd9 100644
--- a/Source/platform/fonts/FontData.h
+++ b/Source/platform/fonts/FontData.h
@@ -67,6 +67,10 @@ private:
mutable unsigned m_maxGlyphPageTreeLevel;
};
+#define DEFINE_FONT_DATA_TYPE_CASTS(thisType, predicate) \
+ template<typename T> inline thisType* to##thisType(const RefPtr<T>& fontData) { return to##thisType(fontData.get()); } \
+ DEFINE_TYPE_CASTS(thisType, FontData, fontData, fontData->isSegmented() == predicate, fontData.isSegmented() == predicate)
+
} // namespace WebCore
#endif // FontData_h
« no previous file with comments | « no previous file | Source/platform/fonts/FontFallbackList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698