Added SkPDFStream::setData(SkData*) in preparation for move from SkStream to SkData
R=vandebo@chromium.org, edisonn@google.com Author: richardlin@chromium.org Review URL: https://chromiumcodereview.appspot.com/18328026 git-svn-id: http://skia.googlecode.com/svn/trunk@9916 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
a7df69865c
commit
d8d976e7d2
@ -25,9 +25,7 @@ SkPDFStream::SkPDFStream(SkStream* stream)
|
||||
}
|
||||
|
||||
SkPDFStream::SkPDFStream(SkData* data) : fState(kUnused_State) {
|
||||
SkMemoryStream* stream = new SkMemoryStream;
|
||||
stream->setData(data);
|
||||
fData.reset(stream); // Transfer ownership.
|
||||
setData(data);
|
||||
}
|
||||
|
||||
SkPDFStream::SkPDFStream(const SkPDFStream& pdfStream)
|
||||
@ -84,6 +82,12 @@ size_t SkPDFStream::getOutputSize(SkPDFCatalog* catalog, bool indirect) {
|
||||
|
||||
SkPDFStream::SkPDFStream() : fState(kUnused_State) {}
|
||||
|
||||
void SkPDFStream::setData(SkData* data) {
|
||||
SkMemoryStream* stream = new SkMemoryStream;
|
||||
stream->setData(data);
|
||||
fData.reset(stream); // Transfer ownership.
|
||||
}
|
||||
|
||||
void SkPDFStream::setData(SkStream* stream) {
|
||||
fData.reset(stream);
|
||||
SkSafeRef(stream);
|
||||
|
@ -68,6 +68,7 @@ protected:
|
||||
return fSubstitute.get();
|
||||
}
|
||||
|
||||
void setData(SkData* data);
|
||||
void setData(SkStream* stream);
|
||||
|
||||
SkStream* getData() {
|
||||
|
Loading…
Reference in New Issue
Block a user