| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkWriter32_DEFINED | 10 #ifndef SkWriter32_DEFINED |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 , fTail(NULL) | 39 , fTail(NULL) |
| 40 , fMinSize(minSize) | 40 , fMinSize(minSize) |
| 41 , fSize(0) | 41 , fSize(0) |
| 42 , fWrittenBeforeLastBlock(0) | 42 , fWrittenBeforeLastBlock(0) |
| 43 {} | 43 {} |
| 44 | 44 |
| 45 ~SkWriter32(); | 45 ~SkWriter32(); |
| 46 | 46 |
| 47 // return the current offset (will always be a multiple of 4) | 47 // return the current offset (will always be a multiple of 4) |
| 48 size_t bytesWritten() const { return fSize; } | 48 size_t bytesWritten() const { return fSize; } |
| 49 // DEPRECATED: use bytesWritten instead TODO(mtklein): clean up | 49 |
| 50 SK_ATTR_DEPRECATED("use bytesWritten") |
| 50 size_t size() const { return this->bytesWritten(); } | 51 size_t size() const { return this->bytesWritten(); } |
| 51 | 52 |
| 52 // Returns true if we've written only into the storage passed into construct
or or reset. | 53 // Returns true if we've written only into the storage passed into construct
or or reset. |
| 53 // (You may be able to use this to avoid a call to flatten.) | 54 // (You may be able to use this to avoid a call to flatten.) |
| 54 bool wroteOnlyToStorage() const { | 55 bool wroteOnlyToStorage() const { |
| 55 return fHead == &fExternalBlock && this->bytesWritten() <= fExternalBloc
k.fSizeOfBlock; | 56 return fHead == &fExternalBlock && this->bytesWritten() <= fExternalBloc
k.fSizeOfBlock; |
| 56 } | 57 } |
| 57 | 58 |
| 58 void reset(); | 59 void reset(); |
| 59 void reset(void* storage, size_t size); | 60 void reset(void* storage, size_t size); |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 | 297 |
| 297 private: | 298 private: |
| 298 union { | 299 union { |
| 299 void* fPtrAlignment; | 300 void* fPtrAlignment; |
| 300 double fDoubleAlignment; | 301 double fDoubleAlignment; |
| 301 char fStorage[SIZE]; | 302 char fStorage[SIZE]; |
| 302 } fData; | 303 } fData; |
| 303 }; | 304 }; |
| 304 | 305 |
| 305 #endif | 306 #endif |
| OLD | NEW |