summaryrefslogtreecommitdiff
path: root/libs/hwui/RecordingCanvas.h
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2016-02-11 00:36:34 +0000
committerJohn Reck <jreck@google.com>2016-02-11 00:36:34 +0000
commite537330ead4111cae74668bbc25a332e186d6c91 (patch)
treed73486362948e23296173ce418594bb654acea13 /libs/hwui/RecordingCanvas.h
parent499d83f21e7ffb687788bba1668b05fe38f6ebaf (diff)
Revert "Fix all LA memory leaks forever!"
This reverts commit 499d83f21e7ffb687788bba1668b05fe38f6ebaf. Change-Id: Ia893ae16ebbeae68e49cd13a20587104b73d39a0
Diffstat (limited to 'libs/hwui/RecordingCanvas.h')
-rw-r--r--libs/hwui/RecordingCanvas.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/hwui/RecordingCanvas.h b/libs/hwui/RecordingCanvas.h
index 719872d35169..cc14e6111cec 100644
--- a/libs/hwui/RecordingCanvas.h
+++ b/libs/hwui/RecordingCanvas.h
@@ -219,7 +219,7 @@ private:
inline const T* refBuffer(const T* srcBuffer, int32_t count) {
if (!srcBuffer) return nullptr;
- T* dstBuffer = (T*) mDisplayList->allocator.alloc<T>(count * sizeof(T));
+ T* dstBuffer = (T*) mDisplayList->allocator.alloc(count * sizeof(T));
memcpy(dstBuffer, srcBuffer, count * sizeof(T));
return dstBuffer;
}
@@ -290,7 +290,8 @@ private:
// correctly, such as creating the bitmap from scratch, drawing with it, changing its
// contents, and drawing again. The only fix would be to always copy it the first time,
// which doesn't seem worth the extra cycles for this unlikely case.
- SkBitmap* localBitmap = alloc().create<SkBitmap>(bitmap);
+ SkBitmap* localBitmap = new (alloc()) SkBitmap(bitmap);
+ alloc().autoDestroy(localBitmap);
mDisplayList->bitmapResources.push_back(localBitmap);
return localBitmap;
}