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

Unified Diff: src/utils/mac/SkCreateCGImageRef.cpp

Issue 678763003: In SkPDFDocumentToBitmap, use SkCreateDataProviderFromStream (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/mac/SkCreateCGImageRef.cpp
diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp
index 14a24d87104dbf0baa8c12966fb3e44c20b2448c..51a5ed9c033d5c6002b8eb44131a4cf98994d114 100644
--- a/src/utils/mac/SkCreateCGImageRef.cpp
+++ b/src/utils/mac/SkCreateCGImageRef.cpp
@@ -188,17 +188,8 @@ private:
};
#define SkAutoPDFRelease(...) SK_REQUIRE_LOCAL_VAR(SkAutoPDFRelease)
-static void CGDataProviderReleaseData_FromMalloc(void*, const void* data,
- size_t size) {
- sk_free((void*)data);
-}
-
bool SkPDFDocumentToBitmap(SkStream* stream, SkBitmap* output) {
- size_t size = stream->getLength();
- void* ptr = sk_malloc_throw(size);
- stream->read(ptr, size);
- CGDataProviderRef data = CGDataProviderCreateWithData(NULL, ptr, size,
- CGDataProviderReleaseData_FromMalloc);
+ CGDataProviderRef data = SkCreateDataProviderFromStream(stream);
if (NULL == data) {
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698