Switch SkPDFStream's internal storage from SkStream to SkData
Motivation: This makes SkPDFStream thread-safe for two threads
serializing it at once, since a SkStream has an internal position.
Updated SkPDFFont, SkPDFGraphicState, and SkPDFPage's use of
SkPDFStream to use the SkData constructor rather than the SkStream
constructor (saving a memcpy).
BUG=skia:2683
Committed: https://skia.googlesource.com/skia/+/c1dfa14b645ae274780f026dd86c9b633fbdad06
R=mtklein@google.com, djsollen@google.com, rmistry@google.com, robertphillips@google.com
Author: halcanary@google.com
Review URL: https://codereview.chromium.org/340783013
diff --git a/src/ports/SkImageDecoder_CG.cpp b/src/ports/SkImageDecoder_CG.cpp
index 8545ac8..8bf30d2 100644
--- a/src/ports/SkImageDecoder_CG.cpp
+++ b/src/ports/SkImageDecoder_CG.cpp
@@ -11,7 +11,7 @@
#include "SkImageEncoder.h"
#include "SkMovie.h"
#include "SkStream.h"
-#include "SkStreamHelpers.h"
+#include "SkStreamPriv.h"
#include "SkTemplates.h"
#include "SkUnPreMultiply.h"
@@ -32,7 +32,7 @@
static CGDataProviderRef SkStreamToDataProvider(SkStream* stream) {
// TODO: use callbacks, so we don't have to load all the data into RAM
SkAutoMalloc storage;
- const size_t len = CopyStreamToStorage(&storage, stream);
+ const size_t len = SkCopyStreamToStorage(&storage, stream);
void* data = storage.detach();
return CGDataProviderCreateWithData(data, data, len, malloc_release_proc);