Index: src/image/SkImage_Raster.cpp |
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp |
index 645a3db64b31b97d981501d3b72c4ae544256294..67d521e345ef26f46b442d9174c8844a1b54d686 100644 |
--- a/src/image/SkImage_Raster.cpp |
+++ b/src/image/SkImage_Raster.cpp |
@@ -7,6 +7,7 @@ |
#include "SkImage_Base.h" |
#include "SkBitmap.h" |
+#include "SkBitmapProcShader.h" |
#include "SkCanvas.h" |
#include "SkColorTable.h" |
#include "SkData.h" |
@@ -254,7 +255,8 @@ sk_sp<SkImage> SkMakeImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr, |
return sk_make_sp<SkImage_Raster>(info, pr, pixelRefOrigin, rowBytes); |
} |
-sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap& bm, SkCopyPixelsMode cpm) { |
+sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap& bm, SkCopyPixelsMode cpm, |
+ SkTBlitterAllocator* allocator) { |
bool hasColorTable = false; |
if (kIndex_8_SkColorType == bm.colorType()) { |
SkAutoLockPixels autoLockPixels(bm); |
@@ -274,7 +276,12 @@ sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap& bm, SkCopyPixelsMode |
image = SkImage::MakeRasterCopy(pmap); |
} |
} else { |
- image = sk_make_sp<SkImage_Raster>(bm, kNever_SkCopyPixelsMode == cpm); |
+ if (allocator) { |
+ image.reset(allocator->createT<SkImage_Raster>(bm, kNever_SkCopyPixelsMode == cpm)); |
+ image.get()->ref(); // account for the allocator being an owner |
f(malita)
2016/08/05 21:06:22
nit:
image = sk_ref_sp(allocator->createT<>(..
reed1
2016/08/05 21:46:57
Also works, but not sure it reads as clearly (or a
|
+ } else { |
+ image = sk_make_sp<SkImage_Raster>(bm, kNever_SkCopyPixelsMode == cpm); |
+ } |
} |
return image; |
} |