Changeset 58340 in webkit


Ignore:
Timestamp:
Apr 27, 2010 2:52:20 PM (14 years ago)
Author:
jamesr@google.com
Message:

2010-04-27 James Robinson <jamesr@chromium.org>

Reviewed by Darin Adler.

Fix warnings emitted by gcc 4.4.1 on linux in chromium-specific platform graphics files.
https://bugs.webkit.org/show_bug.cgi?id=38158

Most of the issues are signed/unsigned mismatches, but there are a few unusued variables
and functions mixed in.

  • 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

    r58336 r58340  
     12010-04-27  James Robinson  <jamesr@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Fix warnings emitted by gcc 4.4.1 on linux in chromium-specific platform graphics files.
     6        https://bugs.webkit.org/show_bug.cgi?id=38158
     7
     8        Most of the issues are signed/unsigned mismatches, but there are a few unusued variables
     9        and functions mixed in.
     10
     11        * platform/graphics/chromium/FontLinux.cpp:
     12        (WebCore::adjustTextRenderMode):
     13        (WebCore::TextRunWalker::getTextRun):
     14        (WebCore::TextRunWalker::getNormalizedTextRun):
     15        (WebCore::TextRunWalker::setGlyphXPositions):
     16        (WebCore::glyphIndexForXPositionInScriptRun):
     17        (WebCore::Font::offsetForPositionForComplexText):
     18        (WebCore::Font::selectionRectForComplexText):
     19        * platform/graphics/chromium/FontPlatformDataLinux.cpp:
     20        (WebCore::FontPlatformData::setupPaint):
     21        * platform/graphics/chromium/HarfbuzzSkia.cpp:
     22        (WebCore::getOutlinePoint):
     23        * platform/graphics/skia/GraphicsContext3DSkia.cpp:
     24        (WebCore::GraphicsContext3D::getImageData):
     25        * platform/graphics/skia/GraphicsContextSkia.cpp:
     26        (WebCore::isCoordinateSkiaSafe):
     27        (WebCore::GraphicsContext::fillRect):
     28        (WebCore::GraphicsContext::strokePath):
     29        (WebCore::GraphicsContext::strokeRect):
     30
    1312010-04-27  Jian Li  <jianli@chromium.org>
    232
  • trunk/WebCore/platform/graphics/chromium/FontLinux.cpp

    r57215 r58340  
    6565}
    6666
    67 static bool adjustTextRenderMode(SkPaint* paint, bool isCanvasMultiLayered)
     67static void 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 (unsigned i = 0; i < originalRun.length(); ++i) {
     327        for (int 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 (unsigned i = 0; i < normalizedString.length(); ++i) {
     349        for (int 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 < m_item.num_glyphs; ++iter) {
     442        for (int iter = 0; iter < static_cast<int>(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 < walker.length(); ++glyphIndex) {
     541        for (glyphIndex = 0; glyphIndex < static_cast<int>(walker.length()); ++glyphIndex) {
    542542            if (x < truncateFixedPointToInteger(advances[glyphIndex]))
    543543                break;
     
    591591            basePosition -= walker.numCodePoints();
    592592
    593         if (x < walker.width()) {
     593        if (x < static_cast<int>(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 < walker.numCodePoints()) {
     653        if (fromX == -1 && from < static_cast<int>(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 < walker.numCodePoints()) {
     663        if (toX == -1 && to < static_cast<int>(walker.numCodePoints())) {
    664664            int glyph = walker.logClusters()[to];
    665665            toX = base + walker.xPositions()[glyph];
  • trunk/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp

    r56800 r58340  
    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

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

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

    r54503 r58340  
    9292// #define ENSURE_VALUE_SAFETY_FOR_SKIA
    9393
     94#ifdef ENSURE_VALUE_SAFETY_FOR_SKIA
    9495static bool isCoordinateSkiaSafe(float coord)
    9596{
    96 #ifdef ENSURE_VALUE_SAFETY_FOR_SKIA
    9797    // First check for valid floats.
    9898#if defined(_MSC_VER)
     
    111111
    112112    return true;
    113 #else
    114     return true;
     113}
    115114#endif
    116 }
    117115
    118116static bool isPointSkiaSafe(const SkMatrix& transform, const SkPoint& pt)
     
    735733    }
    736734
    737     const GraphicsContextState& state = m_common->state;
    738 
    739735    SkPaint paint;
    740736    platformContext()->setupPaintForFilling(&paint);
     
    11231119        return;
    11241120
    1125     const GraphicsContextState& state = m_common->state;
    1126 
    11271121    SkPaint paint;
    11281122    platformContext()->setupPaintForStroking(&paint, 0, 0);
    1129 
    11301123    platformContext()->canvas()->drawPath(path, paint);
    11311124}
     
    11381131    if (!isRectSkiaSafe(getCTM(), rect))
    11391132        return;
    1140 
    1141     const GraphicsContextState& state = m_common->state;
    11421133
    11431134    SkPaint paint;
    11441135    platformContext()->setupPaintForStroking(&paint, 0, 0);
    11451136    paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth));
    1146 
    11471137    platformContext()->canvas()->drawRect(rect, paint);
    11481138}
Note: See TracChangeset for help on using the changeset viewer.