Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1037)

Unified Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 1084313004: Oilpan: keep ImageData on the heap by default. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Ensure timely disposal of temporary ImageData buffers Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | Source/core/html/ImageData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLCanvasElement.cpp
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index 4f2e7fcf56576b0f3d8576ebcba6639da8880211..3abea2a173b91f469f8eb0dba33fbe8d846c9820 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -484,14 +484,15 @@ String HTMLCanvasElement::toDataURLInternal(const String& mimeType, const double
String encodingMimeType = toEncodingMimeType(mimeType);
if (!m_context) {
- RefPtrWillBeRawPtr<ImageData> imageData = ImageData::create(m_size);
+ ImageData* imageData = ImageData::create(m_size);
+ ScopedDisposal<ImageData> disposer(imageData);
return ImageDataBuffer(imageData->size(), imageData->data()->data()).toDataURL(encodingMimeType, quality);
}
if (m_context->is3d()) {
// Get non-premultiplied data because of inaccurate premultiplied alpha conversion of buffer()->toDataURL().
- RefPtrWillBeRawPtr<ImageData> imageData =
- toWebGLRenderingContextBase(m_context.get())->paintRenderingResultsToImageData(sourceBuffer);
+ ImageData* imageData = toWebGLRenderingContextBase(m_context.get())->paintRenderingResultsToImageData(sourceBuffer);
+ ScopedDisposal<ImageData> disposer(imageData);
if (imageData)
return ImageDataBuffer(imageData->size(), imageData->data()->data()).toDataURL(encodingMimeType, quality);
m_context->paintRenderingResultsToCanvas(sourceBuffer);
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | Source/core/html/ImageData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698