| 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" |
| 11 #include "SkFlattenableBuffers.h" | 11 #include "SkFlattenableBuffers.h" |
| 12 #include <new> | 12 #include <new> |
| 13 | 13 |
| 14 SK_DEFINE_INST_COUNT(SkPathHeap) | |
| 15 | |
| 16 #define kPathCount 64 | 14 #define kPathCount 64 |
| 17 | 15 |
| 18 SkPathHeap::SkPathHeap() : fHeap(kPathCount * sizeof(SkPath)) { | 16 SkPathHeap::SkPathHeap() : fHeap(kPathCount * sizeof(SkPath)) { |
| 19 } | 17 } |
| 20 | 18 |
| 21 SkPathHeap::SkPathHeap(SkFlattenableReadBuffer& buffer) | 19 SkPathHeap::SkPathHeap(SkFlattenableReadBuffer& buffer) |
| 22 : fHeap(kPathCount * sizeof(SkPath)) { | 20 : fHeap(kPathCount * sizeof(SkPath)) { |
| 23 const int count = buffer.readInt(); | 21 const int count = buffer.readInt(); |
| 24 | 22 |
| 25 fPaths.setCount(count); | 23 fPaths.setCount(count); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 54 int count = fPaths.count(); | 52 int count = fPaths.count(); |
| 55 | 53 |
| 56 buffer.writeInt(count); | 54 buffer.writeInt(count); |
| 57 SkPath* const* iter = fPaths.begin(); | 55 SkPath* const* iter = fPaths.begin(); |
| 58 SkPath* const* stop = fPaths.end(); | 56 SkPath* const* stop = fPaths.end(); |
| 59 while (iter < stop) { | 57 while (iter < stop) { |
| 60 buffer.writePath(**iter); | 58 buffer.writePath(**iter); |
| 61 iter++; | 59 iter++; |
| 62 } | 60 } |
| 63 } | 61 } |
| OLD | NEW |