bug 719410 pt 1 - don't use subpixel AA under GDI/DirectWrite if ClearType is disabled system-wide. r=bas
authorJonathan Kew <jfkthame@gmail.com>
Tue, 06 Mar 2012 17:38:55 +0000
changeset 88384 c5a5f5ad069133ed176a79d238a417e45ad73f5c
parent 88383 aa7d28b45edef3c0eb69b8543b5a0cec78b9d375
child 88385 317d3d5ca142b94091a82eec77b3ed17ac5ef61e
push id22194
push usermak77@bonardo.net
push dateWed, 07 Mar 2012 09:33:54 +0000
treeherdermozilla-central@8ef88a69f861 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas
bugs719410
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 719410 pt 1 - don't use subpixel AA under GDI/DirectWrite if ClearType is disabled system-wide. r=bas
gfx/cairo/cairo/src/cairo-dwrite-font.cpp
--- a/gfx/cairo/cairo/src/cairo-dwrite-font.cpp
+++ b/gfx/cairo/cairo/src/cairo-dwrite-font.cpp
@@ -1152,17 +1152,27 @@ cairo_int_status_t
 	rt->SetCurrentTransform(transform);
     }
     BitBlt(rt->GetMemoryDC(),
 	   0, 0,
 	   area.right - area.left, area.bottom - area.top,
 	   surface->dc,
 	   area.left, area.top, 
 	   SRCCOPY | NOMIRRORBITMAP);
-    HRESULT hr = rt->DrawGlyphRun(0, 0, DWRITE_MEASURING_MODE_NATURAL, run, params, color);
+    DWRITE_MEASURING_MODE measureMode; 
+    switch (scaled_font->rendering_mode) {
+    case cairo_d2d_surface_t::TEXT_RENDERING_GDI_CLASSIC:
+    case cairo_d2d_surface_t::TEXT_RENDERING_NO_CLEARTYPE:
+        measureMode = DWRITE_MEASURING_MODE_GDI_CLASSIC;
+        break;
+    default:
+        measureMode = DWRITE_MEASURING_MODE_NATURAL;
+        break;
+    }
+    HRESULT hr = rt->DrawGlyphRun(0, 0, measureMode, run, params, color);
     BitBlt(surface->dc,
 	   area.left, area.top,
 	   area.right - area.left, area.bottom - area.top,
 	   rt->GetMemoryDC(),
 	   0, 0, 
 	   SRCCOPY | NOMIRRORBITMAP);
     params->Release();
     rt->Release();