diff options
author | danakj <danakj@chromium.org> | 2015-04-25 10:53:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-25 17:53:12 +0000 |
commit | 93f5730af51af283713ad19dd5e08c3b3ea34eaa (patch) | |
tree | 38e1eb1974410d8503476bb9d0d25218f3ec17c9 /cc/resources | |
parent | ba5b67e27dc64c3c6793be8f9c991066c956c33f (diff) | |
download | chromium_src-93f5730af51af283713ad19dd5e08c3b3ea34eaa.zip chromium_src-93f5730af51af283713ad19dd5e08c3b3ea34eaa.tar.gz chromium_src-93f5730af51af283713ad19dd5e08c3b3ea34eaa.tar.bz2 |
ui: Cache the output of View::OnPaint when the View isn't invalid.
Store the output of View::OnPaint as a PaintCache object, and when the
view has not been invalidated, use that cache output instead of doing
work to build a recording.
Performance data as follows when the loading spinner is going:
Before impl-side (TOT): 0.13ms / paint
With impl-side (no slimming paint): 0.22ms / paint
With impl-side and slimming paint (this patch): 0.17ms / paint
So this gets us some of the way there. I need to investigate why it's
not doing more.
R=piman@chromium.org, sky
BUG=466426
Committed: https://crrev.com/7f686cdcff81d6779b962e98e529a7360be2809c
Cr-Commit-Position: refs/heads/master@{#326592}
Review URL: https://codereview.chromium.org/1101783002
Cr-Commit-Position: refs/heads/master@{#326976}
Diffstat (limited to 'cc/resources')
-rw-r--r-- | cc/resources/drawing_display_item.cc | 4 | ||||
-rw-r--r-- | cc/resources/drawing_display_item.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/cc/resources/drawing_display_item.cc b/cc/resources/drawing_display_item.cc index 91ab3fb..a37729f 100644 --- a/cc/resources/drawing_display_item.cc +++ b/cc/resources/drawing_display_item.cc @@ -62,4 +62,8 @@ void DrawingDisplayItem::AsValueInto( array->EndDictionary(); } +scoped_ptr<DrawingDisplayItem> DrawingDisplayItem::Clone() { + return Create(picture_); +} + } // namespace cc diff --git a/cc/resources/drawing_display_item.h b/cc/resources/drawing_display_item.h index a3eef77..da302d8 100644 --- a/cc/resources/drawing_display_item.h +++ b/cc/resources/drawing_display_item.h @@ -33,6 +33,8 @@ class CC_EXPORT DrawingDisplayItem : public DisplayItem { size_t PictureMemoryUsage() const override; void AsValueInto(base::trace_event::TracedValue* array) const override; + scoped_ptr<DrawingDisplayItem> Clone(); + protected: explicit DrawingDisplayItem(skia::RefPtr<SkPicture> picture); |