2011-03-10 Alejandro G. Castro <alex@igalia.com>
authoralex@webkit.org <alex@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Mar 2011 20:32:48 +0000 (20:32 +0000)
committeralex@webkit.org <alex@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Mar 2011 20:32:48 +0000 (20:32 +0000)
        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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80744 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.am
Source/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp
Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h
Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp
Source/WebCore/platform/graphics/cairo/RefPtrCairo.h
Source/WebCore/platform/graphics/gtk/FontGtk.cpp

index 90730ac..2c42770 100644 (file)
@@ -1,3 +1,25 @@
+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.
index 5e81dfa..bac0944 100644 (file)
@@ -3902,7 +3902,7 @@ endif # END ENABLE_FAST_MOBILE_SCROLLING
 # ---
 if USE_FREETYPE
 webcoregtk_cppflags += \
-       -DUSE_FREETYPE=1 \
+       -DWTF_USE_FREETYPE=1 \
        -I$(srcdir)/Source/WebCore/platform/graphics/freetype
 
 webcoregtk_sources += \
@@ -3919,7 +3919,7 @@ endif # END USE_FREETYPE
 # ---
 if USE_PANGO
 webcoregtk_cppflags += \
-       -DUSE_PANGO=1 \
+       -DWTF_USE_PANGO=1 \
        -I$(srcdir)/Source/WebCore/platform/graphics/pango
 
 webcoregtk_sources += \
index 94f6809..1594e7b 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "OwnPtrCairo.h"
 
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
 #include <cairo-ft.h>
 #include <fontconfig/fcfreetype.h>
 #endif
@@ -29,7 +29,7 @@
 
 namespace WTF {
 
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
 template <> void deleteOwnedPtr<FcObjectSet>(FcObjectSet* ptr)
 {
     if (ptr)
index 035d80e..e1dd370 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "OwnPtr.h"
 
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
 typedef struct _FcObjectSet FcObjectSet;
 typedef struct _FcFontSet FcFontSet;
 #endif
@@ -31,7 +31,7 @@ typedef struct cairo_path cairo_path_t;
 
 namespace WTF {
 
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
 template <> void deleteOwnedPtr<FcObjectSet>(FcObjectSet*);
 template <> void deleteOwnedPtr<FcFontSet>(FcFontSet*);
 #endif
index c8b242c..1792002 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <cairo.h>
 
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
 #include <cairo-ft.h>
 #include <fontconfig/fcfreetype.h>
 #endif
@@ -88,7 +88,7 @@ template<> void derefIfNotNull(cairo_pattern_t* ptr)
         cairo_pattern_destroy(ptr);
 }
 
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
 template<> void refIfNotNull(FcPattern* ptr)
 {
     if (LIKELY(ptr != 0))
index 204d1e3..540f9dc 100644 (file)
@@ -28,7 +28,7 @@ typedef struct _cairo_font_face cairo_font_face_t;
 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
 
@@ -49,7 +49,7 @@ template<> void derefIfNotNull(cairo_scaled_font_t* ptr);
 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
index 216fb56..654adac 100644 (file)
@@ -44,7 +44,7 @@
 #include <pango/pango.h>
 #include <pango/pangocairo.h>
 
-#if defined(USE_FREETYPE)
+#if USE(FREETYPE)
 #include <pango/pangofc-fontmap.h>
 #endif
 
@@ -171,13 +171,13 @@ static gchar* convertUniCharToUTF8(const UChar* characters, gint length, int fro
 
 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);
@@ -268,7 +268,7 @@ static void drawGlyphsShadow(GraphicsContext* graphicsContext, cairo_t* context,
 
 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;
@@ -348,7 +348,7 @@ static PangoLayout* getDefaultPangoLayout(const TextRun& run)
 
 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
@@ -373,7 +373,7 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
 
 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
@@ -401,7 +401,7 @@ int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool
 
 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