| 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 |
| 11 #define SkWriter32_DEFINED | 11 #define SkWriter32_DEFINED |
| 12 | 12 |
| 13 #include "SkData.h" | 13 #include "SkData.h" |
| 14 #include "SkMatrix.h" | 14 #include "SkMatrix.h" |
| 15 #include "SkPatch.h" | |
| 16 #include "SkPath.h" | 15 #include "SkPath.h" |
| 17 #include "SkPoint.h" | 16 #include "SkPoint.h" |
| 18 #include "SkRRect.h" | 17 #include "SkRRect.h" |
| 19 #include "SkRect.h" | 18 #include "SkRect.h" |
| 20 #include "SkRegion.h" | 19 #include "SkRegion.h" |
| 21 #include "SkScalar.h" | 20 #include "SkScalar.h" |
| 22 #include "SkStream.h" | 21 #include "SkStream.h" |
| 23 #include "SkTemplates.h" | 22 #include "SkTemplates.h" |
| 24 #include "SkTypes.h" | 23 #include "SkTypes.h" |
| 25 | 24 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 *(SkRect*)this->reserve(sizeof(rect)) = rect; | 130 *(SkRect*)this->reserve(sizeof(rect)) = rect; |
| 132 } | 131 } |
| 133 | 132 |
| 134 void writeIRect(const SkIRect& rect) { | 133 void writeIRect(const SkIRect& rect) { |
| 135 *(SkIRect*)this->reserve(sizeof(rect)) = rect; | 134 *(SkIRect*)this->reserve(sizeof(rect)) = rect; |
| 136 } | 135 } |
| 137 | 136 |
| 138 void writeRRect(const SkRRect& rrect) { | 137 void writeRRect(const SkRRect& rrect) { |
| 139 rrect.writeToMemory(this->reserve(SkRRect::kSizeInMemory)); | 138 rrect.writeToMemory(this->reserve(SkRRect::kSizeInMemory)); |
| 140 } | 139 } |
| 141 | |
| 142 void writePatch(const SkPatch& patch) { | |
| 143 size_t size = patch.writeToMemory(NULL); | |
| 144 SkASSERT(SkAlign4(size) == size); | |
| 145 patch.writeToMemory(this->reserve(size)); | |
| 146 } | |
| 147 | 140 |
| 148 void writePath(const SkPath& path) { | 141 void writePath(const SkPath& path) { |
| 149 size_t size = path.writeToMemory(NULL); | 142 size_t size = path.writeToMemory(NULL); |
| 150 SkASSERT(SkAlign4(size) == size); | 143 SkASSERT(SkAlign4(size) == size); |
| 151 path.writeToMemory(this->reserve(size)); | 144 path.writeToMemory(this->reserve(size)); |
| 152 } | 145 } |
| 153 | 146 |
| 154 void writeMatrix(const SkMatrix& matrix) { | 147 void writeMatrix(const SkMatrix& matrix) { |
| 155 size_t size = matrix.writeToMemory(NULL); | 148 size_t size = matrix.writeToMemory(NULL); |
| 156 SkASSERT(SkAlign4(size) == size); | 149 SkASSERT(SkAlign4(size) == size); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 union { | 272 union { |
| 280 void* fPtrAlignment; | 273 void* fPtrAlignment; |
| 281 double fDoubleAlignment; | 274 double fDoubleAlignment; |
| 282 char fStorage[SIZE]; | 275 char fStorage[SIZE]; |
| 283 } fData; | 276 } fData; |
| 284 | 277 |
| 285 typedef SkWriter32 INHERITED; | 278 typedef SkWriter32 INHERITED; |
| 286 }; | 279 }; |
| 287 | 280 |
| 288 #endif | 281 #endif |
| OLD | NEW |