Changeset 131805 in webkit
- Timestamp:
- Oct 18, 2012, 2:28:02 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r131804 r131805 1 2012-10-18 Mike Reed <reed@google.com> 2 3 Handle if we fail to allocate nonPlatformCanvas in ImageBuffer constructor 4 https://bugs.webkit.org/show_bug.cgi?id=99752 5 6 Reviewed by Stephen White. 7 8 Current code does not check if we were able to allocate the pixels, but still returns the canvas. 9 However, the caller explicitly is checking for null on failure, so it will continue (and possibly 10 crash later on). 11 This change brings the nonPlatformCanvas behavior inline with createAcceleratedCanvas and 12 TryCreateBitmapCanvas, both of which are also called by ImageBuffer's constructor. 13 14 No new tests. Existing tests exercise ImageBuffer constructor. 15 16 * platform/graphics/skia/ImageBufferSkia.cpp: 17 (WebCore::createNonPlatformCanvas): 18 1 19 2012-10-18 Beth Dakin <bdakin@apple.com> 2 20 -
trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
r131017 r131805 105 105 static SkCanvas* createNonPlatformCanvas(const IntSize& size) 106 106 { 107 Sk Canvas* canvas = new SkCanvas();108 canvas->setDevice(new SkDevice(SkBitmap::kARGB_8888_Config, size.width(), size.height()))->unref();109 return canvas;107 SkAutoTUnref<SkDevice> device(new SkDevice(SkBitmap::kARGB_8888_Config, size.width(), size.height())); 108 SkPixelRef* pixelRef = device->accessBitmap(false).pixelRef(); 109 return pixelRef ? new SkCanvas(device) : 0; 110 110 } 111 111
Note:
See TracChangeset
for help on using the changeset viewer.