| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 196 } |
| 197 | 197 |
| 198 SkTDArray<SkPixelRef*> array; | 198 SkTDArray<SkPixelRef*> array; |
| 199 PixelRefSet prset(&array); | 199 PixelRefSet prset(&array); |
| 200 | 200 |
| 201 GatherPixelRefDevice device(SkScalarCeilToInt(pict->cullRect().width()), | 201 GatherPixelRefDevice device(SkScalarCeilToInt(pict->cullRect().width()), |
| 202 SkScalarCeilToInt(pict->cullRect().height()), | 202 SkScalarCeilToInt(pict->cullRect().height()), |
| 203 &prset); | 203 &prset); |
| 204 SkNoSaveLayerCanvas canvas(&device); | 204 SkNoSaveLayerCanvas canvas(&device); |
| 205 | 205 |
| 206 canvas.clipRect(area, SkRegion::kIntersect_Op, false); | 206 canvas.clipRect(area); |
| 207 canvas.drawPicture(pict); | 207 canvas.drawPicture(pict); |
| 208 | 208 |
| 209 SkData* data = NULL; | 209 SkData* data = NULL; |
| 210 int count = array.count(); | 210 int count = array.count(); |
| 211 if (count > 0) { | 211 if (count > 0) { |
| 212 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*)
); | 212 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*)
); |
| 213 } | 213 } |
| 214 return data; | 214 return data; |
| 215 } | 215 } |
| 216 | 216 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 228 if (pict->fBBH.get()) { | 228 if (pict->fBBH.get()) { |
| 229 byteCount += pict->fBBH->bytesUsed(); | 229 byteCount += pict->fBBH->bytesUsed(); |
| 230 } | 230 } |
| 231 MeasureRecords visitor; | 231 MeasureRecords visitor; |
| 232 for (unsigned curOp = 0; curOp < pict->fRecord->count(); curOp++) { | 232 for (unsigned curOp = 0; curOp < pict->fRecord->count(); curOp++) { |
| 233 byteCount += pict->fRecord->visit<size_t>(curOp, visitor); | 233 byteCount += pict->fRecord->visit<size_t>(curOp, visitor); |
| 234 } | 234 } |
| 235 | 235 |
| 236 return byteCount; | 236 return byteCount; |
| 237 } | 237 } |
| OLD | NEW |