Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Unified Diff: dm/DMSrcSink.cpp

Issue 1557713003: Two malloc+bzero -> calloc. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/image/SkSurface_Raster.cpp » ('j') | src/image/SkSurface_Raster.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 5bc5e5a30d6494f44892ee5e53182ad6a9d18f16..fa600ff4eb33bc07ba22c6d0eebe46e435085b52 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -14,6 +14,7 @@
#include "SkDocument.h"
#include "SkError.h"
#include "SkImageGenerator.h"
+#include "SkMallocPixelRef.h"
#include "SkMultiPictureDraw.h"
#include "SkNullCanvas.h"
#include "SkOSFile.h"
@@ -973,8 +974,10 @@ Error RasterSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString*) con
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);
}
« no previous file with comments | « no previous file | src/image/SkSurface_Raster.cpp » ('j') | src/image/SkSurface_Raster.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698