#include "SkDocument.h"
#include "SkError.h"
#include "SkImageGenerator.h"
+#include "SkMallocPixelRef.h"
#include "SkMultiPictureDraw.h"
#include "SkNullCanvas.h"
#include "SkOSFile.h"
SkAlphaType alphaType = kPremul_SkAlphaType;
(void)SkColorTypeValidateAlphaType(fColorType, alphaType, &alphaType);
- dst->allocPixels(SkImageInfo::Make(size.width(), size.height(), fColorType, alphaType));
- dst->eraseColor(SK_ColorTRANSPARENT);
+ SkMallocPixelRef::ZeroedPRFactory factory;
+ dst->allocPixels(SkImageInfo::Make(size.width(), size.height(), fColorType, alphaType),
+ &factory,
+ nullptr/*colortable*/);
SkCanvas canvas(*dst);
return src.draw(&canvas);
}
fBitmap.setInfo(info, info.minRowBytes());
fBitmap.setPixelRef(pr);
fWeOwnThePixels = true;
-
- if (!info.isOpaque()) {
- fBitmap.eraseColor(SK_ColorTRANSPARENT);
- }
}
SkCanvas* SkSurface_Raster::onNewCanvas() { return new SkCanvas(fBitmap, this->props()); }
return nullptr;
}
- SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewAllocate(info, 0, nullptr));
+ SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewZeroed(info, 0, nullptr));
if (nullptr == pr.get()) {
return nullptr;
}