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