Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1426)

Unified Diff: cc/picture.cc

Issue 11453014: Implement the logic to kick off image decoding jobs for TileManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698