[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
mrobinson at webkit.org
mrobinson at webkit.org
Wed Dec 22 14:38:32 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 0a6a72eeb2f7d6eb3df3047a3de50caa5b2eea9c
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 14 18:52:52 2010 +0000
2010-10-01 Martin Robinson <mrobinson at igalia.com>
Reviewed by Holger Freyther.
[GTK] REGRESSION: FreeType backend does not respect XSettings font settings after r68558
https://bugs.webkit.org/show_bug.cgi?id=47033
Added a platform-specific test which verifies that if XSettings
specifies subpixel aliasing, it is the default rendering style.
* platform/gtk/fonts/xsettings_antialias_settings-expected.checksum: Added.
* platform/gtk/fonts/xsettings_antialias_settings-expected.png: Added.
* platform/gtk/fonts/xsettings_antialias_settings-expected.txt: Added.
* platform/gtk/fonts/xsettings_antialias_settings.html: Added.
2010-10-01 Martin Robinson <mrobinson at igalia.com>
Reviewed by Holger Freyther.
[GTK] REGRESSION: FreeType backend does not respect XSettings font settings after r68558
https://bugs.webkit.org/show_bug.cgi?id=47033
Fix logic that merges XSettings defaults and FontConfig settings. If
FontConfig or XSettings specifies a subpixel order, we force subpixel
anti-aliasing on. If anti-aliasing is turned on explicitly, only
override the setting if it was previously off, otherwise we ignore
the user's preference for subpixel or gray antialiasing.
Test: platform/gtk/fonts/xsettings_antialias_settings.html
* platform/graphics/cairo/FontPlatformDataFreeType.cpp:
(WebCore::setCairoFontOptionsFromFontConfigPattern): Fix merging of XSettings
and FontConfig anti-aliasing settings.
(WebCore::getDefaultFontOptions): Added this helper.
(WebCore::FontPlatformData::FontPlatformData): Use the getDefaultFontOptions helper.
2010-10-01 Martin Robinson <mrobinson at igalia.com>
Reviewed by Holger Freyther.
[GTK] REGRESSION: FreeType backend does not respect XSettings font settings after r68558
https://bugs.webkit.org/show_bug.cgi?id=47033
* DumpRenderTree/gtk/DumpRenderTree.cpp:
(initializeGtkFontSettings): Added this method which initializes XSettings
font settings to consistent values before running a test. For the one test
in which we need subpixel aliasing turned on, do that.
(initializeFonts): Accepts a testURL parameter now and delegates to initializeGtkFontSettings.
(runTest): Pass the testURL to initializeFonts.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d590080..dd33fd3 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-01 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Holger Freyther.
+
+ [GTK] REGRESSION: FreeType backend does not respect XSettings font settings after r68558
+ https://bugs.webkit.org/show_bug.cgi?id=47033
+
+ Added a platform-specific test which verifies that if XSettings
+ specifies subpixel aliasing, it is the default rendering style.
+
+ * platform/gtk/fonts/xsettings_antialias_settings-expected.checksum: Added.
+ * platform/gtk/fonts/xsettings_antialias_settings-expected.png: Added.
+ * platform/gtk/fonts/xsettings_antialias_settings-expected.txt: Added.
+ * platform/gtk/fonts/xsettings_antialias_settings.html: Added.
+
2010-10-14 Nate Chapin <japhet at chromium.org>
Unreviewed, test tweaks.
diff --git a/LayoutTests/platform/gtk/fonts/xsettings_antialias_settings-expected.checksum b/LayoutTests/platform/gtk/fonts/xsettings_antialias_settings-expected.checksum
new file mode 100644
index 0000000..e7fd057
--- /dev/null
+++ b/LayoutTests/platform/gtk/fonts/xsettings_antialias_settings-expected.checksum
@@ -0,0 +1 @@
+33538b04b035bdb24e596e2b1105fd71
\ No newline at end of file
diff --git a/LayoutTests/platform/gtk/fonts/xsettings_antialias_settings-expected.png b/LayoutTests/platform/gtk/fonts/xsettings_antialias_settings-expected.png
new file mode 100644
index 0000000..aaffb89
Binary files /dev/null and b/LayoutTests/platform/gtk/fonts/xsettings_antialias_settings-expected.png differ
diff --git a/LayoutTests/platform/gtk/fonts/xsettings_antialias_settings-expected.txt b/LayoutTests/platform/gtk/fonts/xsettings_antialias_settings-expected.txt
new file mode 100644
index 0000000..31d6417
--- /dev/null
+++ b/LayoutTests/platform/gtk/fonts/xsettings_antialias_settings-expected.txt
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x576
+ RenderBlock {P} at (0,0) size 784x38
+ RenderText {#text} at (0,0) size 761x38
+ text run at (0,0) width 434: "This text should be rendered with subpixel anti-aliasing turned on if your "
+ text run at (434,0) width 327: "XSettings specifies that. This should always be true for"
+ text run at (0,19) width 63: "this test in "
+ text run at (63,19) width 113: "DumpRenderTree."
diff --git a/LayoutTests/platform/gtk/fonts/xsettings_antialias_settings.html b/LayoutTests/platform/gtk/fonts/xsettings_antialias_settings.html
new file mode 100644
index 0000000..cd863c9
--- /dev/null
+++ b/LayoutTests/platform/gtk/fonts/xsettings_antialias_settings.html
@@ -0,0 +1,9 @@
+<html>
+ <body>
+ <p style="font-family: serif;">
+ This text should be rendered with subpixel anti-aliasing turned on if your
+ XSettings specifies that. This should always be true for this test in
+ DumpRenderTree.
+ </p>
+ </body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 00e4df9..199850b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-10-01 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Holger Freyther.
+
+ [GTK] REGRESSION: FreeType backend does not respect XSettings font settings after r68558
+ https://bugs.webkit.org/show_bug.cgi?id=47033
+
+ Fix logic that merges XSettings defaults and FontConfig settings. If
+ FontConfig or XSettings specifies a subpixel order, we force subpixel
+ anti-aliasing on. If anti-aliasing is turned on explicitly, only
+ override the setting if it was previously off, otherwise we ignore
+ the user's preference for subpixel or gray antialiasing.
+
+ Test: platform/gtk/fonts/xsettings_antialias_settings.html
+
+ * platform/graphics/cairo/FontPlatformDataFreeType.cpp:
+ (WebCore::setCairoFontOptionsFromFontConfigPattern): Fix merging of XSettings
+ and FontConfig anti-aliasing settings.
+ (WebCore::getDefaultFontOptions): Added this helper.
+ (WebCore::FontPlatformData::FontPlatformData): Use the getDefaultFontOptions helper.
+
2010-10-14 Jian Li <jianli at chromium.org>
Reviewed by David Levin.
diff --git a/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp
index d09ca74..ba307fa 100644
--- a/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp
+++ b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp
@@ -75,23 +75,44 @@ void setCairoFontOptionsFromFontConfigPattern(cairo_font_options_t* options, FcP
FcBool booleanResult;
int integerResult;
- // We will determine if subpixel anti-aliasing is enabled via the FC_RGBA setting.
- if (FcPatternGetBool(pattern, FC_ANTIALIAS, 0, &booleanResult) == FcResultMatch && booleanResult)
- cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_GRAY);
-
if (FcPatternGetInteger(pattern, FC_RGBA, 0, &integerResult) == FcResultMatch) {
+ cairo_font_options_set_subpixel_order(options, convertFontConfigSubpixelOrder(integerResult));
+
+ // Based on the logic in cairo-ft-font.c in the cairo source, a font with
+ // a subpixel order implies that is uses subpixel antialiasing.
if (integerResult != FC_RGBA_NONE)
cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_SUBPIXEL);
- cairo_font_options_set_subpixel_order(options, convertFontConfigSubpixelOrder(integerResult));
+ }
+
+ if (FcPatternGetBool(pattern, FC_ANTIALIAS, 0, &booleanResult) == FcResultMatch) {
+ // Only override the anti-aliasing setting if was previously turned off. Otherwise
+ // we'll override the preference which decides between gray anti-aliasing and
+ // subpixel anti-aliasing.
+ if (!booleanResult)
+ cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_NONE);
+ else if (cairo_font_options_get_antialias(options) == CAIRO_ANTIALIAS_NONE)
+ cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_GRAY);
}
if (FcPatternGetInteger(pattern, FC_HINT_STYLE, 0, &integerResult) == FcResultMatch)
cairo_font_options_set_hint_style(options, convertFontConfigHintStyle(integerResult));
-
if (FcPatternGetBool(pattern, FC_HINTING, 0, &booleanResult) == FcResultMatch && !booleanResult)
cairo_font_options_set_hint_style(options, CAIRO_HINT_STYLE_NONE);
}
+static const cairo_font_options_t* getDefaultFontOptions()
+{
+ static const cairo_font_options_t* options = cairo_font_options_create();
+#if PLATFORM(GTK) || ENABLE(GLIB_SUPPORT)
+ if (GdkScreen* screen = gdk_screen_get_default()) {
+ const cairo_font_options_t* screenOptions = gdk_screen_get_font_options(screen);
+ if (screenOptions)
+ options = screenOptions;
+ }
+#endif
+ return options;
+}
+
FontPlatformData::FontPlatformData(FcPattern* pattern, const FontDescription& fontDescription)
: m_pattern(pattern)
, m_fallbacks(0)
@@ -209,15 +230,7 @@ String FontPlatformData::description() const
void FontPlatformData::initializeWithFontFace(cairo_font_face_t* fontFace)
{
- cairo_font_options_t* options = 0;
-#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT)
- if (GdkScreen* screen = gdk_screen_get_default())
- options = cairo_font_options_copy(gdk_screen_get_font_options(screen));
-#endif
- // gdk_screen_get_font_options() returns null if no default
- // options are set, so we always have to check.
- if (!options)
- options = cairo_font_options_create();
+ cairo_font_options_t* options = cairo_font_options_copy(getDefaultFontOptions());
cairo_matrix_t ctm;
cairo_matrix_init_identity(&ctm);
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 93f46e4..46ae572 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,17 @@
+2010-10-01 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Holger Freyther.
+
+ [GTK] REGRESSION: FreeType backend does not respect XSettings font settings after r68558
+ https://bugs.webkit.org/show_bug.cgi?id=47033
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeGtkFontSettings): Added this method which initializes XSettings
+ font settings to consistent values before running a test. For the one test
+ in which we need subpixel aliasing turned on, do that.
+ (initializeFonts): Accepts a testURL parameter now and delegates to initializeGtkFontSettings.
+ (runTest): Pass the testURL to initializeFonts.
+
2010-10-14 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
index c382eae..7612b09 100644
--- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -131,9 +131,28 @@ static void appendString(gchar*& target, gchar* string)
g_free(oldString);
}
-static void initializeFonts()
+static void initializeGtkFontSettings(const char* testURL)
+{
+ GtkSettings* settings = gtk_settings_get_default();
+ if (!settings)
+ return;
+ g_object_set(settings, "gtk-xft-antialias", 1, NULL);
+ g_object_set(settings, "gtk-xft-hinting", 1, NULL);
+ g_object_set(settings, "gtk-xft-hintstyle", "hintfull", NULL);
+
+ // One test needs subpixel anti-aliasing turned on, but generally we
+ // want all text in other tests to use to grayscale anti-aliasing.
+ if (testURL && strstr(testURL, "xsettings_antialias_settings.html"))
+ g_object_set(settings, "gtk-xft-rgba", "rgb", NULL);
+ else
+ g_object_set(settings, "gtk-xft-rgba", "none", NULL);
+}
+
+static void initializeFonts(const char* testURL = 0)
{
#if PLATFORM(X11)
+ initializeGtkFontSettings(testURL);
+
FcInit();
// If a test resulted a font being added or removed via the @font-face rule, then
@@ -614,7 +633,7 @@ static void runTest(const string& testPathOrURL)
if (prevTestBFItem)
g_object_ref(prevTestBFItem);
- initializeFonts();
+ initializeFonts(testURL.c_str());
// Focus the web view before loading the test to avoid focusing problems
gtk_widget_grab_focus(GTK_WIDGET(webView));
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list