+2011-03-10 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ Some Gtk code uses defined(USE_FREETYPE) instead of just USE(FREETYPE)
+ https://bugs.webkit.org/show_bug.cgi?id=55996
+
+ Use the macre USE instead of defined fro WTF_USE_FREETYPE and
+ WTF_USE_PANGO.
+
+ * GNUmakefile.am:
+ * platform/graphics/cairo/OwnPtrCairo.cpp:
+ * platform/graphics/cairo/OwnPtrCairo.h:
+ * platform/graphics/cairo/RefPtrCairo.cpp:
+ * platform/graphics/cairo/RefPtrCairo.h:
+ * platform/graphics/gtk/FontGtk.cpp:
+ (WebCore::setPangoAttributes):
+ (WebCore::Font::drawComplexText):
+ (WebCore::Font::floatWidthForComplexText):
+ (WebCore::Font::offsetForPositionForComplexText):
+ (WebCore::Font::selectionRectForComplexText):
+
2011-03-10 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
typedef struct _cairo_scaled_font cairo_scaled_font_t;
typedef struct _cairo_pattern cairo_pattern_t;
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
typedef struct _FcPattern FcPattern;
#endif
template<> void refIfNotNull(cairo_pattern_t*);
template<> void derefIfNotNull(cairo_pattern_t*);
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
template<> void refIfNotNull(FcPattern* ptr);
template<> void derefIfNotNull(FcPattern* ptr);
#endif
#include <pango/pango.h>
#include <pango/pangocairo.h>
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
#include <pango/pangofc-fontmap.h>
#endif
static void setPangoAttributes(const Font* font, const TextRun& run, PangoLayout* layout)
{
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
if (font->primaryFont()->platformData().m_pattern) {
PangoFontDescription* desc = pango_fc_font_description_from_pattern(font->primaryFont()->platformData().m_pattern.get(), FALSE);
pango_layout_set_font_description(layout, desc);
pango_font_description_free(desc);
}
-#elif defined(USE_PANGO)
+#elif USE(PANGO)
if (font->primaryFont()->platformData().m_font) {
PangoFontDescription* desc = pango_font_describe(font->primaryFont()->platformData().m_font);
pango_layout_set_font_description(layout, desc);
void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
{
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
if (!primaryFont()->platformData().m_pattern) {
drawSimpleText(context, run, point, from, to);
return;
float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* overflow) const
{
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
if (!primaryFont()->platformData().m_pattern)
return floatWidthForSimpleText(run, 0, fallbackFonts, overflow);
#endif
int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool includePartialGlyphs) const
{
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
if (!primaryFont()->platformData().m_pattern)
return offsetForPositionForSimpleText(run, xFloat, includePartialGlyphs);
#endif
FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& point, int h, int from, int to) const
{
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
if (!primaryFont()->platformData().m_pattern)
return selectionRectForSimpleText(run, point, h, from, to);
#endif