Changeset 58404 in webkit


Ignore:
Timestamp:
Apr 28, 2010 4:58:45 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-28 Marcus Bulach <bulach@chromium.org>

Reviewed by Jeremy Orlow.

Reverts 58340 (https://bugs.webkit.org/show_bug.cgi?id=38158) due to regression on fast/text/international/khmer-selection.html
https://bugs.webkit.org/show_bug.cgi?id=38254

  • platform/graphics/chromium/FontLinux.cpp: (WebCore::adjustTextRenderMode): (WebCore::TextRunWalker::getTextRun): (WebCore::TextRunWalker::getNormalizedTextRun): (WebCore::TextRunWalker::setGlyphXPositions): (WebCore::glyphIndexForXPositionInScriptRun): (WebCore::Font::offsetForPositionForComplexText): (WebCore::Font::selectionRectForComplexText):
  • platform/graphics/chromium/FontPlatformDataLinux.cpp: (WebCore::FontPlatformData::setupPaint):
  • platform/graphics/chromium/HarfbuzzSkia.cpp: (WebCore::getOutlinePoint):
  • platform/graphics/skia/GraphicsContext3DSkia.cpp: (WebCore::GraphicsContext3D::getImageData):
  • platform/graphics/skia/GraphicsContextSkia.cpp: (WebCore::isCoordinateSkiaSafe): (WebCore::GraphicsContext::fillRect): (WebCore::GraphicsContext::strokePath): (WebCore::GraphicsContext::strokeRect):
Location:
trunk/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r58403 r58404  
     12010-04-28  Marcus Bulach  <bulach@chromium.org>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        Reverts 58340 (https://bugs.webkit.org/show_bug.cgi?id=38158) due to regression on fast/text/international/khmer-selection.html
     6        https://bugs.webkit.org/show_bug.cgi?id=38254
     7
     8        * platform/graphics/chromium/FontLinux.cpp:
     9        (WebCore::adjustTextRenderMode):
     10        (WebCore::TextRunWalker::getTextRun):
     11        (WebCore::TextRunWalker::getNormalizedTextRun):
     12        (WebCore::TextRunWalker::setGlyphXPositions):
     13        (WebCore::glyphIndexForXPositionInScriptRun):
     14        (WebCore::Font::offsetForPositionForComplexText):
     15        (WebCore::Font::selectionRectForComplexText):
     16        * platform/graphics/chromium/FontPlatformDataLinux.cpp:
     17        (WebCore::FontPlatformData::setupPaint):
     18        * platform/graphics/chromium/HarfbuzzSkia.cpp:
     19        (WebCore::getOutlinePoint):
     20        * platform/graphics/skia/GraphicsContext3DSkia.cpp:
     21        (WebCore::GraphicsContext3D::getImageData):
     22        * platform/graphics/skia/GraphicsContextSkia.cpp:
     23        (WebCore::isCoordinateSkiaSafe):
     24        (WebCore::GraphicsContext::fillRect):
     25        (WebCore::GraphicsContext::strokePath):
     26        (WebCore::GraphicsContext::strokeRect):
     27
    1282010-04-28  Andrey Kosyakov  <caseq@chromium.org>
    229
  • trunk/WebCore/platform/graphics/chromium/FontLinux.cpp

    r58340 r58404  
    6565}
    6666
    67 static void adjustTextRenderMode(SkPaint* paint, bool isCanvasMultiLayered)
     67static bool adjustTextRenderMode(SkPaint* paint, bool isCanvasMultiLayered)
    6868{
    6969    // Our layers only have a single alpha channel. This means that subpixel
     
    325325        // 2) Convert spacing characters into plain spaces, as some fonts will provide glyphs
    326326        // for characters like '\n' otherwise.
    327         for (int i = 0; i < originalRun.length(); ++i) {
     327        for (unsigned i = 0; i < originalRun.length(); ++i) {
    328328            UChar ch = originalRun[i];
    329329            UBlockCode block = ::ublock_getCode(ch);
     
    347347        ASSERT(U_SUCCESS(error));
    348348
    349         for (int i = 0; i < normalizedString.length(); ++i) {
     349        for (unsigned i = 0; i < normalizedString.length(); ++i) {
    350350            if (Font::treatAsSpace(m_normalizedBuffer[i]))
    351351                m_normalizedBuffer[i] = ' ';
     
    440440    {
    441441        double position = 0;
    442         for (int iter = 0; iter < static_cast<int>(m_item.num_glyphs); ++iter) {
     442        for (int iter = 0; iter < m_item.num_glyphs; ++iter) {
    443443            // Glyphs are stored in logical order, but for layout purposes we always go left to right.
    444444            int i = isRTL ? m_item.num_glyphs - iter - 1 : iter;
     
    539539        }
    540540    } else {
    541         for (glyphIndex = 0; glyphIndex < static_cast<int>(walker.length()); ++glyphIndex) {
     541        for (glyphIndex = 0; glyphIndex < walker.length(); ++glyphIndex) {
    542542            if (x < truncateFixedPointToInteger(advances[glyphIndex]))
    543543                break;
     
    591591            basePosition -= walker.numCodePoints();
    592592
    593         if (x < static_cast<int>(walker.width())) {
     593        if (x < walker.width()) {
    594594            // The x value in question is within this script run. We consider
    595595            // each glyph in presentation order and stop when we find the one
     
    651651            base -= walker.width();
    652652
    653         if (fromX == -1 && from < static_cast<int>(walker.numCodePoints())) {
     653        if (fromX == -1 && from < walker.numCodePoints()) {
    654654            // |from| is within this script run. So we index the clusters log to
    655655            // find which glyph this code-point contributed to and find its x
     
    661661            from -= walker.numCodePoints();
    662662
    663         if (toX == -1 && to < static_cast<int>(walker.numCodePoints())) {
     663        if (toX == -1 && to < walker.numCodePoints()) {
    664664            int glyph = walker.logClusters()[to];
    665665            toX = base + walker.xPositions()[glyph];
  • trunk/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp

    r58340 r58404  
    149149    paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0);
    150150
    151     if (m_style.useAntiAlias == 1 || (m_style.useAntiAlias == FontRenderStyle::NoPreference && isSkiaAntiAlias))
     151    if (m_style.useAntiAlias == 1 || m_style.useAntiAlias == FontRenderStyle::NoPreference && isSkiaAntiAlias)
    152152        paint->setLCDRenderText(m_style.useSubpixel == FontRenderStyle::NoPreference ? isSkiaSubpixelGlyphs : m_style.useSubpixel);
    153153}
  • trunk/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp

    r58340 r58404  
    140140    SkPath path;
    141141    paint.getTextPath(&glyph16, sizeof(glyph16), 0, 0, &path);
    142     unsigned numPoints = path.getPoints(0, 0);
     142    int numPoints = path.getPoints(NULL, 0);
    143143    if (point >= numPoints)
    144144        return HB_Err_Invalid_SubTable;
  • trunk/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp

    r58340 r58404  
    5656    SkBitmap& skiaImageRef = *skiaImage;
    5757    SkAutoLockPixels lock(skiaImageRef);
     58    int width = skiaImage->width();
    5859    int height = skiaImage->height();
    5960    int rowBytes = skiaImage->rowBytes();
    60     ASSERT(rowBytes == skiaImage->width() * 4);
     61    ASSERT(rowBytes == width * 4);
    6162    uint8_t* pixels = reinterpret_cast<uint8_t*>(skiaImage->getPixels());
    6263    outputVector.resize(rowBytes * height);
  • trunk/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp

    r58340 r58404  
    9292// #define ENSURE_VALUE_SAFETY_FOR_SKIA
    9393
     94static bool isCoordinateSkiaSafe(float coord)
     95{
    9496#ifdef ENSURE_VALUE_SAFETY_FOR_SKIA
    95 static bool isCoordinateSkiaSafe(float coord)
    96 {
    9797    // First check for valid floats.
    9898#if defined(_MSC_VER)
     
    111111
    112112    return true;
    113 }
     113#else
     114    return true;
    114115#endif
     116}
    115117
    116118static bool isPointSkiaSafe(const SkMatrix& transform, const SkPoint& pt)
     
    733735    }
    734736
     737    const GraphicsContextState& state = m_common->state;
     738
    735739    SkPaint paint;
    736740    platformContext()->setupPaintForFilling(&paint);
     
    11191123        return;
    11201124
     1125    const GraphicsContextState& state = m_common->state;
     1126
    11211127    SkPaint paint;
    11221128    platformContext()->setupPaintForStroking(&paint, 0, 0);
     1129
    11231130    platformContext()->canvas()->drawPath(path, paint);
    11241131}
     
    11311138    if (!isRectSkiaSafe(getCTM(), rect))
    11321139        return;
     1140
     1141    const GraphicsContextState& state = m_common->state;
    11331142
    11341143    SkPaint paint;
    11351144    platformContext()->setupPaintForStroking(&paint, 0, 0);
    11361145    paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth));
     1146
    11371147    platformContext()->canvas()->drawRect(rect, paint);
    11381148}
Note: See TracChangeset for help on using the changeset viewer.