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

Issue 867003002: Cache gfx::RenderText instances in views::Label. (Closed)

Created:
5 years, 11 months ago by Jun Mukai
Modified:
5 years, 9 months ago
Reviewers:
msw, oshima, sky
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, tfarina, ckocagil, Alexei Svitkine (slow), Andre
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Cache gfx::RenderText instances in views::Label. This is a rebase of crrev.com/413823002 by msw@. Cache RenderText instances, avoid Canvas::DrawString*. (avoids repeating itemization, layout, etc. on each paint) Recalculate colors and reset the layout as needed. Large cleanup; remove obsolete flag tests; update tests. Update App List's CachedLabel views::Label subclass use. (SchedulePaintInRect triggered paint with color changes) Ensure SetTitleSubpixelAA is otherwise called as needed. (skip early return; which breaks folder reorganization) This will increase the performance of painting significantly. See https://docs.google.com/document/d/1q4RrBjNO52l1pNTkIZPhQ60aPfBZnV4Af0vdQNr2Juc/edit# for the detailed analysis. BUG=240037, 125348, 450791 TEST=no appearance changes with performance improvement as: On daisy with 15 bookmarks, repainting of bookmark is decreased as 135msec -> 2.8msec R=sky@chromium.org Committed: https://crrev.com/1dfc595ffc753b6b1c99cca58e676e8b3e1bf6d8 Cr-Commit-Position: refs/heads/master@{#320138}

Patch Set 1 #

Patch Set 2 : minor polishments, recovering removed DCHECKs and comments #

Patch Set 3 : background fix #

Patch Set 4 : early exit for Set... methods #

Total comments: 2

Patch Set 5 : rebase #

Total comments: 3

Patch Set 6 : do not overuse the memory #

Total comments: 27

Patch Set 7 : rebase #

Patch Set 8 : rebase & fix bugs #

Patch Set 9 : multiple fixes #

Patch Set 10 : fix overuse of render_text_ field #

Patch Set 11 : polish #

Patch Set 12 : fix #

Patch Set 13 : fix #

Patch Set 14 : rebase #

Total comments: 1

Patch Set 15 : rebase / exclude background_is_tranparent #

Patch Set 16 : comments addressed #

Patch Set 17 : cleanup / re-upload #

Total comments: 61

Patch Set 18 : comments addressed #

Total comments: 24

Patch Set 19 : comments addressed #

Total comments: 4

Patch Set 20 : fix #

Total comments: 2

Patch Set 21 : multiline & replace newline chars #

Patch Set 22 : multi_line_ init #

Total comments: 2

Patch Set 23 : elide test #

Patch Set 24 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+478 lines, -885 lines) Patch
M ui/app_list/views/app_list_item_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -1 line 0 comments Download
M ui/app_list/views/app_list_item_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 7 chunks +6 lines, -10 lines 0 comments Download
M ui/gfx/render_text.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 4 chunks +11 lines, -2 lines 0 comments Download
M ui/gfx/render_text.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 6 chunks +13 lines, -2 lines 0 comments Download
M ui/gfx/render_text_harfbuzz.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +1 line, -0 lines 0 comments Download
M ui/gfx/render_text_harfbuzz.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +4 lines, -0 lines 0 comments Download
M ui/gfx/render_text_mac.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +1 line, -0 lines 0 comments Download
M ui/gfx/render_text_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/controls/button/label_button.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/label.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 7 chunks +49 lines, -74 lines 0 comments Download
M ui/views/controls/label.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 12 chunks +273 lines, -316 lines 0 comments Download
M ui/views/controls/label_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 5 chunks +115 lines, -479 lines 0 comments Download

Messages

Total messages: 34 (4 generated)
oshima
https://codereview.chromium.org/867003002/diff/60001/ui/views/controls/label.cc File ui/views/controls/label.cc (right): https://codereview.chromium.org/867003002/diff/60001/ui/views/controls/label.cc#newcode396 ui/views/controls/label.cc:396: UpdateColorsFromTheme(ui::NativeTheme::instance()); FYI: handles_tooltips_ is missing
5 years, 11 months ago (2015-01-23 16:58:54 UTC) #2
Jun Mukai
https://codereview.chromium.org/867003002/diff/60001/ui/views/controls/label.cc File ui/views/controls/label.cc (right): https://codereview.chromium.org/867003002/diff/60001/ui/views/controls/label.cc#newcode396 ui/views/controls/label.cc:396: UpdateColorsFromTheme(ui::NativeTheme::instance()); On 2015/01/23 16:58:54, oshima wrote: > FYI: handles_tooltips_ ...
5 years, 11 months ago (2015-01-26 23:05:47 UTC) #3
sky
This comes at the cost of making Label way more expensive in memory, right? At ...
5 years, 10 months ago (2015-01-27 16:00:10 UTC) #4
Jun Mukai
On 2015/01/27 16:00:10, sky wrote: > This comes at the cost of making Label way ...
5 years, 10 months ago (2015-01-27 17:51:10 UTC) #5
sky
I suspect it's more of weird cases that would turn up unusual results. Like I ...
5 years, 10 months ago (2015-01-27 17:52:25 UTC) #6
msw
On 2015/01/27 17:52:25, sky wrote: > I still stand by caching only while visible though. ...
5 years, 10 months ago (2015-02-02 22:31:17 UTC) #8
Jun Mukai
On 2015/02/02 22:31:17, msw wrote: > On 2015/01/27 17:52:25, sky wrote: > > I still ...
5 years, 10 months ago (2015-02-02 22:59:13 UTC) #9
msw
On 2015/02/02 22:59:13, Jun Mukai wrote: > On 2015/02/02 22:31:17, msw wrote: > > On ...
5 years, 10 months ago (2015-02-02 23:03:47 UTC) #10
sky
On Mon, Feb 2, 2015 at 2:31 PM, <msw@chromium.org> wrote: > On 2015/01/27 17:52:25, sky ...
5 years, 10 months ago (2015-02-03 00:41:40 UTC) #11
Jun Mukai
On 2015/02/03 00:41:40, sky wrote: > On Mon, Feb 2, 2015 at 2:31 PM, <mailto:msw@chromium.org> ...
5 years, 10 months ago (2015-02-05 01:40:54 UTC) #12
msw
https://codereview.chromium.org/867003002/diff/80001/ui/views/controls/label.cc File ui/views/controls/label.cc (right): https://codereview.chromium.org/867003002/diff/80001/ui/views/controls/label.cc#newcode461 ui/views/controls/label.cc:461: SkColorGetA(background_color_) != 0xFF || !subpixel_rendering_enabled_; On 2015/02/02 22:31:17, msw ...
5 years, 10 months ago (2015-02-05 20:16:42 UTC) #13
Jun Mukai
Still working in progress, but I've made several changes so I want to upload the ...
5 years, 10 months ago (2015-02-12 21:43:05 UTC) #14
msw
Split subpixel changes off to a separate CL to land first. https://codereview.chromium.org/867003002/diff/100001/ui/views/controls/label.cc File ui/views/controls/label.cc (right): ...
5 years, 10 months ago (2015-02-17 22:16:45 UTC) #15
Jun Mukai
PTAL https://codereview.chromium.org/867003002/diff/100001/ui/views/controls/label.cc File ui/views/controls/label.cc (right): https://codereview.chromium.org/867003002/diff/100001/ui/views/controls/label.cc#newcode214 ui/views/controls/label.cc:214: return render_text_ ? render_text_->layout_text() : render_data_->text; On 2015/02/05 ...
5 years, 10 months ago (2015-02-19 22:01:17 UTC) #16
msw
https://codereview.chromium.org/867003002/diff/320001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/867003002/diff/320001/ui/gfx/render_text.cc#newcode1099 ui/gfx/render_text.cc:1099: #if defined(OS_WIN) Change the #ifs in this function to ...
5 years, 10 months ago (2015-02-20 01:55:55 UTC) #17
Jun Mukai
PTAL https://codereview.chromium.org/867003002/diff/320001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/867003002/diff/320001/ui/gfx/render_text.cc#newcode1099 ui/gfx/render_text.cc:1099: #if defined(OS_WIN) On 2015/02/20 01:55:53, msw wrote: > ...
5 years, 10 months ago (2015-02-25 21:15:42 UTC) #18
msw
https://codereview.chromium.org/867003002/diff/320001/ui/views/controls/label.cc File ui/views/controls/label.cc (right): https://codereview.chromium.org/867003002/diff/320001/ui/views/controls/label.cc#newcode101 ui/views/controls/label.cc:101: void Label::SetSubpixelRenderingEnabled(bool subpixel_rendering_enabled) { On 2015/02/25 21:15:41, Jun Mukai ...
5 years, 10 months ago (2015-02-25 23:54:27 UTC) #19
Jun Mukai
https://codereview.chromium.org/867003002/diff/320001/ui/views/controls/label.cc File ui/views/controls/label.cc (right): https://codereview.chromium.org/867003002/diff/320001/ui/views/controls/label.cc#newcode101 ui/views/controls/label.cc:101: void Label::SetSubpixelRenderingEnabled(bool subpixel_rendering_enabled) { On 2015/02/25 23:54:26, msw wrote: ...
5 years, 10 months ago (2015-02-26 01:40:25 UTC) #20
msw
Great catch on render_text_ not being elided, I forgot about that! I think this is ...
5 years, 10 months ago (2015-02-26 04:23:58 UTC) #21
Jun Mukai
https://codereview.chromium.org/867003002/diff/360001/ui/views/controls/label.cc File ui/views/controls/label.cc (right): https://codereview.chromium.org/867003002/diff/360001/ui/views/controls/label.cc#newcode251 ui/views/controls/label.cc:251: // SetDisplayRect() has a side effect for further call ...
5 years, 9 months ago (2015-02-26 17:56:42 UTC) #22
Jun Mukai
Sky, please review this again.
5 years, 9 months ago (2015-02-26 17:56:56 UTC) #23
tapted
drive-by (just a note). also +Andre CC, since he's been poking RenderTextMac/Harfbuzz+mac. And thanks for ...
5 years, 9 months ago (2015-02-27 01:21:00 UTC) #24
Jun Mukai
https://codereview.chromium.org/867003002/diff/380001/ui/views/controls/label_unittest.cc File ui/views/controls/label_unittest.cc (right): https://codereview.chromium.org/867003002/diff/380001/ui/views/controls/label_unittest.cc#newcode495 ui/views/controls/label_unittest.cc:495: #if !defined(OS_MACOSX) On 2015/02/27 01:21:00, tapted wrote: > Note ...
5 years, 9 months ago (2015-02-27 02:06:48 UTC) #25
Jun Mukai
sky, please take another look.
5 years, 9 months ago (2015-02-27 21:02:07 UTC) #26
tapted
On 2015/02/27 02:06:48, Jun Mukai wrote: > Then, for now, I think it's better to ...
5 years, 9 months ago (2015-03-02 03:13:30 UTC) #27
Jun Mukai
The problem tapted@ pointed out was gone by another CL. Please take a look.
5 years, 9 months ago (2015-03-10 16:43:30 UTC) #28
sky
LGTM
5 years, 9 months ago (2015-03-11 17:18:57 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/867003002/460001
5 years, 9 months ago (2015-03-11 17:23:20 UTC) #32
commit-bot: I haz the power
Committed patchset #24 (id:460001)
5 years, 9 months ago (2015-03-11 20:30:20 UTC) #33
commit-bot: I haz the power
5 years, 9 months ago (2015-03-11 20:31:36 UTC) #34
Message was sent while issue was closed.
Patchset 24 (id:??) landed as
https://crrev.com/1dfc595ffc753b6b1c99cca58e676e8b3e1bf6d8
Cr-Commit-Position: refs/heads/master@{#320138}

Powered by Google App Engine
This is Rietveld 408576698