ui: Cache the output of View::OnPaint when the View isn't invalid.
commit93f5730af51af283713ad19dd5e08c3b3ea34eaa
authordanakj <danakj@chromium.org>
Sat, 25 Apr 2015 17:53:17 +0000 (25 10:53 -0700)
committerCommit bot <commit-bot@chromium.org>
Sat, 25 Apr 2015 17:53:12 +0000 (25 17:53 +0000)
tree38e1eb1974410d8503476bb9d0d25218f3ec17c9
parentba5b67e27dc64c3c6793be8f9c991066c956c33f
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}
12 files changed:
cc/resources/drawing_display_item.cc
cc/resources/drawing_display_item.h
ui/compositor/BUILD.gn
ui/compositor/compositor.gyp
ui/compositor/layer.cc
ui/compositor/paint_cache.cc [new file with mode: 0644]
ui/compositor/paint_cache.h [new file with mode: 0644]
ui/compositor/paint_context.h
ui/compositor/paint_recorder.cc
ui/compositor/paint_recorder.h
ui/views/view.cc
ui/views/view.h