diff options
Diffstat (limited to 'libs/hwui/DisplayListCanvas.h')
-rw-r--r-- | libs/hwui/DisplayListCanvas.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/hwui/DisplayListCanvas.h b/libs/hwui/DisplayListCanvas.h index 0064236..7f8ae72 100644 --- a/libs/hwui/DisplayListCanvas.h +++ b/libs/hwui/DisplayListCanvas.h @@ -350,9 +350,10 @@ 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. - const SkBitmap* cachedBitmap = mResourceCache.insert(bitmap); - mDisplayListData->bitmapResources.add(cachedBitmap); - return cachedBitmap; + const SkBitmap* localBitmap = new (alloc()) SkBitmap(bitmap); + alloc().autoDestroy(localBitmap); + mDisplayListData->bitmapResources.push_back(localBitmap); + return localBitmap; } inline const Res_png_9patch* refPatch(const Res_png_9patch* patch) { |