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; |
} |