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

Unified Diff: cc/playback/clip_path_display_item.cc

Issue 1494223003: cc: Shrink size of display item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: danakj review Created 5 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/playback/clip_path_display_item.cc
diff --git a/cc/playback/clip_path_display_item.cc b/cc/playback/clip_path_display_item.cc
index 2168ee1f9cd8a2c1cea4c604382477ac9684a19b..3e6409a2c896e80303017323932f06abe5134104 100644
--- a/cc/playback/clip_path_display_item.cc
+++ b/cc/playback/clip_path_display_item.cc
@@ -12,7 +12,14 @@
namespace cc {
-ClipPathDisplayItem::ClipPathDisplayItem() {
+ClipPathDisplayItem::ClipPathDisplayItem(const SkPath& clip_path,
+ SkRegion::Op clip_op,
+ bool antialias) {
+ SetNew(clip_path, clip_op, antialias);
+}
+
+ClipPathDisplayItem::ClipPathDisplayItem(const proto::DisplayItem& proto) {
+ FromProtobuf(proto);
}
ClipPathDisplayItem::~ClipPathDisplayItem() {
@@ -24,11 +31,6 @@ void ClipPathDisplayItem::SetNew(const SkPath& clip_path,
clip_path_ = clip_path;
clip_op_ = clip_op;
antialias_ = antialias;
-
- // The size of SkPath's external storage is not currently accounted for (and
- // may well be shared anyway).
- DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 1 /* op_count */,
- 0 /* external_memory_usage */);
}
void ClipPathDisplayItem::ToProtobuf(proto::DisplayItem* proto) const {
@@ -79,9 +81,17 @@ void ClipPathDisplayItem::AsValueInto(
clip_path_.countPoints(), visual_rect.ToString().c_str()));
}
-EndClipPathDisplayItem::EndClipPathDisplayItem() {
- DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */,
- 0 /* external_memory_usage */);
+size_t ClipPathDisplayItem::ExternalMemoryUsage() const {
+ // The size of SkPath's external storage is not currently accounted for (and
+ // may well be shared anyway).
+ return 0;
+}
+
+EndClipPathDisplayItem::EndClipPathDisplayItem() {}
+
+EndClipPathDisplayItem::EndClipPathDisplayItem(
+ const proto::DisplayItem& proto) {
+ FromProtobuf(proto);
}
EndClipPathDisplayItem::~EndClipPathDisplayItem() {
@@ -110,4 +120,8 @@ void EndClipPathDisplayItem::AsValueInto(
visual_rect.ToString().c_str()));
}
+size_t EndClipPathDisplayItem::ExternalMemoryUsage() const {
+ return 0;
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698