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 | 8 |
9 #include "SkAnnotation.h" | 9 #include "SkAnnotation.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1120 fWriter.write(storage, size); | 1120 fWriter.write(storage, size); |
1121 for (size_t i = 0; i < size/4; i++) { | 1121 for (size_t i = 0; i < size/4; i++) { |
1122 // SkDebugf("[%d] %08X\n", i, storage[i]); | 1122 // SkDebugf("[%d] %08X\n", i, storage[i]); |
1123 } | 1123 } |
1124 } | 1124 } |
1125 | 1125 |
1126 // | 1126 // |
1127 // Do these after we've written kPaintOp_DrawOp | 1127 // Do these after we've written kPaintOp_DrawOp |
1128 | 1128 |
1129 if (base.getAnnotation() != paint.getAnnotation()) { | 1129 if (base.getAnnotation() != paint.getAnnotation()) { |
1130 base.setAnnotation(paint.getAnnotation()); | |
scroggo
2013/10/29 19:06:04
nit: The other cases all modify base after recordi
mtklein
2013/10/29 19:11:31
Done, though I suspect this may be why Mike missed
| |
1130 if (NULL == paint.getAnnotation()) { | 1131 if (NULL == paint.getAnnotation()) { |
1131 this->writeOp(kSetAnnotation_DrawOp, 0, 0); | 1132 this->writeOp(kSetAnnotation_DrawOp, 0, 0); |
1132 } else { | 1133 } else { |
1133 SkOrderedWriteBuffer buffer(1024); | 1134 SkOrderedWriteBuffer buffer(1024); |
1134 paint.getAnnotation()->writeToBuffer(buffer); | 1135 paint.getAnnotation()->writeToBuffer(buffer); |
1135 size = buffer.bytesWritten(); | 1136 size = buffer.bytesWritten(); |
1136 | 1137 |
1137 SkAutoMalloc storage(size); | 1138 SkAutoMalloc storage(size); |
1138 buffer.writeToMemory(storage.get()); | 1139 buffer.writeToMemory(storage.get()); |
1139 | 1140 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1210 fCanvas->ref(); | 1211 fCanvas->ref(); |
1211 } | 1212 } |
1212 | 1213 |
1213 BitmapShuttle::~BitmapShuttle() { | 1214 BitmapShuttle::~BitmapShuttle() { |
1214 fCanvas->unref(); | 1215 fCanvas->unref(); |
1215 } | 1216 } |
1216 | 1217 |
1217 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) { | 1218 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) { |
1218 return fCanvas->shuttleBitmap(bitmap, slot); | 1219 return fCanvas->shuttleBitmap(bitmap, slot); |
1219 } | 1220 } |
OLD | NEW |