зеркало из https://github.com/mozilla/moz-skia.git
Add a detachAsStream to SkDynamicMemoryWStream.
R=reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=10171 Committed: https://code.google.com/p/skia/source/detail?r=10178 Review URL: https://codereview.chromium.org/19677002 git-svn-id: http://skia.googlecode.com/svn/trunk@10218 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
2b0ab9e13a
Коммит
c29f3d8c6d
|
@ -1025,7 +1025,7 @@ public:
|
|||
static SkPicture* stream_to_new_picture(const SkPicture& src) {
|
||||
SkDynamicMemoryWStream storage;
|
||||
src.serialize(&storage);
|
||||
SkAutoTUnref<SkStreamAsset> pictReadback(storage.detatchAsStream());
|
||||
SkAutoTUnref<SkStreamAsset> pictReadback(storage.detachAsStream());
|
||||
SkPicture* retval = SkPicture::CreateFromStream(pictReadback);
|
||||
return retval;
|
||||
}
|
||||
|
@ -1063,7 +1063,7 @@ public:
|
|||
bitmap = NULL; // we don't generate a bitmap rendering of the XPS file
|
||||
}
|
||||
|
||||
SkAutoTUnref<SkStreamAsset> documentStream(document.detatchAsStream());
|
||||
SkAutoTUnref<SkStreamAsset> documentStream(document.detachAsStream());
|
||||
if (NULL == bitmap) {
|
||||
return compare_test_results_to_stored_expectations(
|
||||
gm, gRec, writePath, NULL, documentStream);
|
||||
|
|
|
@ -427,7 +427,7 @@ public:
|
|||
SkData* copyToData() const;
|
||||
|
||||
/** Reset, returning a reader stream with the current content. */
|
||||
SkStreamAsset* detatchAsStream();
|
||||
SkStreamAsset* detachAsStream();
|
||||
|
||||
/** Reset the stream to its original, empty, state. */
|
||||
void reset();
|
||||
|
|
|
@ -781,7 +781,7 @@ private:
|
|||
size_t fCurrentOffset;
|
||||
};
|
||||
|
||||
SkStreamAsset* SkDynamicMemoryWStream::detatchAsStream() {
|
||||
SkStreamAsset* SkDynamicMemoryWStream::detachAsStream() {
|
||||
if (fCopy) {
|
||||
SkMemoryStream* stream = SkNEW_ARGS(SkMemoryStream, (fCopy));
|
||||
this->reset();
|
||||
|
|
|
@ -93,7 +93,7 @@ static void TestWStream(skiatest::Reporter* reporter) {
|
|||
}
|
||||
|
||||
{
|
||||
SkAutoTUnref<SkStreamAsset> stream(ds.detatchAsStream());
|
||||
SkAutoTUnref<SkStreamAsset> stream(ds.detachAsStream());
|
||||
REPORTER_ASSERT(reporter, 100 * 26 == stream->getLength());
|
||||
REPORTER_ASSERT(reporter, ds.getOffset() == 0);
|
||||
test_loop_stream(reporter, stream.get(), s, 26, 100);
|
||||
|
@ -123,7 +123,7 @@ static void TestWStream(skiatest::Reporter* reporter) {
|
|||
|
||||
{
|
||||
// Test that this works after a copyToData.
|
||||
SkAutoTUnref<SkStreamAsset> stream(ds.detatchAsStream());
|
||||
SkAutoTUnref<SkStreamAsset> stream(ds.detachAsStream());
|
||||
REPORTER_ASSERT(reporter, ds.getOffset() == 0);
|
||||
test_loop_stream(reporter, stream.get(), s, 26, 100);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче