| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkBBoxHierarchy.h" | 8 #include "SkBBoxHierarchy.h" |
| 9 #include "SkBitmapDevice.h" | 9 #include "SkBitmapDevice.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 225 } |
| 226 }; | 226 }; |
| 227 | 227 |
| 228 size_t SkPictureUtils::ApproximateBytesUsed(const SkPicture* pict) { | 228 size_t SkPictureUtils::ApproximateBytesUsed(const SkPicture* pict) { |
| 229 size_t byteCount = sizeof(*pict); | 229 size_t byteCount = sizeof(*pict); |
| 230 | 230 |
| 231 byteCount += pict->fRecord->bytesUsed(); | 231 byteCount += pict->fRecord->bytesUsed(); |
| 232 if (pict->fBBH.get()) { | 232 if (pict->fBBH.get()) { |
| 233 byteCount += pict->fBBH->bytesUsed(); | 233 byteCount += pict->fBBH->bytesUsed(); |
| 234 } | 234 } |
| 235 byteCount += | |
| 236 pict->fDeletionListeners.reserved() * sizeof(SkPicture::DeletionListener
*) + | |
| 237 pict->fDeletionListeners.count() * sizeof(SkPicture::DeletionListener); | |
| 238 | |
| 239 MeasureRecords visitor; | 235 MeasureRecords visitor; |
| 240 for (unsigned curOp = 0; curOp < pict->fRecord->count(); curOp++) { | 236 for (unsigned curOp = 0; curOp < pict->fRecord->count(); curOp++) { |
| 241 byteCount += pict->fRecord->visit<size_t>(curOp, visitor); | 237 byteCount += pict->fRecord->visit<size_t>(curOp, visitor); |
| 242 } | 238 } |
| 243 | 239 |
| 244 return byteCount; | 240 return byteCount; |
| 245 } | 241 } |
| OLD | NEW |