Changeset 87846 in webkit


Ignore:
Timestamp:
Jun 1, 2011 2:00:56 PM (13 years ago)
Author:
leviw@chromium.org
Message:

2011-06-01 Levi Weintraub <leviw@chromium.org>

Reviewed by Eric Seidel.

Text is scaled in a stair-step pattern
https://bugs.webkit.org/show_bug.cgi?id=60317

Stop scaling the specified font to the actual on-screen value when font-rendering:
geometricPrecision is specified, but instead scale the graphics context. This allows
us to scale text up and down smoothly.

Test: svg/text/scaling-font-with-geometric-precision.html

  • rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):

2011-06-01 Levi Weintraub <leviw@chromium.org>

Reviewed by Eric Seidel.

Text is scaled in a stair-step pattern
https://bugs.webkit.org/show_bug.cgi?id=60317

Stop scaling the specified font to the actual on-screen value when font-rendering:
geometricPrecision is specified, but instead scale the graphics context. This allows
us to scale text up and down smoothly.

  • platform/mac/svg/text/scaling-font-with-geometric-precision-expected.png: Added.
  • platform/mac/svg/text/scaling-font-with-geometric-precision-expected.txt: Added.
  • svg/text/scaling-font-with-geometric-precision.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r87844 r87846  
     12011-06-01  Levi Weintraub  <leviw@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Text is scaled in a stair-step pattern
     6        https://bugs.webkit.org/show_bug.cgi?id=60317
     7
     8        Stop scaling the specified font to the actual on-screen value when font-rendering:
     9        geometricPrecision is specified, but instead scale the graphics context. This allows
     10        us to scale text up and down smoothly.
     11
     12        * platform/mac/svg/text/scaling-font-with-geometric-precision-expected.png: Added.
     13        * platform/mac/svg/text/scaling-font-with-geometric-precision-expected.txt: Added.
     14        * svg/text/scaling-font-with-geometric-precision.html: Added.
     15
    1162011-06-01  Jer Noble  <jer.noble@apple.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r87845 r87846  
     12011-06-01  Levi Weintraub  <leviw@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Text is scaled in a stair-step pattern
     6        https://bugs.webkit.org/show_bug.cgi?id=60317
     7
     8        Stop scaling the specified font to the actual on-screen value when font-rendering:
     9        geometricPrecision is specified, but instead scale the graphics context. This allows
     10        us to scale text up and down smoothly.
     11
     12        Test: svg/text/scaling-font-with-geometric-precision.html
     13
     14        * rendering/svg/RenderSVGInlineText.cpp:
     15        (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
     16
    1172011-06-01  Levi Weintraub  <leviw@chromium.org>
    218
  • trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp

    r86135 r87846  
    236236    Document* document = renderer->document();
    237237    ASSERT(document);
    238 
     238   
    239239    CSSStyleSelector* styleSelector = document->styleSelector();
    240240    ASSERT(styleSelector);
    241241
    242     // Alter font-size to the right on-screen value, to avoid scaling the glyphs themselves.
     242    // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified
    243243    AffineTransform ctm;
    244244    SVGImageBufferTools::calculateTransformationToOutermostSVGCoordinateSystem(renderer, ctm);
    245245    scalingFactor = narrowPrecisionToFloat(sqrt((pow(ctm.xScale(), 2) + pow(ctm.yScale(), 2)) / 2));
    246     if (scalingFactor == 1 || !scalingFactor) {
     246    if (scalingFactor == 1 || !scalingFactor || style->fontDescription().textRenderingMode() == GeometricPrecision) {
    247247        scalingFactor = 1;
    248248        scaledFont = style->font();
Note: See TracChangeset for help on using the changeset viewer.