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

Issue 1248453004: Change Font::offsetForPositionForComplexText to use CachingWordShapeIterator (Closed)

Created:
5 years, 5 months ago by kojii
Modified:
5 years, 4 months ago
Reviewers:
eae, brucedawson
CC:
blink-reviews, Rik, danakj, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), jbroman, Justin Novosad, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Change Font::offsetForPositionForComplexText to use CachingWordShapeIterator In the discussion at a CL for the tab characters support in complex path[1], it was desired that HarfBuzzShaper being a lower layer of CachingWordShapeIterator, and higher layers should not use HarfBuzzShaper directly. It gives us flexibility to move code between these two classes. This patch changes Font::offsetForPositionForComplexText to switch from HarfBuzzShaper to CachingWordShapeIterator. This method is currently the only direct user of HarfBuzzShaper. A basic test that tests all integer positions using Ahem is added, and confirmed no behavior changes from the current complex path code, but this code path has several dependencies (fonts, shaping, graphics layers etc.) that this patch needs to rebaseline 7 tests (7 Mac, 2 Linux, 0 Windows.) Among the 7 tests: * 4 are editing to move carets in block directions: - 2 out of 4 have rooms to improve, but very rare (only Mac & vertical & RTL) - 2 look reasonable changes (also only Mac & vertical & RTL) * 3 are ellipsis for RTL, neither before and after look stable. [1] https://codereview.chromium.org/1242213002/ BUG=422670 TEST=editing/selection/offset-from-point.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200233

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : RTL support #

Patch Set 4 : Move logic to HarfBuzzShaper #

Patch Set 5 : #

Patch Set 6 : Add test #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : Avoid flaky tests in vertical flow #

Patch Set 10 : TestExpectations and rebase #

Total comments: 2

Patch Set 11 : Rebase #

Patch Set 12 : eae's review #

Patch Set 13 : Rebase (resolved conflicts) #

Patch Set 14 : Rebase #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+235 lines, -6 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +9 lines, -0 lines 0 comments Download
A LayoutTests/editing/selection/offset-from-point.html View 1 2 3 4 5 6 7 8 1 chunk +71 lines, -0 lines 0 comments Download
A LayoutTests/editing/selection/offset-from-point-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +108 lines, -0 lines 0 comments Download
M Source/platform/fonts/Font.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -5 lines 0 comments Download
M Source/platform/fonts/shaping/CachingWordShaper.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M Source/platform/fonts/shaping/CachingWordShaper.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +8 lines, -0 lines 0 comments Download
M Source/platform/fonts/shaping/HarfBuzzShaper.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -1 line 0 comments Download
M Source/platform/fonts/shaping/HarfBuzzShaper.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +33 lines, -0 lines 1 comment Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 12 (4 generated)
kojii
PTAL.
5 years, 5 months ago (2015-07-22 17:27:58 UTC) #2
eae
Nice, I like the implementation but would like to have a clear one way relationship ...
5 years, 5 months ago (2015-07-22 18:33:22 UTC) #3
kojii
PTAL. https://codereview.chromium.org/1248453004/diff/180001/Source/platform/fonts/shaping/HarfBuzzShaper.h File Source/platform/fonts/shaping/HarfBuzzShaper.h (right): https://codereview.chromium.org/1248453004/diff/180001/Source/platform/fonts/shaping/HarfBuzzShaper.h#newcode71 Source/platform/fonts/shaping/HarfBuzzShaper.h:71: static int offsetForPosition(CachingWordShapeIterator&, On 2015/07/22 at 18:33:22, eae ...
5 years, 5 months ago (2015-07-23 05:06:12 UTC) #4
kojii
PTAL. This CL is likely to conflict with fallback fix: https://codereview.chromium.org/1244973003 but resolving conflicts should ...
5 years, 4 months ago (2015-07-31 04:13:03 UTC) #5
eae
LGTM This is great, thank you!
5 years, 4 months ago (2015-08-03 20:44:52 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1248453004/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1248453004/260001
5 years, 4 months ago (2015-08-10 03:45:31 UTC) #9
commit-bot: I haz the power
Committed patchset #14 (id:260001) as https://src.chromium.org/viewvc/blink?view=rev&revision=200233
5 years, 4 months ago (2015-08-10 03:49:36 UTC) #10
brucedawson
5 years, 4 months ago (2015-08-11 19:01:06 UTC) #12
Message was sent while issue was closed.
/analyze pointed out some odd code. Harmless, but worth cleaning up I think.

https://codereview.chromium.org/1248453004/diff/260001/Source/platform/fonts/...
File Source/platform/fonts/shaping/HarfBuzzShaper.cpp (right):

https://codereview.chromium.org/1248453004/diff/260001/Source/platform/fonts/...
Source/platform/fonts/shaping/HarfBuzzShaper.cpp:452: RefPtr<ShapeResult>
wordResult;
This variable is never used and should be deleted.

This was detected, perversely enough, through a variable shadowing warning from
the two declarations of 'wordResult' in inner scopes.

Powered by Google App Engine
This is Rietveld 408576698