| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 size_t bytesAllocated = 0; | 231 size_t bytesAllocated = 0; |
| 232 if (NULL != fBitmapHeap) { | 232 if (NULL != fBitmapHeap) { |
| 233 bytesAllocated += fBitmapHeap->bytesAllocated(); | 233 bytesAllocated += fBitmapHeap->bytesAllocated(); |
| 234 } | 234 } |
| 235 if (NULL != fImageHeap) { | 235 if (NULL != fImageHeap) { |
| 236 bytesAllocated += fImageHeap->bytesInCache(); | 236 bytesAllocated += fImageHeap->bytesInCache(); |
| 237 } | 237 } |
| 238 return bytesAllocated; | 238 return bytesAllocated; |
| 239 } | 239 } |
| 240 | 240 |
| 241 void beginCommentGroup(const char* description) override; | |
| 242 void addComment(const char* kywd, const char* value) override; | |
| 243 void endCommentGroup() override; | |
| 244 | |
| 245 /** | 241 /** |
| 246 * Flatten an SkBitmap to send to the reader, where it will be referenced | 242 * Flatten an SkBitmap to send to the reader, where it will be referenced |
| 247 * according to slot. | 243 * according to slot. |
| 248 */ | 244 */ |
| 249 bool shuttleBitmap(const SkBitmap&, int32_t slot); | 245 bool shuttleBitmap(const SkBitmap&, int32_t slot); |
| 250 | 246 |
| 251 void resetImageHeap(); | 247 void resetImageHeap(); |
| 252 | 248 |
| 253 protected: | 249 protected: |
| 254 void willSave() override; | 250 void willSave() override; |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 } | 1135 } |
| 1140 | 1136 |
| 1141 if (flags & kDrawVertices_HasXfermode_DrawOpFlag) { | 1137 if (flags & kDrawVertices_HasXfermode_DrawOpFlag) { |
| 1142 SkXfermode::Mode mode = SkXfermode::kModulate_Mode; | 1138 SkXfermode::Mode mode = SkXfermode::kModulate_Mode; |
| 1143 SkAssertResult(xmode->asMode(&mode)); | 1139 SkAssertResult(xmode->asMode(&mode)); |
| 1144 fWriter.write32(mode); | 1140 fWriter.write32(mode); |
| 1145 } | 1141 } |
| 1146 } | 1142 } |
| 1147 } | 1143 } |
| 1148 | 1144 |
| 1149 void SkGPipeCanvas::beginCommentGroup(const char* description) { | |
| 1150 // ignore for now | |
| 1151 } | |
| 1152 | |
| 1153 void SkGPipeCanvas::addComment(const char* kywd, const char* value) { | |
| 1154 // ignore for now | |
| 1155 } | |
| 1156 | |
| 1157 void SkGPipeCanvas::endCommentGroup() { | |
| 1158 // ignore for now | |
| 1159 } | |
| 1160 | |
| 1161 void SkGPipeCanvas::flushRecording(bool detachCurrentBlock) { | 1145 void SkGPipeCanvas::flushRecording(bool detachCurrentBlock) { |
| 1162 this->doNotify(); | 1146 this->doNotify(); |
| 1163 if (detachCurrentBlock) { | 1147 if (detachCurrentBlock) { |
| 1164 // force a new block to be requested for the next recorded command | 1148 // force a new block to be requested for the next recorded command |
| 1165 fBlockSize = 0; | 1149 fBlockSize = 0; |
| 1166 } | 1150 } |
| 1167 } | 1151 } |
| 1168 | 1152 |
| 1169 void SkGPipeCanvas::resetImageHeap() { | 1153 void SkGPipeCanvas::resetImageHeap() { |
| 1170 if (fImageHeap) { | 1154 if (fImageHeap) { |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1445 int32_t slot = this->find(img); | 1429 int32_t slot = this->find(img); |
| 1446 if (slot) { | 1430 if (slot) { |
| 1447 return slot; | 1431 return slot; |
| 1448 } | 1432 } |
| 1449 // TODO: SkImage does not expose bytes per pixel, 4 is just a best guess. | 1433 // TODO: SkImage does not expose bytes per pixel, 4 is just a best guess. |
| 1450 fBytesInCache += img->width() * img->height() * 4; | 1434 fBytesInCache += img->width() * img->height() * 4; |
| 1451 *fArray.append() = SkRef(img); | 1435 *fArray.append() = SkRef(img); |
| 1452 return fArray.count(); // slot is always index+1 | 1436 return fArray.count(); // slot is always index+1 |
| 1453 } | 1437 } |
| 1454 | 1438 |
| OLD | NEW |