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

Unified Diff: Source/platform/graphics/ImageBuffer.cpp

Issue 1186863005: Add a ref-counted data holder to ArrayBufferContents (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: separate transfer() + neuter() logic Created 5 years, 6 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
Index: Source/platform/graphics/ImageBuffer.cpp
diff --git a/Source/platform/graphics/ImageBuffer.cpp b/Source/platform/graphics/ImageBuffer.cpp
index b85322effef6821e99dd8cb9d4f5b67e8b1d7bb4..aaa7b87937fda2dae3b5a3b71253e490aea7a927 100644
--- a/Source/platform/graphics/ImageBuffer.cpp
+++ b/Source/platform/graphics/ImageBuffer.cpp
@@ -276,7 +276,7 @@ bool ImageBuffer::getImageData(Multiply multiplied, const IntRect& rect, WTF::Ar
return false;
if (!isSurfaceValid()) {
- WTF::ArrayBufferContents result(rect.width() * rect.height(), 4, WTF::ArrayBufferContents::ZeroInitialize);
+ WTF::ArrayBufferContents result(rect.width() * rect.height(), 4, WTF::ArrayBufferContents::NotShared, WTF::ArrayBufferContents::ZeroInitialize);
result.transfer(contents);
return true;
}
@@ -288,6 +288,7 @@ bool ImageBuffer::getImageData(Multiply multiplied, const IntRect& rect, WTF::Ar
|| rect.maxY() > m_surface->size().height();
WTF::ArrayBufferContents result(
rect.width() * rect.height(), 4,
+ WTF::ArrayBufferContents::NotShared,
hasStrayArea
? WTF::ArrayBufferContents::ZeroInitialize
: WTF::ArrayBufferContents::DontInitialize);

Powered by Google App Engine
This is Rietveld 408576698