Index: src/image/SkImage_Raster.cpp |
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp |
index b80fbb3a542bf6d66610ac0cf47f2f9f8ecd78d7..32d53fc52ec2b4cf7322e0fbd8790fe595cd959c 100644 |
--- a/src/image/SkImage_Raster.cpp |
+++ b/src/image/SkImage_Raster.cpp |
@@ -58,7 +58,7 @@ |
virtual bool getROPixels(SkBitmap*) const SK_OVERRIDE; |
// exposed for SkSurface_Raster via SkNewImageFromPixelRef |
- SkImage_Raster(SkPixelRef*); |
+ SkImage_Raster(const SkImageInfo&, SkPixelRef*, size_t rowBytes); |
SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } |
@@ -84,16 +84,18 @@ |
SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes) |
: INHERITED(info.fWidth, info.fHeight) { |
+ fBitmap.setConfig(info, rowBytes); |
SkAutoTUnref<SkPixelRef> ref( |
SkMallocPixelRef::NewWithData(info, rowBytes, NULL, data, 0)); |
- fBitmap.installPixelRef(ref); |
+ fBitmap.setPixelRef(ref); |
fBitmap.setImmutable(); |
} |
-SkImage_Raster::SkImage_Raster(SkPixelRef* pr) |
- : INHERITED(pr->info()) |
+SkImage_Raster::SkImage_Raster(const Info& info, SkPixelRef* pr, size_t rowBytes) |
+ : INHERITED(info.fWidth, info.fHeight) |
{ |
- fBitmap.installPixelRef(pr); |
+ fBitmap.setConfig(info, rowBytes); |
+ fBitmap.setPixelRef(pr); |
} |
SkImage_Raster::~SkImage_Raster() {} |
@@ -153,8 +155,9 @@ |
return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes)); |
} |
-SkImage* SkNewImageFromPixelRef(SkPixelRef* pr) { |
- return SkNEW_ARGS(SkImage_Raster, (pr)); |
+SkImage* SkNewImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr, |
+ size_t rowBytes) { |
+ return SkNEW_ARGS(SkImage_Raster, (info, pr, rowBytes)); |
} |
SkPixelRef* SkBitmapImageGetPixelRef(SkImage* image) { |