| 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 "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkData.h" | 10 #include "SkData.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 return NULL; | 207 return NULL; |
| 208 } | 208 } |
| 209 | 209 |
| 210 SkTDArray<SkPixelRef*> array; | 210 SkTDArray<SkPixelRef*> array; |
| 211 PixelRefSet prset(&array); | 211 PixelRefSet prset(&array); |
| 212 | 212 |
| 213 GatherPixelRefDevice device(pict->width(), pict->height(), &prset); | 213 GatherPixelRefDevice device(pict->width(), pict->height(), &prset); |
| 214 SkNoSaveLayerCanvas canvas(&device); | 214 SkNoSaveLayerCanvas canvas(&device); |
| 215 | 215 |
| 216 canvas.clipRect(area, SkRegion::kIntersect_Op, false); | 216 canvas.clipRect(area, SkRegion::kIntersect_Op, false); |
| 217 canvas.drawPicture(*pict); | 217 canvas.drawPicture(pict); |
| 218 | 218 |
| 219 SkData* data = NULL; | 219 SkData* data = NULL; |
| 220 int count = array.count(); | 220 int count = array.count(); |
| 221 if (count > 0) { | 221 if (count > 0) { |
| 222 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*)
); | 222 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*)
); |
| 223 } | 223 } |
| 224 return data; | 224 return data; |
| 225 } | 225 } |
| OLD | NEW |