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

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

Issue 22861028: Handle SkStream::rewind properly. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: More refinement. Created 7 years, 3 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 | « no previous file | src/images/SkImageDecoder_libpng.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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 SkScalar readScalar(); 89 SkScalar readScalar();
90 size_t readPackedUInt(); 90 size_t readPackedUInt();
91 91
92 /** 92 /**
93 * Reconstitute an SkData object that was written to the stream 93 * Reconstitute an SkData object that was written to the stream
94 * using SkWStream::writeData(). 94 * using SkWStream::writeData().
95 */ 95 */
96 SkData* readData(); 96 SkData* readData();
97 97
98 //SkStreamRewindable 98 //SkStreamRewindable
99 /** Rewinds to the beginning of the stream. If this cannot be done, return f alse. */ 99 /** Rewinds to the beginning of the stream. The current position is not affe cted
100 * when false is returned.
101 *
102 * Returns false iff after this call one of the following is true:
103 * * The stream is known to be somewhere other than the beginning.
104 * * It is unknown whether the stream is at the beginning.
reed1 2013/08/27 20:00:37 Are both of these iff clauses true at the same tim
scroggo 2013/08/27 20:12:56 No. An implementation could return false if the st
105 */
100 virtual bool rewind() { return false; } 106 virtual bool rewind() { return false; }
101 107
102 /** Duplicates this stream. If this cannot be done, returns NULL. 108 /** Duplicates this stream. If this cannot be done, returns NULL.
103 * The returned stream will be positioned at the beginning of its data. 109 * The returned stream will be positioned at the beginning of its data.
104 */ 110 */
105 virtual SkStreamRewindable* duplicate() const { return NULL; } 111 virtual SkStreamRewindable* duplicate() const { return NULL; }
106 112
107 //SkStreamSeekable 113 //SkStreamSeekable
108 /** Returns true if this stream can report it's current position. */ 114 /** Returns true if this stream can report it's current position. */
109 virtual bool hasPosition() const { return false; } 115 virtual bool hasPosition() const { return false; }
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 virtual void newline() SK_OVERRIDE; 464 virtual void newline() SK_OVERRIDE;
459 465
460 private: 466 private:
461 typedef SkWStream INHERITED; 467 typedef SkWStream INHERITED;
462 }; 468 };
463 469
464 // for now 470 // for now
465 typedef SkFILEStream SkURLStream; 471 typedef SkFILEStream SkURLStream;
466 472
467 #endif 473 #endif
OLDNEW
« no previous file with comments | « no previous file | src/images/SkImageDecoder_libpng.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698