Backed out changeset f7e0dfe88d42 (bug 1321901) for failing e.g. reftest text-emphasis-style-property-002.html on unaccelerated Windows 8 x64 instances. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 08 Dec 2016 11:12:44 +0100
changeset 325403 387b89eeed54d07238a2e0e878e44ca7cdbd26cb
parent 325402 82aeade4d0073cd0c2da2d61543fe0a50430cfbb
child 325404 d8f63b2935af0915a6a24b3ea8e27d9a09f66416
child 325435 3bfbdec4ea08c9fb7fb0a4ee624c1607e85a4013
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersbackout
bugs1321901
milestone53.0a1
backs outf7e0dfe88d42e4c326fdb75b1ebd4228fd1d2f01
Backed out changeset f7e0dfe88d42 (bug 1321901) for failing e.g. reftest text-emphasis-style-property-002.html on unaccelerated Windows 8 x64 instances. r=backout
gfx/skia/skia/src/ports/SkScalerContext_win_dw.cpp
gfx/skia/skia/src/ports/SkScalerContext_win_dw.h
--- a/gfx/skia/skia/src/ports/SkScalerContext_win_dw.cpp
+++ b/gfx/skia/skia/src/ports/SkScalerContext_win_dw.cpp
@@ -214,23 +214,17 @@ SkScalerContext_DW::SkScalerContext_DW(D
 #if SK_HAS_DWRITE_2_H
     fTypeface->fFactory->QueryInterface<IDWriteFactory2>(&fFactory2);
 
     SkTScopedComPtr<IDWriteFontFace2> fontFace2;
     fTypeface->fDWriteFontFace->QueryInterface<IDWriteFontFace2>(&fontFace2);
     fIsColorFont = fFactory2.get() && fontFace2.get() && fontFace2->IsColorFont();
 #endif
 
-    IDWriteFactory* factory = sk_get_dwrite_factory();
-    if (factory != nullptr) {
-        HRVM(factory->CreateRenderingParams(&fDefaultRenderingParams),
-        "Could not create default rendering params");
-    }
-
-    // In general, all glyphs should DWriteFontFace::GetRecommendedRenderingMode
+    // In general, all glyphs should use CLEARTYPE_NATURAL_SYMMETRIC
     // except when bi-level rendering is requested or there are embedded
     // bi-level bitmaps (and the embedded bitmap flag is set and no rotation).
     //
     // DirectWrite's IDWriteFontFace::GetRecommendedRenderingMode does not do
     // this. As a result, determine the actual size of the text and then see if
     // there are any embedded bi-level bitmaps of that size. If there are, then
     // force bitmaps by requesting bi-level rendering.
     //
@@ -316,31 +310,23 @@ SkScalerContext_DW::SkScalerContext_DW(D
     // drop out control in the y direction in order to be legible.
     } else if (is_hinted_without_gasp(typeface)) {
         fTextSizeRender = gdiTextSize;
         fRenderingMode = DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL;
         fTextureType = DWRITE_TEXTURE_CLEARTYPE_3x1;
         fTextSizeMeasure = realTextSize;
         fMeasuringMode = DWRITE_MEASURING_MODE_NATURAL;
 
-    // The normal case is to use the recommended rendering mode
+    // The normal case is to use natural symmetric rendering and linear metrics.
     } else {
         fTextSizeRender = realTextSize;
+        fRenderingMode = DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC;
         fTextureType = DWRITE_TEXTURE_CLEARTYPE_3x1;
         fTextSizeMeasure = realTextSize;
         fMeasuringMode = DWRITE_MEASURING_MODE_NATURAL;
-
-        if (!SUCCEEDED(fTypeface->fDWriteFontFace->GetRecommendedRenderingMode(
-                fTextSizeRender,
-                1.0f,
-                fMeasuringMode,
-                fDefaultRenderingParams.get(),
-                &fRenderingMode))) {
-            fRenderingMode = DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC;
-        }
     }
 
     if (this->isSubpixel()) {
         fTextSizeMeasure = realTextSize;
         fMeasuringMode = DWRITE_MEASURING_MODE_NATURAL;
     }
 }
 
--- a/gfx/skia/skia/src/ports/SkScalerContext_win_dw.h
+++ b/gfx/skia/skia/src/ports/SkScalerContext_win_dw.h
@@ -70,16 +70,15 @@ private:
     SkScalar fTextSizeRender;
     /** The text size to measure with. */
     SkScalar fTextSizeMeasure;
     SkAutoTUnref<DWriteFontTypeface> fTypeface;
     int fGlyphCount;
     DWRITE_RENDERING_MODE fRenderingMode;
     DWRITE_TEXTURE_TYPE fTextureType;
     DWRITE_MEASURING_MODE fMeasuringMode;
-    SkTScopedComPtr<IDWriteRenderingParams> fDefaultRenderingParams;
 #if SK_HAS_DWRITE_2_H
     SkTScopedComPtr<IDWriteFactory2> fFactory2;
     bool fIsColorFont;
 #endif
 };
 
 #endif