Reason for revert:
Test to see if this fixes the bots.
Original issue's description:
> Consolidate SkStream copying methods
>
> Make SkCopyStreamToData call SkStreamCopy, removing duplicate code.
>
> The former still has its own method of copying with a length, since
> it saves one copy.
>
> BUG=skia:4788
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=
1640793002
>
> Committed: https://skia.googlesource.com/skia/+/
440c5a98dee428c661b77d149e30c794d264b8cd
TBR=halcanary@google.com,scroggo@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4788
Review URL: https://codereview.chromium.org/
1641853002
}
SkDynamicMemoryWStream tempStream;
- if (!SkStreamCopy(&tempStream, stream)) {
- return nullptr;
- }
+ const size_t bufferSize = 4096;
+ char buffer[bufferSize];
+ do {
+ size_t bytesRead = stream->read(buffer, bufferSize);
+ tempStream.write(buffer, bytesRead);
+ } while (!stream->isAtEnd());
return tempStream.copyToData();
}