[chromium] Leaking SkBitmaps for background images
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Aug 2011 16:42:15 +0000 (16:42 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Aug 2011 16:42:15 +0000 (16:42 +0000)
commit4e6164e0b856084bab166a56421b733b2ad1a429
tree46889edf4731f02d64c4ba8dc54b55558c8185de
parent7f3d2fc00fa3910235866deaaab5b1b80ab7a104
[chromium] Leaking SkBitmaps for background images
https://bugs.webkit.org/show_bug.cgi?id=66488

Patch by John Bates <jbates@google.com> on 2011-08-25
Reviewed by Stephen White.

This patch simply changes NativeImageSkia to have a SkBitmap instead of
deriving from SkBitmap. All dependent code updated to access the member
instead of calling SkBitmap methods on NativeImageSkia objects. This
may or may not fix the memory leak, but it's definitely a bug that could
cause memory leaks.

Source/WebCore:

* platform/chromium/DragImageChromiumSkia.cpp:
(WebCore::createDragImageFromImage):
* platform/graphics/chromium/PlatformImage.cpp:
(WebCore::PlatformImage::updateFromImage):
* platform/graphics/skia/BitmapImageSingleFrameSkia.h:
(WebCore::BitmapImageSingleFrameSkia::currentFrameHasAlpha):
(WebCore::BitmapImageSingleFrameSkia::size):
(WebCore::BitmapImageSingleFrameSkia::notSolidColor):
* platform/graphics/skia/GraphicsContext3DSkia.cpp:
(WebCore::GraphicsContext3D::getImageData):
* platform/graphics/skia/ImageSkia.cpp:
(WebCore::paintSkBitmap):
(WebCore::Image::drawPattern):
(WebCore::BitmapImage::checkForSolidColor):
* platform/graphics/skia/NativeImageSkia.cpp:
(WebCore::NativeImageSkia::NativeImageSkia):
(WebCore::NativeImageSkia::decodedSize):
(WebCore::NativeImageSkia::resizedBitmap):
* platform/graphics/skia/NativeImageSkia.h:
(WebCore::NativeImageSkia::bitmap):
* platform/graphics/skia/PatternSkia.cpp:
(WebCore::Pattern::platformPattern):
* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageFrame::getAddr):
* platform/image-decoders/skia/ImageDecoderSkia.cpp:
(WebCore::ImageFrame::operator=):
(WebCore::ImageFrame::clearPixelData):
(WebCore::ImageFrame::zeroFillPixelData):
(WebCore::ImageFrame::copyBitmapData):
(WebCore::ImageFrame::setSize):
(WebCore::ImageFrame::hasAlpha):
(WebCore::ImageFrame::setHasAlpha):
(WebCore::ImageFrame::width):
(WebCore::ImageFrame::height):

Source/WebKit/chromium:

* src/PlatformBridge.cpp:
(WebCore::PlatformBridge::clipboardWriteImage):
* src/WebImageDecoder.cpp:
(WebKit::WebImageDecoder::getFrameAtIndex):
* src/WebImageSkia.cpp:
(WebKit::WebImage::fromData):
(WebKit::WebImage::operator=):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/chromium/DragImageChromiumSkia.cpp
Source/WebCore/platform/graphics/chromium/PlatformImage.cpp
Source/WebCore/platform/graphics/skia/BitmapImageSingleFrameSkia.h
Source/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
Source/WebCore/platform/graphics/skia/ImageSkia.cpp
Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
Source/WebCore/platform/graphics/skia/NativeImageSkia.h
Source/WebCore/platform/graphics/skia/PatternSkia.cpp
Source/WebCore/platform/image-decoders/ImageDecoder.h
Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/PlatformBridge.cpp
Source/WebKit/chromium/src/WebImageDecoder.cpp
Source/WebKit/chromium/src/WebImageSkia.cpp
Source/WebKit/chromium/tests/DragImageTest.cpp