Chromium Code Reviews| Index: cc/picture.cc |
| diff --git a/cc/picture.cc b/cc/picture.cc |
| index 47d1b23d59d04e808837d423d7a9fdccaf0fd2b2..0b2cebc27b11386462a0f5c4c185731916478402 100644 |
| --- a/cc/picture.cc |
| +++ b/cc/picture.cc |
| @@ -7,6 +7,8 @@ |
| #include "cc/picture.h" |
| #include "cc/rendering_stats.h" |
| #include "third_party/skia/include/core/SkCanvas.h" |
| +#include "third_party/skia/include/core/SkData.h" |
| +#include "third_party/skia/include/utils/SkPictureUtils.h" |
| #include "ui/gfx/rect_conversions.h" |
| namespace cc { |
| @@ -88,4 +90,18 @@ void Picture::Raster(SkCanvas* canvas) { |
| canvas->restore(); |
| } |
| +std::vector<SkPixelRef*> Picture::GatherPixelRefs(const gfx::Rect& rect) { |
| + DCHECK(picture_); |
| + SkAutoDataUnref pixel_refs(SkPictureUtils::GatherPixelRefs( |
|
Alpha Left Google
2012/12/05 20:24:28
Not all pixelrefs are sklazypixelref. You might ha
qinmin
2012/12/07 05:06:28
Good catch, fixed.
On 2012/12/05 20:24:28, Alpha
|
| + picture_.get(), SkRect::MakeXYWH(rect.x(), |
| + rect.y(), |
| + rect.width(), |
| + rect.height()))); |
| + void* data = const_cast<void*>(pixel_refs->data()); |
| + SkPixelRef** refs = reinterpret_cast<SkPixelRef**>(data); |
| + std::vector<SkPixelRef*> result( |
| + refs, refs + pixel_refs->size() / sizeof(SkPixelRef*)); |
| + return result; |
| +} |
| + |
| } // namespace cc |