Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: include/core/SkStream.h

Issue 19677002: Add a detachAsStream to SkDynamicMemoryWStream. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Spel beter. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gm/gmmain.cpp ('k') | src/core/SkStream.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkStream_DEFINED 8 #ifndef SkStream_DEFINED
9 #define SkStream_DEFINED 9 #define SkStream_DEFINED
10 10
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 // copy what has been written to the stream into dst 420 // copy what has been written to the stream into dst
421 void copyTo(void* dst) const; 421 void copyTo(void* dst) const;
422 422
423 /** 423 /**
424 * Return a copy of the data written so far. This call is responsible for 424 * Return a copy of the data written so far. This call is responsible for
425 * calling unref() when they are finished with the data. 425 * calling unref() when they are finished with the data.
426 */ 426 */
427 SkData* copyToData() const; 427 SkData* copyToData() const;
428 428
429 /** Reset, returning a reader stream with the current content. */ 429 /** Reset, returning a reader stream with the current content. */
430 SkStreamAsset* detatchAsStream(); 430 SkStreamAsset* detachAsStream();
431 431
432 /** Reset the stream to its original, empty, state. */ 432 /** Reset the stream to its original, empty, state. */
433 void reset(); 433 void reset();
434 void padToAlign4(); 434 void padToAlign4();
435 private: 435 private:
436 struct Block; 436 struct Block;
437 Block* fHead; 437 Block* fHead;
438 Block* fTail; 438 Block* fTail;
439 size_t fBytesWritten; 439 size_t fBytesWritten;
440 mutable SkData* fCopy; // is invalidated if we write after it is created 440 mutable SkData* fCopy; // is invalidated if we write after it is created
(...skipping 17 matching lines...) Expand all
458 virtual void newline() SK_OVERRIDE; 458 virtual void newline() SK_OVERRIDE;
459 459
460 private: 460 private:
461 typedef SkWStream INHERITED; 461 typedef SkWStream INHERITED;
462 }; 462 };
463 463
464 // for now 464 // for now
465 typedef SkFILEStream SkURLStream; 465 typedef SkFILEStream SkURLStream;
466 466
467 #endif 467 #endif
OLDNEW
« no previous file with comments | « gm/gmmain.cpp ('k') | src/core/SkStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698