Rename FontGtk.cpp to FontPango.cpp

https://bugs.webkit.org/show_bug.cgi?id=66323

Patch by Rafael Antognolli <antognolli@profusion.mobi> on 2011-09-09
Reviewed by Martin Robinson.

This file will be used by the EFL port too, and since it's not GTK
specific anymore, rename it to something better.

No new functionality so no new tests.

* GNUmakefile.list.am:
* platform/graphics/pango/FontPango.cpp: Renamed from Source/WebCore/platform/graphics/gtk/FontGtk.cpp.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 990518aa
2011-09-09 Rafael Antognolli <antognolli@profusion.mobi>
Rename FontGtk.cpp to FontPango.cpp
https://bugs.webkit.org/show_bug.cgi?id=66323
Reviewed by Martin Robinson.
This file will be used by the EFL port too, and since it's not GTK
specific anymore, rename it to something better.
No new functionality so no new tests.
* GNUmakefile.list.am:
* platform/graphics/pango/FontPango.cpp: Renamed from Source/WebCore/platform/graphics/gtk/FontGtk.cpp.
2011-09-09 Adam Klein <adamk@chromium.org>
Initialize ExceptionCode in Element::removeAttribute
......@@ -3959,7 +3959,6 @@ webcoregtk_sources += \
Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp \
Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h \
Source/WebCore/platform/graphics/gtk/ColorGtk.cpp \
Source/WebCore/platform/graphics/gtk/FontGtk.cpp \
Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.cpp \
Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.h \
Source/WebCore/platform/graphics/gtk/IconGtk.cpp \
......@@ -4085,6 +4084,7 @@ webcore_sources += \
Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp \
Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
webcoregtk_sources += \
Source/WebCore/platform/graphics/pango/FontPango.cpp \
Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp
endif # END USE_FREETYPE
......@@ -4099,6 +4099,8 @@ webcore_sources += \
Source/WebCore/platform/graphics/pango/FontPlatformData.h \
Source/WebCore/platform/graphics/pango/GlyphPageTreeNodePango.cpp \
Source/WebCore/platform/graphics/pango/SimpleFontDataPango.cpp
webcoregtk_sources += \
Source/WebCore/platform/graphics/pango/FontPango.cpp
endif # END USE_PANGO
# ----
......
......@@ -334,7 +334,7 @@ void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const
static PangoLayout* getDefaultPangoLayout(const TextRun& run)
{
static PangoFontMap* map = pango_cairo_font_map_get_default();
#if PANGO_VERSION_CHECK(1,21,5)
#if PANGO_VERSION_CHECK(1, 21, 5)
static PangoContext* pangoContext = pango_font_map_create_context(map);
#else
// Deprecated in Pango 1.21.
......@@ -352,7 +352,7 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
return floatWidthForSimpleText(run, 0, fallbackFonts, overflow);
#endif
if (run.length() == 0)
if (!run.length())
return 0.0f;
PangoLayout* layout = getDefaultPangoLayout(run);
......@@ -423,17 +423,17 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint
}
PangoLayoutLine* layoutLine = pango_layout_get_line_readonly(layout, 0);
int x_pos;
int xPos;
x_pos = 0;
xPos = 0;
if (from < layoutLine->length)
pango_layout_line_index_to_x(layoutLine, from, FALSE, &x_pos);
float beforeWidth = PANGO_PIXELS_FLOOR(x_pos);
pango_layout_line_index_to_x(layoutLine, from, FALSE, &xPos);
float beforeWidth = PANGO_PIXELS_FLOOR(xPos);
x_pos = 0;
xPos = 0;
if (run.ltr() || to < layoutLine->length)
pango_layout_line_index_to_x(layoutLine, to, FALSE, &x_pos);
float afterWidth = PANGO_PIXELS(x_pos);
pango_layout_line_index_to_x(layoutLine, to, FALSE, &xPos);
float afterWidth = PANGO_PIXELS(xPos);
g_free(utf8);
g_object_unref(layout);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment