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

Issue 1124223010: ui: Eliminate allocating gfx::Canvas on the heap for every view. (Closed)

Created:
5 years, 7 months ago by danakj
Modified:
5 years, 7 months ago
Reviewers:
sky
CC:
chromium-reviews, Ian Vollick, sievers+watch_chromium.org, jbauman+watch_chromium.org, kalyank, piman+watch_chromium.org, danakj+watch_chromium.org, cc-bugs_chromium.org, enne (OOO), jbroman, piman, sadrul, sky
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ui: Eliminate allocating gfx::Canvas on the heap for every view. PaintRecorder needs to present a gfx::Canvas instead of an SkCanvas. Currently it does so via CreateCanvasWithoutScaling which returns a new Canvas allocated on the heap. But mallocs are terrible, so instead make it a constructor and have the canvas allocated as part of ui::PaintRecorder on the stack. This changes the time to record a single tab loading spinner from 0.138818 ms to 0.124487 ms per frame for a 10% reduction in time. R=sky BUG=466426 Committed: https://crrev.com/8fa739b657b48f54ee96e2187158570101623f94 Cr-Commit-Position: refs/heads/master@{#329315}

Patch Set 1 #

Total comments: 1

Patch Set 2 : canvasstack: fixcompile #

Total comments: 5

Patch Set 3 : canvasstack: spaces #

Patch Set 4 : canvasstack: comment #

Patch Set 5 : canvasstack: addTODO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -46 lines) Patch
M ui/compositor/layer.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M ui/compositor/paint_recorder.h View 2 chunks +2 lines, -1 line 0 comments Download
M ui/compositor/paint_recorder.cc View 1 2 3 1 chunk +21 lines, -15 lines 0 comments Download
M ui/gfx/canvas.h View 2 chunks +3 lines, -6 lines 0 comments Download
M ui/gfx/canvas.cc View 1 2 2 chunks +4 lines, -12 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 4 chunks +4 lines, -6 lines 0 comments Download
M ui/native_theme/common_theme.cc View 1 chunk +1 line, -2 lines 0 comments Download
M ui/views/view.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 17 (5 generated)
danakj
https://codereview.chromium.org/1124223010/diff/1/ui/compositor/paint_recorder.cc File ui/compositor/paint_recorder.cc (right): https://codereview.chromium.org/1124223010/diff/1/ui/compositor/paint_recorder.cc#newcode25 ui/compositor/paint_recorder.cc:25: ? context.canvas_->sk_canvas() This is all a little bit crazy, ...
5 years, 7 months ago (2015-05-11 23:10:16 UTC) #1
sky
https://codereview.chromium.org/1124223010/diff/20001/ui/compositor/paint_recorder.cc File ui/compositor/paint_recorder.cc (right): https://codereview.chromium.org/1124223010/diff/20001/ui/compositor/paint_recorder.cc#newcode23 ui/compositor/paint_recorder.cc:23: // the recorder_ so no need to store a ...
5 years, 7 months ago (2015-05-11 23:37:34 UTC) #2
danakj
https://codereview.chromium.org/1124223010/diff/20001/ui/compositor/paint_recorder.cc File ui/compositor/paint_recorder.cc (right): https://codereview.chromium.org/1124223010/diff/20001/ui/compositor/paint_recorder.cc#newcode23 ui/compositor/paint_recorder.cc:23: // the recorder_ so no need to store a ...
5 years, 7 months ago (2015-05-11 23:42:14 UTC) #3
danakj
https://codereview.chromium.org/1124223010/diff/20001/ui/gfx/canvas.cc File ui/gfx/canvas.cc (right): https://codereview.chromium.org/1124223010/diff/20001/ui/gfx/canvas.cc#newcode24 ui/gfx/canvas.cc:24: #include "ui/gfx/canvas_skia_paint.h" Oops, included a rebase here, not part ...
5 years, 7 months ago (2015-05-11 23:42:53 UTC) #4
sky
Can you at least add a comment as to why it isn't necessary.
5 years, 7 months ago (2015-05-11 23:45:52 UTC) #5
sky
LGTM
5 years, 7 months ago (2015-05-11 23:46:04 UTC) #6
danakj
On 2015/05/11 23:45:52, sky wrote: > Can you at least add a comment as to ...
5 years, 7 months ago (2015-05-11 23:54:29 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1124223010/60001
5 years, 7 months ago (2015-05-11 23:57:34 UTC) #10
danakj
On 2015/05/11 23:42:14, danakj wrote: > We use a ScopedCanvas out in View::Paint. Though we ...
5 years, 7 months ago (2015-05-12 00:26:11 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1124223010/80001
5 years, 7 months ago (2015-05-12 00:29:10 UTC) #15
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 7 months ago (2015-05-12 02:10:21 UTC) #16
commit-bot: I haz the power
5 years, 7 months ago (2015-05-12 02:11:40 UTC) #17
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/8fa739b657b48f54ee96e2187158570101623f94
Cr-Commit-Position: refs/heads/master@{#329315}

Powered by Google App Engine
This is Rietveld 408576698