Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 virtual void flush(); | 193 virtual void flush(); |
| 194 | 194 |
| 195 virtual size_t bytesWritten() const = 0; | 195 virtual size_t bytesWritten() const = 0; |
| 196 | 196 |
| 197 // helpers | 197 // helpers |
| 198 | 198 |
| 199 bool write8(U8CPU); | 199 bool write8(U8CPU); |
| 200 bool write16(U16CPU); | 200 bool write16(U16CPU); |
| 201 bool write32(uint32_t); | 201 bool write32(uint32_t); |
| 202 | 202 |
| 203 bool writeText(const char text[]); | 203 bool writeText(const char text[]) { |
| 204 SkASSERT(text); | |
| 205 return this->write(text, strlen(text)); | |
|
bungeman-skia
2016/04/01 15:19:18
The win here appears to be mostly that the compile
| |
| 206 } | |
| 204 bool writeDecAsText(int32_t); | 207 bool writeDecAsText(int32_t); |
| 205 bool writeBigDecAsText(int64_t, int minDigits = 0); | 208 bool writeBigDecAsText(int64_t, int minDigits = 0); |
| 206 bool writeHexAsText(uint32_t, int minDigits = 0); | 209 bool writeHexAsText(uint32_t, int minDigits = 0); |
| 207 bool writeScalarAsText(SkScalar); | 210 bool writeScalarAsText(SkScalar); |
| 208 | 211 |
| 209 bool writeBool(bool v) { return this->write8(v); } | 212 bool writeBool(bool v) { return this->write8(v); } |
| 210 bool writeScalar(SkScalar); | 213 bool writeScalar(SkScalar); |
| 211 bool writePackedUInt(size_t); | 214 bool writePackedUInt(size_t); |
| 212 | 215 |
| 213 bool writeStream(SkStream* input, size_t length); | 216 bool writeStream(SkStream* input, size_t length); |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 441 | 444 |
| 442 private: | 445 private: |
| 443 size_t fBytesWritten; | 446 size_t fBytesWritten; |
| 444 typedef SkWStream INHERITED; | 447 typedef SkWStream INHERITED; |
| 445 }; | 448 }; |
| 446 | 449 |
| 447 // for now | 450 // for now |
| 448 typedef SkFILEStream SkURLStream; | 451 typedef SkFILEStream SkURLStream; |
| 449 | 452 |
| 450 #endif | 453 #endif |
| OLD | NEW |