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

Unified Diff: cc/playback/clip_display_item.h

Issue 1494223003: cc: Shrink size of display item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make SetNew private 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_display_item.h
diff --git a/cc/playback/clip_display_item.h b/cc/playback/clip_display_item.h
index c66e4675750cbb1157b8b5cde00468335f3801e0..40e47628add5d0b254c0be4ed185afd0294d80f2 100644
--- a/cc/playback/clip_display_item.h
+++ b/cc/playback/clip_display_item.h
@@ -19,12 +19,11 @@ namespace cc {
class CC_EXPORT ClipDisplayItem : public DisplayItem {
public:
- ClipDisplayItem();
+ ClipDisplayItem(gfx::Rect clip_rect,
+ const std::vector<SkRRect>& rounded_clip_rects);
+ explicit ClipDisplayItem(const proto::DisplayItem& proto);
~ClipDisplayItem() override;
- void SetNew(gfx::Rect clip_rect,
- const std::vector<SkRRect>& rounded_clip_rects);
-
void ToProtobuf(proto::DisplayItem* proto) const override;
void FromProtobuf(const proto::DisplayItem& proto) override;
danakj 2015/12/08 19:18:14 should these From methods be private then?
enne (OOO) 2015/12/08 19:47:27 ToProtoBuf should be public. FromProtoBuf is now p
void Raster(SkCanvas* canvas,
@@ -32,8 +31,15 @@ class CC_EXPORT ClipDisplayItem : public DisplayItem {
SkPicture::AbortCallback* callback) const override;
void AsValueInto(const gfx::Rect& visual_rect,
base::trace_event::TracedValue* array) const override;
+ size_t ExternalMemoryUsage() const override;
+
+ int ApproximateOpCount() const { return 1; }
+ bool IsSuitableForGpuRasterization() const { return true; }
private:
+ void SetNew(gfx::Rect clip_rect,
+ const std::vector<SkRRect>& rounded_clip_rects);
+
gfx::Rect clip_rect_;
std::vector<SkRRect> rounded_clip_rects_;
};
@@ -41,6 +47,7 @@ class CC_EXPORT ClipDisplayItem : public DisplayItem {
class CC_EXPORT EndClipDisplayItem : public DisplayItem {
public:
EndClipDisplayItem();
+ explicit EndClipDisplayItem(const proto::DisplayItem& proto);
~EndClipDisplayItem() override;
void ToProtobuf(proto::DisplayItem* proto) const override;
@@ -50,6 +57,10 @@ class CC_EXPORT EndClipDisplayItem : public DisplayItem {
SkPicture::AbortCallback* callback) const override;
void AsValueInto(const gfx::Rect& visual_rect,
base::trace_event::TracedValue* array) const override;
+ size_t ExternalMemoryUsage() const override;
+
+ int ApproximateOpCount() const { return 0; }
+ bool IsSuitableForGpuRasterization() const { return true; }
};
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698