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

Issue 472333003: Directly compute glyphToUnicode array in DirectWrite. (Closed)

Created:
6 years, 4 months ago by bungeman-skia
Modified:
6 years, 4 months ago
Reviewers:
hal.canary, Nico, mtklein
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Directly compute glyphToUnicode array in DirectWrite. This new code is still rather bad, but has fewer steps. The motivation for looking at this is that on Windows 8 the previous code was occasionally asserting in such a way as to imply that GetGlyphIndices might return different data the second time through the font. This avoids that particular issue by only going through the font once. Committed: https://skia.googlesource.com/skia/+/df2ec358be78820550f334bc7224ae18e3d25390

Patch Set 1 #

Patch Set 2 : Remove tabs. #

Total comments: 6

Patch Set 3 : Do less work. #

Total comments: 4

Patch Set 4 : Put boots on the fenceposts. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -37 lines) Patch
M src/ports/SkTypeface_win_dw.cpp View 1 2 3 4 chunks +14 lines, -37 lines 2 comments Download

Messages

Total messages: 11 (0 generated)
bungeman-skia
I'm not sure we have any good tests to make sure a change like this ...
6 years, 4 months ago (2014-08-18 19:25:30 UTC) #1
mtklein
https://codereview.chromium.org/472333003/diff/20001/src/ports/SkTypeface_win_dw.cpp File src/ports/SkTypeface_win_dw.cpp (right): https://codereview.chromium.org/472333003/diff/20001/src/ports/SkTypeface_win_dw.cpp#newcode9 src/ports/SkTypeface_win_dw.cpp:9: #undef GetGlyphIndices On 2014/08/18 19:25:30, bungeman1 wrote: > This ...
6 years, 4 months ago (2014-08-18 21:21:50 UTC) #2
bungeman-skia
https://codereview.chromium.org/472333003/diff/20001/src/ports/SkTypeface_win_dw.cpp File src/ports/SkTypeface_win_dw.cpp (right): https://codereview.chromium.org/472333003/diff/20001/src/ports/SkTypeface_win_dw.cpp#newcode9 src/ports/SkTypeface_win_dw.cpp:9: #undef GetGlyphIndices On 2014/08/18 21:21:50, mtklein wrote: > On ...
6 years, 4 months ago (2014-08-20 17:25:24 UTC) #3
mtklein
https://codereview.chromium.org/472333003/diff/40001/src/ports/SkTypeface_win_dw.cpp File src/ports/SkTypeface_win_dw.cpp (right): https://codereview.chromium.org/472333003/diff/40001/src/ports/SkTypeface_win_dw.cpp#newcode307 src/ports/SkTypeface_win_dw.cpp:307: glyphToUnicode->swap(SkTDArray<SkUnichar>(glyphToUni, maxGlyph)); It's the same to do glyphToUnicode->rewind(); glyphToUnicode->append(maxGlyph, ...
6 years, 4 months ago (2014-08-20 18:15:02 UTC) #4
bungeman-skia
https://codereview.chromium.org/472333003/diff/40001/src/ports/SkTypeface_win_dw.cpp File src/ports/SkTypeface_win_dw.cpp (right): https://codereview.chromium.org/472333003/diff/40001/src/ports/SkTypeface_win_dw.cpp#newcode307 src/ports/SkTypeface_win_dw.cpp:307: glyphToUnicode->swap(SkTDArray<SkUnichar>(glyphToUni, maxGlyph)); On 2014/08/20 18:15:01, mtklein wrote: > It's ...
6 years, 4 months ago (2014-08-20 19:14:03 UTC) #5
mtklein
lgtm
6 years, 4 months ago (2014-08-20 19:14:43 UTC) #6
bungeman-skia
The CQ bit was checked by bungeman@google.com
6 years, 4 months ago (2014-08-20 19:15:06 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/bungeman@google.com/472333003/60001
6 years, 4 months ago (2014-08-20 19:15:35 UTC) #8
commit-bot: I haz the power
Committed patchset #4 (60001) as df2ec358be78820550f334bc7224ae18e3d25390
6 years, 4 months ago (2014-08-20 19:21:39 UTC) #9
Nico
(I don't have a windows box at hand, else I'd send you a patch instead) ...
6 years, 4 months ago (2014-08-25 03:18:59 UTC) #10
bungeman-skia
6 years, 4 months ago (2014-08-25 14:01:50 UTC) #11
Message was sent while issue was closed.
See also Issue 487533004 and http://skbug.com/2679 .

https://codereview.chromium.org/472333003/diff/60001/src/ports/SkTypeface_win...
File src/ports/SkTypeface_win_dw.cpp (right):

https://codereview.chromium.org/472333003/diff/60001/src/ports/SkTypeface_win...
src/ports/SkTypeface_win_dw.cpp:307:
glyphToUnicode->swap(SkTDArray<SkUnichar>(glyphToUni, maxGlyph + 1));
On 2014/08/25 03:18:59, Nico (afk vacation til Aug 24) wrote:
> Our clang/win fyi bot doesn't like this:
> 
> ..\..\third_party\skia\src\ports\SkTypeface_win_dw.cpp(307,26) : 
error(clang):
> non-const lvalue reference to type 'SkTDArray<[...]>' cannot bind to a
temporary
> of type 'SkTDArray<[...]>'
>     glyphToUnicode->swap(SkTDArray<SkUnichar>(glyphToUni, maxGlyph + 1));
>                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ..\..\third_party\skia\include\core\SkTDArray.h(76,29) :  note(clang): passing
> argument to parameter 'other' here
>     void swap(SkTDArray<T>& other) {
>                             ^
> 1 error generated.
> 
> I think the usual way to empty vectors is to write
> 
>     SkTDArray<SkUnichar>(glyphToUni, maxGlyph + 1).swap(*glyphToUnicode);
> 
> instead –&nbsp;could that work here?

Hmmmm, yes, C++ specifically forbids all of this temporaries binding to
non-const references silliness, but vc++ doesn't seem to even give a warning
about it. I shall take your suggestion to to flip it around and see if that
makes clang happier.

Powered by Google App Engine
This is Rietveld 408576698