Changeset 58340 in webkit
- Timestamp:
- Apr 27, 2010 2:52:20 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r58336 r58340 1 2010-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 1 31 2010-04-27 Jian Li <jianli@chromium.org> 2 32 -
trunk/WebCore/platform/graphics/chromium/FontLinux.cpp
r57215 r58340 65 65 } 66 66 67 static booladjustTextRenderMode(SkPaint* paint, bool isCanvasMultiLayered)67 static void adjustTextRenderMode(SkPaint* paint, bool isCanvasMultiLayered) 68 68 { 69 69 // Our layers only have a single alpha channel. This means that subpixel … … 325 325 // 2) Convert spacing characters into plain spaces, as some fonts will provide glyphs 326 326 // for characters like '\n' otherwise. 327 for ( unsignedi = 0; i < originalRun.length(); ++i) {327 for (int i = 0; i < originalRun.length(); ++i) { 328 328 UChar ch = originalRun[i]; 329 329 UBlockCode block = ::ublock_getCode(ch); … … 347 347 ASSERT(U_SUCCESS(error)); 348 348 349 for ( unsignedi = 0; i < normalizedString.length(); ++i) {349 for (int i = 0; i < normalizedString.length(); ++i) { 350 350 if (Font::treatAsSpace(m_normalizedBuffer[i])) 351 351 m_normalizedBuffer[i] = ' '; … … 440 440 { 441 441 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) { 443 443 // Glyphs are stored in logical order, but for layout purposes we always go left to right. 444 444 int i = isRTL ? m_item.num_glyphs - iter - 1 : iter; … … 539 539 } 540 540 } else { 541 for (glyphIndex = 0; glyphIndex < walker.length(); ++glyphIndex) {541 for (glyphIndex = 0; glyphIndex < static_cast<int>(walker.length()); ++glyphIndex) { 542 542 if (x < truncateFixedPointToInteger(advances[glyphIndex])) 543 543 break; … … 591 591 basePosition -= walker.numCodePoints(); 592 592 593 if (x < walker.width()) {593 if (x < static_cast<int>(walker.width())) { 594 594 // The x value in question is within this script run. We consider 595 595 // each glyph in presentation order and stop when we find the one … … 651 651 base -= walker.width(); 652 652 653 if (fromX == -1 && from < walker.numCodePoints()) {653 if (fromX == -1 && from < static_cast<int>(walker.numCodePoints())) { 654 654 // |from| is within this script run. So we index the clusters log to 655 655 // find which glyph this code-point contributed to and find its x … … 661 661 from -= walker.numCodePoints(); 662 662 663 if (toX == -1 && to < walker.numCodePoints()) {663 if (toX == -1 && to < static_cast<int>(walker.numCodePoints())) { 664 664 int glyph = walker.logClusters()[to]; 665 665 toX = base + walker.xPositions()[glyph]; -
trunk/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
r56800 r58340 149 149 paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0); 150 150 151 if (m_style.useAntiAlias == 1 || m_style.useAntiAlias == FontRenderStyle::NoPreference && isSkiaAntiAlias)151 if (m_style.useAntiAlias == 1 || (m_style.useAntiAlias == FontRenderStyle::NoPreference && isSkiaAntiAlias)) 152 152 paint->setLCDRenderText(m_style.useSubpixel == FontRenderStyle::NoPreference ? isSkiaSubpixelGlyphs : m_style.useSubpixel); 153 153 } -
trunk/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp
r54020 r58340 140 140 SkPath path; 141 141 paint.getTextPath(&glyph16, sizeof(glyph16), 0, 0, &path); 142 int numPoints = path.getPoints(NULL, 0);142 unsigned numPoints = path.getPoints(0, 0); 143 143 if (point >= numPoints) 144 144 return HB_Err_Invalid_SubTable; -
trunk/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
r56735 r58340 56 56 SkBitmap& skiaImageRef = *skiaImage; 57 57 SkAutoLockPixels lock(skiaImageRef); 58 int width = skiaImage->width();59 58 int height = skiaImage->height(); 60 59 int rowBytes = skiaImage->rowBytes(); 61 ASSERT(rowBytes == width* 4);60 ASSERT(rowBytes == skiaImage->width() * 4); 62 61 uint8_t* pixels = reinterpret_cast<uint8_t*>(skiaImage->getPixels()); 63 62 outputVector.resize(rowBytes * height); -
trunk/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
r54503 r58340 92 92 // #define ENSURE_VALUE_SAFETY_FOR_SKIA 93 93 94 #ifdef ENSURE_VALUE_SAFETY_FOR_SKIA 94 95 static bool isCoordinateSkiaSafe(float coord) 95 96 { 96 #ifdef ENSURE_VALUE_SAFETY_FOR_SKIA97 97 // First check for valid floats. 98 98 #if defined(_MSC_VER) … … 111 111 112 112 return true; 113 #else 114 return true; 113 } 115 114 #endif 116 }117 115 118 116 static bool isPointSkiaSafe(const SkMatrix& transform, const SkPoint& pt) … … 735 733 } 736 734 737 const GraphicsContextState& state = m_common->state;738 739 735 SkPaint paint; 740 736 platformContext()->setupPaintForFilling(&paint); … … 1123 1119 return; 1124 1120 1125 const GraphicsContextState& state = m_common->state;1126 1127 1121 SkPaint paint; 1128 1122 platformContext()->setupPaintForStroking(&paint, 0, 0); 1129 1130 1123 platformContext()->canvas()->drawPath(path, paint); 1131 1124 } … … 1138 1131 if (!isRectSkiaSafe(getCTM(), rect)) 1139 1132 return; 1140 1141 const GraphicsContextState& state = m_common->state;1142 1133 1143 1134 SkPaint paint; 1144 1135 platformContext()->setupPaintForStroking(&paint, 0, 0); 1145 1136 paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth)); 1146 1147 1137 platformContext()->canvas()->drawRect(rect, paint); 1148 1138 }
Note: See TracChangeset
for help on using the changeset viewer.