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

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

Issue 943423002: SkStream: Add SkDynamicMemoryWStream::writeToStream(SkWStream*) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-02-23 (Monday) 15:03:08 EST Created 5 years, 10 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
« no previous file with comments | « no previous file | 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 bool write(const void* buffer, size_t size) SK_OVERRIDE; 388 bool write(const void* buffer, size_t size) SK_OVERRIDE;
389 size_t bytesWritten() const SK_OVERRIDE { return fBytesWritten; } 389 size_t bytesWritten() const SK_OVERRIDE { return fBytesWritten; }
390 // random access write 390 // random access write
391 // modifies stream and returns true if offset + size is less than or equal t o getOffset() 391 // modifies stream and returns true if offset + size is less than or equal t o getOffset()
392 bool write(const void* buffer, size_t offset, size_t size); 392 bool write(const void* buffer, size_t offset, size_t size);
393 bool read(void* buffer, size_t offset, size_t size); 393 bool read(void* buffer, size_t offset, size_t size);
394 size_t getOffset() const { return fBytesWritten; } 394 size_t getOffset() const { return fBytesWritten; }
395 395
396 // copy what has been written to the stream into dst 396 // copy what has been written to the stream into dst
397 void copyTo(void* dst) const; 397 void copyTo(void* dst) const;
398 void writeToStream(SkWStream* dst) const;
398 399
399 /** 400 /**
400 * Return a copy of the data written so far. This call is responsible for 401 * Return a copy of the data written so far. This call is responsible for
401 * calling unref() when they are finished with the data. 402 * calling unref() when they are finished with the data.
402 */ 403 */
403 SkData* copyToData() const; 404 SkData* copyToData() const;
404 405
405 /** Reset, returning a reader stream with the current content. */ 406 /** Reset, returning a reader stream with the current content. */
406 SkStreamAsset* detachAsStream(); 407 SkStreamAsset* detachAsStream();
407 408
(...skipping 29 matching lines...) Expand all
437 438
438 private: 439 private:
439 size_t fBytesWritten; 440 size_t fBytesWritten;
440 typedef SkWStream INHERITED; 441 typedef SkWStream INHERITED;
441 }; 442 };
442 443
443 // for now 444 // for now
444 typedef SkFILEStream SkURLStream; 445 typedef SkFILEStream SkURLStream;
445 446
446 #endif 447 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698