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

Issue 1953133002: [WIP: not for review] Reduce re-layout

Created:
4 years, 7 months ago by oshima
Modified:
4 years, 7 months ago
Reviewers:
tapted
CC:
chromium-reviews, tfarina, derat+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[WIP: not for review] Reduce re-layout Add multi-line elision support for RenderText Omnibox "answers in suggest" needs to support the new dictionary definition answer type, which requires multi-line elision support from RenderText. This CL is just the RenderText support changes. The strategy employed is to render the text into an unlimited number of lines (like the current unelided method) then to elide the last line supported (if necessary.) BUG=591803 patch from issue 1868183002 at patchset 200001 (http://crrev.com/1868183002#ps200001)

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+315 lines, -104 lines) Patch
M ui/gfx/render_text.h View 3 chunks +13 lines, -0 lines 0 comments Download
M ui/gfx/render_text.cc View 5 chunks +74 lines, -23 lines 0 comments Download
M ui/gfx/render_text_harfbuzz.cc View 1 chunk +3 lines, -5 lines 1 comment Download
M ui/gfx/render_text_unittest.cc View 1 chunk +49 lines, -0 lines 0 comments Download
M ui/views/examples/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M ui/views/examples/examples.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
M ui/views/examples/examples_window.cc View 2 chunks +3 lines, -1 line 0 comments Download
A ui/views/examples/multiline_elision_example.h View 1 chunk +33 lines, -0 lines 0 comments Download
A ui/views/examples/multiline_elision_example.cc View 1 chunk +36 lines, -0 lines 0 comments Download
M ui/views/examples/multiline_example.h View 4 chunks +30 lines, -2 lines 0 comments Download
M ui/views/examples/multiline_example.cc View 3 chunks +70 lines, -73 lines 2 comments Download

Messages

Total messages: 10 (3 generated)
oshima
tapted@, can you try this on mac and see if this is better? thanks
4 years, 7 months ago (2016-05-06 04:47:58 UTC) #4
tapted
On 2016/05/06 04:47:58, oshima wrote: > tapted@, can you try this on mac and see ...
4 years, 7 months ago (2016-05-09 08:06:29 UTC) #5
oshima
On 2016/05/09 08:06:29, tapted wrote: > On 2016/05/06 04:47:58, oshima wrote: > > tapted@, can ...
4 years, 7 months ago (2016-05-09 08:42:18 UTC) #6
tapted
Attached another trace to http://crbug.com/608990 . I'm not sure how much better it is to ...
4 years, 7 months ago (2016-05-10 08:45:53 UTC) #7
tapted
https://codereview.chromium.org/1953133002/diff/1/ui/gfx/render_text_harfbuzz.cc File ui/gfx/render_text_harfbuzz.cc (right): https://codereview.chromium.org/1953133002/diff/1/ui/gfx/render_text_harfbuzz.cc#newcode1572 ui/gfx/render_text_harfbuzz.cc:1572: GetDisplayText(), So thinking about it some more - I ...
4 years, 7 months ago (2016-05-11 00:16:26 UTC) #8
oshima
On 2016/05/11 00:16:26, tapted wrote: > https://codereview.chromium.org/1953133002/diff/1/ui/gfx/render_text_harfbuzz.cc > File ui/gfx/render_text_harfbuzz.cc (right): > > https://codereview.chromium.org/1953133002/diff/1/ui/gfx/render_text_harfbuzz.cc#newcode1572 > ...
4 years, 7 months ago (2016-05-11 15:10:47 UTC) #9
oshima
4 years, 7 months ago (2016-05-11 15:10:48 UTC) #10
On 2016/05/11 00:16:26, tapted wrote:
>
https://codereview.chromium.org/1953133002/diff/1/ui/gfx/render_text_harfbuzz.cc
> File ui/gfx/render_text_harfbuzz.cc (right):
> 
>
https://codereview.chromium.org/1953133002/diff/1/ui/gfx/render_text_harfbuzz...
> ui/gfx/render_text_harfbuzz.cc:1572: GetDisplayText(),
> So thinking about it some more - I think this is the biggest culprit.
> 
> This gets called from ApplyStyle via IsValidCursorIndex(..) (_before_ the
style
> is applied even).
> 
> There's a comment "Do not change styles mid-grapheme to avoid breaking
> ligatures", so I guess we can't just switch to using IsValidLogicalIndex in
> ApplyStyle(). But does it make sense to validate the range of the style being
> applied based on the _elided_ text?
> 
> Should there be something like IsValidLayoutIndex(..) which validates the
style
> range based on the layout_text() instead of the display_text()? This is all
> needed _before_ the style is applied so the layout_text() could immediately
> change anyway, meaning a previously valid index is now elided once the style
is
> applied.
> 
> Of course, we'd also need an updated `IndexOfAdjacentGrapheme(..)` to support
> this use-case as well.

I'll look into more detail next week. I probably should test it on mac.

Powered by Google App Engine
This is Rietveld 408576698