OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
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 #include "SkPathHeap.h" | 8 #include "SkPathHeap.h" |
9 #include "SkPath.h" | 9 #include "SkPath.h" |
10 #include "SkStream.h" | 10 #include "SkStream.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 SkPath* p = (SkPath*)fHeap.allocThrow(sizeof(SkPath)); | 47 SkPath* p = (SkPath*)fHeap.allocThrow(sizeof(SkPath)); |
48 new (p) SkPath(path); | 48 new (p) SkPath(path); |
49 *fPaths.append() = p; | 49 *fPaths.append() = p; |
50 return fPaths.count(); | 50 return fPaths.count(); |
51 } | 51 } |
52 | 52 |
53 void SkPathHeap::flatten(SkFlattenableWriteBuffer& buffer) const { | 53 void SkPathHeap::flatten(SkFlattenableWriteBuffer& buffer) const { |
54 int count = fPaths.count(); | 54 int count = fPaths.count(); |
55 | 55 |
56 buffer.writeInt(count); | 56 buffer.writeInt(count); |
57 SkPath** iter = fPaths.begin(); | 57 SkPath* const* iter = fPaths.begin(); |
58 SkPath** stop = fPaths.end(); | 58 SkPath* const* stop = fPaths.end(); |
59 while (iter < stop) { | 59 while (iter < stop) { |
60 buffer.writePath(**iter); | 60 buffer.writePath(**iter); |
61 iter++; | 61 iter++; |
62 } | 62 } |
63 } | 63 } |
OLD | NEW |