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

Unified Diff: cc/playback/display_item_list.h

Issue 1407793002: Add protobuf serialization to DisplayItemList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blimp_display2
Patch Set: Remove unused header. Added a few more comments to the unit test Created 5 years, 2 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
Index: cc/playback/display_item_list.h
diff --git a/cc/playback/display_item_list.h b/cc/playback/display_item_list.h
index 12ad23cdad58e25d32d487861aee8f666b153c25..970b73f6146c951c615d3eda2807622dec855606 100644
--- a/cc/playback/display_item_list.h
+++ b/cc/playback/display_item_list.h
@@ -13,6 +13,7 @@
#include "cc/base/list_container.h"
#include "cc/playback/discardable_image_map.h"
#include "cc/playback/display_item.h"
+#include "cc/playback/display_item_list_settings.h"
#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "ui/gfx/geometry/rect.h"
@@ -22,7 +23,9 @@ class SkPictureRecorder;
namespace cc {
-class DisplayItemListSettings;
+namespace proto {
+class DisplayItemList;
+}
class CC_EXPORT DisplayItemList
: public base::RefCountedThreadSafe<DisplayItemList> {
@@ -36,6 +39,15 @@ class CC_EXPORT DisplayItemList
const gfx::Rect& layer_rect,
const DisplayItemListSettings& settings);
+ // Creates a DisplayItemList from a Protobuf.
+ // TODO(dtrainor): Pass in a list of possible DisplayItems to reuse.
+ static scoped_refptr<DisplayItemList> Create(
+ const proto::DisplayItemList& proto);
+
+ // Creates a Protobuf representing the state of this DisplayItemList.
+ // TODO(dtrainor): Don't resend DisplayItems that were already serialized.
+ void ToProtobuf(proto::DisplayItemList* proto);
+
void Raster(SkCanvas* canvas,
SkPicture::AbortCallback* callback,
const gfx::Rect& canvas_target_playback_rect,
@@ -102,7 +114,7 @@ class CC_EXPORT DisplayItemList
scoped_ptr<SkPictureRecorder> recorder_;
skia::RefPtr<SkCanvas> canvas_;
- const bool use_cached_picture_;
+ const DisplayItemListSettings settings_;
bool retain_individual_display_items_;
gfx::Rect layer_rect_;

Powered by Google App Engine
This is Rietveld 408576698