aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkSurface_Raster.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/image/SkSurface_Raster.cpp')
-rw-r--r--src/image/SkSurface_Raster.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/image/SkSurface_Raster.cpp b/src/image/SkSurface_Raster.cpp
index 7010b5fb2a..1b218eb446 100644
--- a/src/image/SkSurface_Raster.cpp
+++ b/src/image/SkSurface_Raster.cpp
@@ -85,12 +85,15 @@ SkSurface_Raster::SkSurface_Raster(const SkImageInfo& info, void* pixels, size_t
}
SkSurface_Raster::SkSurface_Raster(SkPixelRef* pr)
- : INHERITED(pr->info())
+ : INHERITED(pr->info().fWidth, pr->info().fHeight)
{
- fBitmap.installPixelRef(pr);
+ const SkImageInfo& info = pr->info();
+
+ fBitmap.setConfig(info, info.minRowBytes());
+ fBitmap.setPixelRef(pr);
fWeOwnThePixels = true;
- if (!pr->info().isOpaque()) {
+ if (!info.isOpaque()) {
fBitmap.eraseColor(SK_ColorTRANSPARENT);
}
}