Changeset 136147 in webkit
- Timestamp:
- Nov 29, 2012, 12:12:54 PM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/cairo/GraphicsContext3DCairo.cpp (modified) (1 diff)
-
platform/graphics/filters/skia/FEBlendSkia.cpp (modified) (1 diff)
-
platform/graphics/filters/skia/FEComponentTransferSkia.cpp (modified) (2 diffs)
-
platform/graphics/filters/skia/FELightingSkia.cpp (modified) (1 diff)
-
platform/graphics/qt/GraphicsContext3DQt.cpp (modified) (1 diff)
-
platform/graphics/win/ImageCGWin.cpp (modified) (1 diff)
-
platform/graphics/wince/ImageWinCE.cpp (modified) (1 diff)
-
platform/win/DragImageCGWin.cpp (modified) (1 diff)
-
platform/win/DragImageCairoWin.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r136146 r136147 1 2012-11-29 Brent Fulgham <bfulgham@gmail.com> 2 3 Be consistent in handling of frameAtIndex (and related) returns. 4 https://bugs.webkit.org/show_bug.cgi?id=103207 5 6 Reviewed by David Hyatt. 7 8 Under various conditions, frameAtIndex (and therefore, 9 nativeImageForCurrentFrame) returns null. A series of bugs over 10 the years has ensured null returns are handled in some cases, 11 but there are a handful of remaining cases where this is still a 12 problem. 13 14 No new tests, as these low-level functions are covered by 15 numerous existing test cases. 16 1 17 2012-11-29 David Hyatt <hyatt@apple.com> 2 18 -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp
r130525 r136147 180 180 imageSurface = nativeImage->surface(); 181 181 } else { 182 imageSurface = image->nativeImageForCurrentFrame()->surface(); 182 NativeImageCairo* nativeImage = image->nativeImageForCurrentFrame(); 183 imageSurface = (nativeImage) ? nativeImage->surface() : 0; 183 184 if (!premultiplyAlpha) 184 185 alphaOp = AlphaDoUnmultiply; -
trunk/Source/WebCore/platform/graphics/filters/skia/FEBlendSkia.cpp
r135390 r136147 73 73 RefPtr<Image> background = in2->asImageBuffer()->copyImage(DontCopyBackingStore); 74 74 75 SkBitmap foregroundBitmap = foreground->nativeImageForCurrentFrame()->bitmap(); 76 SkBitmap backgroundBitmap = background->nativeImageForCurrentFrame()->bitmap(); 75 NativeImageSkia* foregroundNativeImage = foreground->nativeImageForCurrentFrame(); 76 NativeImageSkia* backgroundNativeImage = background->nativeImageForCurrentFrame(); 77 78 if (!foregroundNativeImage || !backgroundNativeImage) 79 return false; 80 81 SkBitmap foregroundBitmap = foregroundNativeImage->bitmap(); 82 SkBitmap backgroundBitmap = backgroundNativeImage->bitmap(); 77 83 78 84 SkAutoTUnref<SkImageFilter> backgroundSource(new SkBitmapSource(backgroundBitmap)); -
trunk/Source/WebCore/platform/graphics/filters/skia/FEComponentTransferSkia.cpp
r135390 r136147 44 44 45 45 RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore); 46 SkBitmap bitmap = image->nativeImageForCurrentFrame()->bitmap(); 46 NativeImageSkia* nativeImage = image->nativeImageForCurrentFrame(); 47 if (!nativeImage) 48 return false; 47 49 48 50 unsigned char rValues[256], gValues[256], bValues[256], aValues[256]; … … 52 54 paint.setColorFilter(SkTableColorFilter::CreateARGB(aValues, rValues, gValues, bValues))->unref(); 53 55 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 54 resultImage->context()->platformContext()->drawBitmap( bitmap, 0, 0, &paint);56 resultImage->context()->platformContext()->drawBitmap(nativeImage->bitmap(), 0, 0, &paint); 55 57 56 58 return true; -
trunk/Source/WebCore/platform/graphics/filters/skia/FELightingSkia.cpp
r135390 r136147 99 99 RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore); 100 100 NativeImageSkia* nativeImage = image->nativeImageForCurrentFrame(); 101 if (!nativeImage) 102 return false; 101 103 102 104 GraphicsContext* dstContext = resultImage->context(); -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
r135998 r136147 504 504 else { 505 505 QPixmap* nativePixmap = image->nativeImageForCurrentFrame(); 506 if (!nativePixmap) 507 return false; 508 506 509 // With QPA, we can avoid a deep copy. 507 510 qtImage = *nativePixmap->handle()->buffer(); -
trunk/Source/WebCore/platform/graphics/win/ImageCGWin.cpp
r127757 r136147 92 92 for (size_t i = 0; i < frames; ++i) { 93 93 CGImageRef image = frameAtIndex(i); 94 if ( CGImageGetHeight(image) == static_cast<size_t>(srcSize.height()) && CGImageGetWidth(image) == static_cast<size_t>(srcSize.width())) {94 if (image && CGImageGetHeight(image) == static_cast<size_t>(srcSize.height()) && CGImageGetWidth(image) == static_cast<size_t>(srcSize.width())) { 95 95 size_t currentFrame = m_currentFrame; 96 96 m_currentFrame = i; -
trunk/Source/WebCore/platform/graphics/wince/ImageWinCE.cpp
r127757 r136147 119 119 IntRect intSrcRect(srcRectIn); 120 120 RefPtr<SharedBitmap> bmp = frameAtIndex(m_currentFrame); 121 if (bmp) { 122 if (bmp->width() != m_source.size().width()) { 123 double scaleFactor = static_cast<double>(bmp->width()) / m_source.size().width(); 121 124 122 if (bmp->width() != m_source.size().width()) { 123 double scaleFactor = static_cast<double>(bmp->width()) / m_source.size().width(); 124 125 intSrcRect.setX(stableRound(srcRectIn.x() * scaleFactor)); 126 intSrcRect.setWidth(stableRound(srcRectIn.width() * scaleFactor)); 127 intSrcRect.setY(stableRound(srcRectIn.y() * scaleFactor)); 128 intSrcRect.setHeight(stableRound(srcRectIn.height() * scaleFactor)); 125 intSrcRect.setX(stableRound(srcRectIn.x() * scaleFactor)); 126 intSrcRect.setWidth(stableRound(srcRectIn.width() * scaleFactor)); 127 intSrcRect.setY(stableRound(srcRectIn.y() * scaleFactor)); 128 intSrcRect.setHeight(stableRound(srcRectIn.height() * scaleFactor)); 129 } 130 bmp->draw(ctxt, enclosingIntRect(dstRect), intSrcRect, styleColorSpace, compositeOp); 129 131 } 130 bmp->draw(ctxt, enclosingIntRect(dstRect), intSrcRect, styleColorSpace, compositeOp);131 132 } 132 133 -
trunk/Source/WebCore/platform/win/DragImageCGWin.cpp
r113486 r136147 149 149 CGContextSetFillColor(drawContext, white); 150 150 CGContextFillRect(drawContext, rect); 151 CGContextSetBlendMode(drawContext, kCGBlendModeNormal); 152 CGContextDrawImage(drawContext, rect, srcImage); 151 if (srcImage) { 152 CGContextSetBlendMode(drawContext, kCGBlendModeNormal); 153 CGContextDrawImage(drawContext, rect, srcImage); 154 } 153 155 CGContextRelease(drawContext); 154 156 -
trunk/Source/WebCore/platform/win/DragImageCairoWin.cpp
r117322 r136147 174 174 cairo_fill_preserve(cr); 175 175 176 cairo_surface_t* srcImage = img->nativeImageForCurrentFrame()->surface(); 176 NativeImageCairo* srcNativeImage = img->nativeImageForCurrentFrame(); 177 cairo_surface_t* srcImage = (srcNativeImage) ? srcNativeImage->surface() : 0; 177 178 178 // Draw the image. 179 cairo_set_source_surface(cr, srcImage, 0.0, 0.0); 180 cairo_paint(cr); 179 if (srcImage) { 180 // Draw the image. 181 cairo_set_source_surface(cr, srcImage, 0.0, 0.0); 182 cairo_paint(cr); 183 } 181 184 182 185 deallocContext(drawContext);
Note:
See TracChangeset
for help on using the changeset viewer.