Changeset 71717 in webkit


Ignore:
Timestamp:
Nov 9, 2010 9:24:54 PM (13 years ago)
Author:
thakis@chromium.org
Message:

2010-11-09 Nico Weber <thakis@chromium.org>

Reviewed by Kenneth Russell.

[Chromium] Text jitter during 2D CSS transform
https://bugs.webkit.org/show_bug.cgi?id=49224

Text subpixel rendering only works in AlphaPremultipliedFirst |
kCGBitmapByteOrder32Host contexts:
http://www.cocoabuilder.com/archive/cocoa/228931-sub-pixel-font-smoothing-with-cgbitmapcontext.html

Changing this has the added benefit that the data layout now matches
skia.

  • platform/graphics/chromium/ContentLayerChromium.cpp: (WebCore::ContentLayerChromium::SharedValues::SharedValues): (WebCore::ContentLayerChromium::updateContents):
  • platform/graphics/chromium/ImageLayerChromium.cpp: (WebCore::ImageLayerChromium::updateContents):
  • platform/graphics/chromium/LayerRendererChromium.cpp: (WebCore::LayerRendererChromium::setRootLayerCanvasSize):
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r71716 r71717  
     12010-11-09  Nico Weber  <thakis@chromium.org>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        [Chromium] Text jitter during 2D CSS transform
     6        https://bugs.webkit.org/show_bug.cgi?id=49224
     7
     8        Text subpixel rendering only works in AlphaPremultipliedFirst |
     9        kCGBitmapByteOrder32Host contexts:
     10        http://www.cocoabuilder.com/archive/cocoa/228931-sub-pixel-font-smoothing-with-cgbitmapcontext.html
     11
     12        Changing this has the added benefit that the data layout now matches
     13        skia.
     14
     15        * platform/graphics/chromium/ContentLayerChromium.cpp:
     16        (WebCore::ContentLayerChromium::SharedValues::SharedValues):
     17        (WebCore::ContentLayerChromium::updateContents):
     18        * platform/graphics/chromium/ImageLayerChromium.cpp:
     19        (WebCore::ImageLayerChromium::updateContents):
     20        * platform/graphics/chromium/LayerRendererChromium.cpp:
     21        (WebCore::LayerRendererChromium::setRootLayerCanvasSize):
     22
    1232010-11-09  Helder Correia  <helder@sencha.com>
    224
  • trunk/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp

    r70075 r71717  
    6969        "}                            \n";
    7070
    71     // Note differences between Skia and Core Graphics versions:
    72     //  - Skia uses BGRA
    73     //  - Core Graphics uses RGBA
     71    // Color is in BGRA order.
    7472    char fragmentShaderString[] =
    7573        "precision mediump float;                            \n"
     
    8078        "{                                                   \n"
    8179        "  vec4 texColor = texture2D(s_texture, v_texCoord); \n"
    82 #if PLATFORM(SKIA)
    8380        "  gl_FragColor = vec4(texColor.z, texColor.y, texColor.x, texColor.w) * alpha; \n"
    84 #elif PLATFORM(CG)
    85         "  gl_FragColor = vec4(texColor.x, texColor.y, texColor.z, texColor.w) * alpha; \n"
    86 #else
    87 #error "Need to implement for your platform."
    88 #endif
    8981        "}                                                   \n";
    9082
     
    267259                                                                     dirtyRect.width(), dirtyRect.height(), 8, rowBytes,
    268260                                                                     colorSpace.get(),
    269                                                                      kCGImageAlphaPremultipliedLast));
     261                                                                     kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
    270262    CGContextTranslateCTM(contextCG.get(), 0, dirtyRect.height());
    271263    CGContextScaleCTM(contextCG.get(), 1, -1);
  • trunk/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp

    r70075 r71717  
    136136                                                                       width, height, 8, tempRowBytes,
    137137                                                                       colorSpace,
    138                                                                        kCGImageAlphaPremultipliedLast));
     138                                                                       kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
    139139    CGContextSetBlendMode(tempContext.get(), kCGBlendModeCopy);
    140140    CGContextDrawImage(tempContext.get(),
  • trunk/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

    r71210 r71717  
    139139                                                       size.width(), size.height(), 8, rowBytes,
    140140                                                       colorSpace.get(),
    141                                                        kCGImageAlphaPremultipliedLast));
     141                                                       kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
    142142    CGContextTranslateCTM(m_rootLayerCGContext.get(), 0, size.height());
    143143    CGContextScaleCTM(m_rootLayerCGContext.get(), 1, -1);
Note: See TracChangeset for help on using the changeset viewer.