Changeset 69786 in webkit
- Timestamp:
- Oct 14, 2010 11:52:52 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r69785 r69786 1 2010-10-01 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Holger Freyther. 4 5 [GTK] REGRESSION: FreeType backend does not respect XSettings font settings after r68558 6 https://bugs.webkit.org/show_bug.cgi?id=47033 7 8 Added a platform-specific test which verifies that if XSettings 9 specifies subpixel aliasing, it is the default rendering style. 10 11 * platform/gtk/fonts/xsettings_antialias_settings-expected.checksum: Added. 12 * platform/gtk/fonts/xsettings_antialias_settings-expected.png: Added. 13 * platform/gtk/fonts/xsettings_antialias_settings-expected.txt: Added. 14 * platform/gtk/fonts/xsettings_antialias_settings.html: Added. 15 1 16 2010-10-14 Nate Chapin <japhet@chromium.org> 2 17 -
trunk/WebCore/ChangeLog
r69782 r69786 1 2010-10-01 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Holger Freyther. 4 5 [GTK] REGRESSION: FreeType backend does not respect XSettings font settings after r68558 6 https://bugs.webkit.org/show_bug.cgi?id=47033 7 8 Fix logic that merges XSettings defaults and FontConfig settings. If 9 FontConfig or XSettings specifies a subpixel order, we force subpixel 10 anti-aliasing on. If anti-aliasing is turned on explicitly, only 11 override the setting if it was previously off, otherwise we ignore 12 the user's preference for subpixel or gray antialiasing. 13 14 Test: platform/gtk/fonts/xsettings_antialias_settings.html 15 16 * platform/graphics/cairo/FontPlatformDataFreeType.cpp: 17 (WebCore::setCairoFontOptionsFromFontConfigPattern): Fix merging of XSettings 18 and FontConfig anti-aliasing settings. 19 (WebCore::getDefaultFontOptions): Added this helper. 20 (WebCore::FontPlatformData::FontPlatformData): Use the getDefaultFontOptions helper. 21 1 22 2010-10-14 Jian Li <jianli@chromium.org> 2 23 -
trunk/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp
r69776 r69786 76 76 int integerResult; 77 77 78 // We will determine if subpixel anti-aliasing is enabled via the FC_RGBA setting.79 if (FcPatternGetBool(pattern, FC_ANTIALIAS, 0, &booleanResult) == FcResultMatch && booleanResult)80 cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_GRAY);81 82 78 if (FcPatternGetInteger(pattern, FC_RGBA, 0, &integerResult) == FcResultMatch) { 79 cairo_font_options_set_subpixel_order(options, convertFontConfigSubpixelOrder(integerResult)); 80 81 // Based on the logic in cairo-ft-font.c in the cairo source, a font with 82 // a subpixel order implies that is uses subpixel antialiasing. 83 83 if (integerResult != FC_RGBA_NONE) 84 84 cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_SUBPIXEL); 85 cairo_font_options_set_subpixel_order(options, convertFontConfigSubpixelOrder(integerResult)); 85 } 86 87 if (FcPatternGetBool(pattern, FC_ANTIALIAS, 0, &booleanResult) == FcResultMatch) { 88 // Only override the anti-aliasing setting if was previously turned off. Otherwise 89 // we'll override the preference which decides between gray anti-aliasing and 90 // subpixel anti-aliasing. 91 if (!booleanResult) 92 cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_NONE); 93 else if (cairo_font_options_get_antialias(options) == CAIRO_ANTIALIAS_NONE) 94 cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_GRAY); 86 95 } 87 96 88 97 if (FcPatternGetInteger(pattern, FC_HINT_STYLE, 0, &integerResult) == FcResultMatch) 89 98 cairo_font_options_set_hint_style(options, convertFontConfigHintStyle(integerResult)); 90 91 99 if (FcPatternGetBool(pattern, FC_HINTING, 0, &booleanResult) == FcResultMatch && !booleanResult) 92 100 cairo_font_options_set_hint_style(options, CAIRO_HINT_STYLE_NONE); 101 } 102 103 static const cairo_font_options_t* getDefaultFontOptions() 104 { 105 static const cairo_font_options_t* options = cairo_font_options_create(); 106 #if PLATFORM(GTK) || ENABLE(GLIB_SUPPORT) 107 if (GdkScreen* screen = gdk_screen_get_default()) { 108 const cairo_font_options_t* screenOptions = gdk_screen_get_font_options(screen); 109 if (screenOptions) 110 options = screenOptions; 111 } 112 #endif 113 return options; 93 114 } 94 115 … … 210 231 void FontPlatformData::initializeWithFontFace(cairo_font_face_t* fontFace) 211 232 { 212 cairo_font_options_t* options = 0; 213 #if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT) 214 if (GdkScreen* screen = gdk_screen_get_default()) 215 options = cairo_font_options_copy(gdk_screen_get_font_options(screen)); 216 #endif 217 // gdk_screen_get_font_options() returns null if no default 218 // options are set, so we always have to check. 219 if (!options) 220 options = cairo_font_options_create(); 233 cairo_font_options_t* options = cairo_font_options_copy(getDefaultFontOptions()); 221 234 222 235 cairo_matrix_t ctm; -
trunk/WebKitTools/ChangeLog
r69770 r69786 1 2010-10-01 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Holger Freyther. 4 5 [GTK] REGRESSION: FreeType backend does not respect XSettings font settings after r68558 6 https://bugs.webkit.org/show_bug.cgi?id=47033 7 8 * DumpRenderTree/gtk/DumpRenderTree.cpp: 9 (initializeGtkFontSettings): Added this method which initializes XSettings 10 font settings to consistent values before running a test. For the one test 11 in which we need subpixel aliasing turned on, do that. 12 (initializeFonts): Accepts a testURL parameter now and delegates to initializeGtkFontSettings. 13 (runTest): Pass the testURL to initializeFonts. 14 1 15 2010-10-14 Adam Barth <abarth@webkit.org> 2 16 -
trunk/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
r69528 r69786 132 132 } 133 133 134 static void initializeFonts() 134 static void initializeGtkFontSettings(const char* testURL) 135 { 136 GtkSettings* settings = gtk_settings_get_default(); 137 if (!settings) 138 return; 139 g_object_set(settings, "gtk-xft-antialias", 1, NULL); 140 g_object_set(settings, "gtk-xft-hinting", 1, NULL); 141 g_object_set(settings, "gtk-xft-hintstyle", "hintfull", NULL); 142 143 // One test needs subpixel anti-aliasing turned on, but generally we 144 // want all text in other tests to use to grayscale anti-aliasing. 145 if (testURL && strstr(testURL, "xsettings_antialias_settings.html")) 146 g_object_set(settings, "gtk-xft-rgba", "rgb", NULL); 147 else 148 g_object_set(settings, "gtk-xft-rgba", "none", NULL); 149 } 150 151 static void initializeFonts(const char* testURL = 0) 135 152 { 136 153 #if PLATFORM(X11) 154 initializeGtkFontSettings(testURL); 155 137 156 FcInit(); 138 157 … … 615 634 g_object_ref(prevTestBFItem); 616 635 617 initializeFonts( );636 initializeFonts(testURL.c_str()); 618 637 619 638 // Focus the web view before loading the test to avoid focusing problems
Note: See TracChangeset
for help on using the changeset viewer.