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

Unified Diff: cc/resources/picture_pile_base.cc

Issue 14772032: Trace picture piles on layers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months 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
« cc/debug/traced_picture.cc ('K') | « cc/resources/picture_pile_base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile_base.cc
diff --git a/cc/resources/picture_pile_base.cc b/cc/resources/picture_pile_base.cc
index 897ed2cbe7a4ea6b4dd62fb5f22b4978538f0221..0d3a72504e2d60644dbe9df88e9bbdb46a25a29b 100644
--- a/cc/resources/picture_pile_base.cc
+++ b/cc/resources/picture_pile_base.cc
@@ -8,6 +8,9 @@
#include <vector>
#include "base/logging.h"
+#include "base/values.h"
+#include "cc/base/math_util.h"
+#include "cc/debug/traced_value.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/rect_conversions.h"
@@ -173,4 +176,25 @@ bool PicturePileBase::CanRaster(float contents_scale, gfx::Rect content_rect) {
return recorded_region_.Contains(layer_rect);
}
+scoped_ptr<base::Value> PicturePileBase::AsValue() const {
+ scoped_ptr<base::ListValue> rects(new base::ListValue());
enne (OOO) 2013/05/14 15:55:18 rects => pictures?
+ gfx::Rect layer_rect(tiling_.total_size()); /* enne, insane or not? */
enne (OOO) 2013/05/14 15:55:18 This is right. You could also simplify this a lit
+ for (TilingData::Iterator tile_iter(&tiling_, layer_rect);
+ tile_iter; ++tile_iter) {
+ PictureListMap::const_iterator map_iter =
+ picture_list_map_.find(tile_iter.index());
+ if (map_iter == picture_list_map_.end())
+ continue;
+ const PictureList& pic_list= map_iter->second;
+ if (pic_list.empty())
+ continue;
+ for (PictureList::const_reverse_iterator i = pic_list.rbegin();
+ i != pic_list.rend(); ++i) {
+ Picture* picture = (*i).get();
+ rects->Append(TracedValue::CreateIDRef(picture).release());
+ }
+ }
+ return rects.PassAs<base::Value>();
+}
+
} // namespace cc
« cc/debug/traced_picture.cc ('K') | « cc/resources/picture_pile_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698