Commit Graph

325 Commits

Author SHA1 Message Date
Tyler Denniston
283dba5785 Revert "Add format-specifier warnings to SkDebugf."
This reverts commit e58831cd95.

Reason for revert: looks like breaking a few build bots

Original change's description:
> Add format-specifier warnings to SkDebugf.
>
> This CL fixes up many existing format-specifier violations in Skia.
> Note that GCC has a warning for formatting nothing, so existing calls to
> `SkDebugf("")` have been removed, or replaced with `SkDebugf("%s", "")`.
> These were apparently meant to be used as a place to set a breakpoint.
>
> Some of our clients also use SkDebug with bad format specifiers, so this
> check is currently only enabled when SKIA_IMPLEMENTATION is true.
>
> Change-Id: I8177a1298a624c6936adc24e0d8f481362a356d0
> Bug: skia:12143
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420902
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: I07848c1bf8992925c9498e916744d0840355a077
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:12143
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421917
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-06-25 13:33:10 +00:00
John Stiles
e58831cd95 Add format-specifier warnings to SkDebugf.
This CL fixes up many existing format-specifier violations in Skia.
Note that GCC has a warning for formatting nothing, so existing calls to
`SkDebugf("")` have been removed, or replaced with `SkDebugf("%s", "")`.
These were apparently meant to be used as a place to set a breakpoint.

Some of our clients also use SkDebug with bad format specifiers, so this
check is currently only enabled when SKIA_IMPLEMENTATION is true.

Change-Id: I8177a1298a624c6936adc24e0d8f481362a356d0
Bug: skia:12143
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420902
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-25 11:05:59 +00:00
Brian Osman
759802fdd1 Reland "Fix more new Clang warnings"
This is a reland of 3d5483a547

Original change's description:
> Fix more new Clang warnings
>
> Change-Id: I82a13744669a6b5c23e23e6a719ec79878114dab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418697
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>

Change-Id: I6a81630c09d7aed906196b28adced0bf0a88e18d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418938
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-06-16 17:40:07 +00:00
Brian Osman
6448ec390d Revert "Fix more new Clang warnings"
This reverts commit 3d5483a547.

Reason for revert: Android roll.

Original change's description:
> Fix more new Clang warnings
>
> Change-Id: I82a13744669a6b5c23e23e6a719ec79878114dab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418697
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>

TBR=kjlubick@google.com,brianosman@google.com

Change-Id: I2032ee5efdb297b7cfdbe60ff2546305ef96ea57
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418937
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-06-16 14:03:58 +00:00
Brian Osman
3d5483a547 Fix more new Clang warnings
Change-Id: I82a13744669a6b5c23e23e6a719ec79878114dab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418697
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-06-15 18:32:48 +00:00
Julia Lavrova
658d96662b Fixing the worst case when text cannot be resolved at all
(hanging on Mac)
Bug: skia:11996

Change-Id: I4dcd8175d0d4440a7c7ef73be26508018ad86c46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412661
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-05-27 17:43:57 +00:00
Mike Reed
81e2f9355b Expose intercepts on SkFont
Already exposed (on TextBlob), so this makes it available for clients
that may use drawGlyphs directly. (including canvaskit/flutter)

Change-Id: I8b4bd51e13827dc3970d5a6d06f0e0d3031af13c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408638
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-05-14 14:50:42 +00:00
Brian Osman
a5842bc903 Move SkSpan to include/, for use in public API
Change-Id: I674f038600afd6d49316c1ece515941ee5579068
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406939
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-05-12 13:19:32 +00:00
Julia Lavrova
b44d6f4099 Reland "LRU Cache requires exact float comparison"
This is a reland of 85a51865f9

Original change's description:
> LRU Cache requires exact float comparison
>
> Bug: oss-fuzz:30314
> Change-Id: Id5dccdbab2a4801e6796254a68e417dbdc0f7a4a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404780
> Commit-Queue: Julia Lavrova <jlavrova@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Bug: oss-fuzz:30314
Change-Id: I0736a068b5b952415099f56733b6748a5a93981a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405681
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-05-07 17:50:48 +00:00
Greg Daniel
bb4bf6eaaf Revert "LRU Cache requires exact float comparison"
This reverts commit 85a51865f9.

Reason for revert: possibly causing flutter roll failure

Original change's description:
> LRU Cache requires exact float comparison
>
> Bug: oss-fuzz:30314
> Change-Id: Id5dccdbab2a4801e6796254a68e417dbdc0f7a4a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404780
> Commit-Queue: Julia Lavrova <jlavrova@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

TBR=bungeman@google.com,jlavrova@google.com

Change-Id: I2cbbcf667734145b94359be4331bbf21e299d6a0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: oss-fuzz:30314
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405576
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-05-07 12:43:39 +00:00
Julia Lavrova
85a51865f9 LRU Cache requires exact float comparison
Bug: oss-fuzz:30314
Change-Id: Id5dccdbab2a4801e6796254a68e417dbdc0f7a4a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404780
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-05-06 20:25:27 +00:00
Julia Lavrova
a6bcec7dd8 Ensure TextBlobCache is populated before getShapedRuns.
Also fixing a small problem with offsets that never appeared
because we never use this code path (but could)

Bug: skia:11947
Change-Id: I8c02c696797ea45d35fcab5746fbc079326e4539
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404897
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-05-06 17:39:37 +00:00
Mike Reed
a46fe7d587 Return shapedlines for text api
Change-Id: I8f9aa6e0cffb3441706bd0efeb0886209cac012a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/403256
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-05-03 14:21:11 +00:00
Mike Reed
097263bb50 Track mouse for cursor and hilites
Change-Id: Icfc8a28fa0c9e3118ef4ddc5ae12162aab3fb484
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398556
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-04-30 20:49:40 +00:00
Julia Lavrova
b2a2e7c9e3 Empty paragraph height in case of HeightOverride
bug: skia:11920
Change-Id: I65caa14b775d49680f140b3b70e64bf03f6dfffb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402277
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-04-28 20:08:36 +00:00
Mike Reed
9eaae183ab An attempt to fix the last glyph position problem
Change-Id: I5d3eed412df024b93457a0f4e0ca0d13bc250e46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401919
Reviewed-by: Mike Reed <reed@google.com>
2021-04-28 00:48:45 +00:00
Mike Reed
ae33954b49 Updates to GlyphRuns[]
1. Fold "origin" into the positions (simplification)
2. Extend positions and offset arrays by 1, to include 1-past last glyph
3. Add flags field to run (with just WS flag for now)

Change-Id: I93e38df808a5e9e4e5bcedbc62bc5a7aa433ef2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399876
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
2021-04-28 00:42:54 +00:00
Mike Reed
b2497ddd0e Revert "Revert "onMatchFaceStyle is unused, so remove it""
This relands the idea that onMatchFaceStyle is no longer used, but
leaves the baseclass virtual to stage removing it from client
subclasses.

This reverts commit 3c04a65508.

Change-Id: I18570065249c86f7f155c28288dce3ea9d59f619
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401759
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-04-27 16:40:29 +00:00
Jason Simmons
be1c996589 Rename TextShadow.fBlurRadius to fBlurSigma
SkMaskFilter::MakeBlur expects a sigma value, but Flutter/Libtxt had
incorrectly called it a radius.
Change-Id: I9ab1ef7a92370ca4825a65ca6f06e1fe9ac55167
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401496
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2021-04-27 16:07:09 +00:00
Mike Reed
3c04a65508 Revert "onMatchFaceStyle is unused, so remove it"
This reverts commit 40f2985ec8.

Reason for revert: flutter has subclasses

Original change's description:
> onMatchFaceStyle is unused, so remove it
>
> Change-Id: I2b249d226af1c222edea6ec5f8de0b4d2542e34a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401676
> Auto-Submit: Mike Reed <reed@google.com>
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=bungeman@google.com,reed@google.com,jlavrova@google.com

Change-Id: I455b3f177570cc757442b772edbf969b9544e019
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401757
Reviewed-by: Mike Reed <reed@google.com>
2021-04-27 15:34:30 +00:00
Mike Reed
40f2985ec8 onMatchFaceStyle is unused, so remove it
Change-Id: I2b249d226af1c222edea6ec5f8de0b4d2542e34a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401676
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-04-27 14:45:12 +00:00
weiyuhuang
04c82165b1 [canvaskit] Add halfLeading to TextStyle and StrutStyle
- Add halfLeading (introduced in https://skia-review.googlesource.com/c/skia/+/394969) to canvaskit bindings

- Fix wrong initial value of fDescent

Change-Id: I01d522cd5a3761f32426038dce2ab82f24c9c529
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398276
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2021-04-20 20:21:56 +00:00
Julia Lavrova
b40c925b82 Removing the staging flag for Google3 (SK_PARAGRAPH_ROUND_POSITION)
Change-Id: I45ff82fb1e6083c90248b174b8d088d91be75825
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398216
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-04-19 19:01:54 +00:00
weiyuhuang
32f15531c4 Add halfLeading to TextStyle and StrutStyle: https://github.com/flutter/engine/pull/24668
Change-Id: I5627cb163400880992db622bb887093da92d1cd5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/394969
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-04-16 18:58:25 +00:00
Mike Reed
da34d099fc Fix gm dimensions
Change-Id: I5fdbd290e1b5e58d382fbd3c438d2abaacb07400
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397317
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-04-16 17:09:59 +00:00
Mike Reed
b4e08be30c Expose experimental iterator on SkParagraph
Change-Id: Idcbb1e64780c87f4db9673ac184c02141aa6dee2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/392837
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-04-16 16:50:33 +00:00
Julia Lavrova
db10b0e802 Float error and positioning
(Hiding the fix from Flutter for now because we need to test it in
Google3 first)

Bug: skia:11100
Change-Id: I51fa37ee16a48de6a636dc857d5ae8650327922f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/391197
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-04-05 19:00:46 +00:00
Julia Lavrova
141b0aec13 Ignore \n metrics so it does not affect the layout
Bug: skia:11370
Change-Id: I17bf1304750be2c98f037bb8aebd65c525d836de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388445
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-04-01 16:25:33 +00:00
Julia Lavrova
2381c0b420 Handle the case when one grapheme includes more than one run.
Bug: skia:11743
Change-Id: Id53350845254905be1c5fcb0c2b1f757f5b6319f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/389930
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-03-30 19:58:16 +00:00
Julia Lavrova
5625ef5043 Too long placeholder should start from a new line
Bug: skia:11783
Change-Id: Ide5f0976bc20ababb483ddd10d2f081ad3d13a86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388138
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-03-23 14:53:28 +00:00
Julia Lavrova
583a343d9a Line height in case of a single placeholder
Bug: skia:11773
Change-Id: I6f5ff4afa5600d76c973669b35c182f385b6cf7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387818
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-03-22 19:21:48 +00:00
Ben Wagner
3d9ab7e7ec Separate general defaults from Skia defaults
In the build there are some defaults which actually apply to every
use of a built-in target type, but there are some (particularaly
warnings) which apply only to targets controlled by Skia. Currently
these unwanted defaults are magically known to exist and removed
wherever they are not wanted. Instead, create 'skia_' prefixed target
templates and apply these defaults to those instead.

Change-Id: I3a2afb53c7205a2e2748d1cfad46319f2e93d3b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/385516
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-03-22 15:30:56 +00:00
Herb Derby
965e444219 reduce overhead of littleRound
littleRound is used to round widths before a comparison with
maxWidth. The rounding only matters on a very small interval around
maxWidth. Take advantage of this fact to only do the expensive
rounding when close to maxWidth.

This is a 2-3% improvement.

Change-Id: If5b18ed4be56c1c8fa80b97d49930145d0f09b20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386844
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-03-20 00:11:44 +00:00
Herb Derby
980fb4de3a move Run::calculateWidth to improve inlining
This exposes the implementation of calculateWidth to the
cluster building function. It improves performance by 2-3%.

Change-Id: I6be71ef2c9bdd4fb59531fc53cc3868434cba79d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387216
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-03-19 22:45:14 +00:00
Herb Derby
339f7ea5a0 templatize iterateThroughClustersInTextOrder
This allows iterateThroughClustersInTextOrder to inline, and allows
iterateThroughClustersInTextOrder to inline the visitor. This
results in a 2-3% speed up.

Change-Id: Iacc137145547dc44dfbbddf2fa340d2945089169
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386818
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-03-19 20:41:22 +00:00
Julia Lavrova
6147424288 Correct the line height
Bug: skia:11370
Change-Id: I72b4a53924d310a907d1851a56f3137dbca1cf6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386859
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-03-19 18:26:12 +00:00
Herb Derby
79adde4046 allow Cluster::Cluster to inline
Move the ctor Cluster::Cluster into ParagraphImpl.cpp to allow
inlining. This results in about a 5% speed up using means.
        min     median  mean    max
before: 57.2µs  61.3µs  60.1µs  64.1µs
after:  55.8µs  58.4µs  57.3µs  59.4µs

Change-Id: Ie4cfcae9fde601ccf4a42aec69a853cc0bddb377
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386817
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-03-19 17:28:42 +00:00
Julia Lavrova
98a76eb6ea Add nbsp info to the cache
Change-Id: I9d4cd6f3d7c2871c1279c3a7190187bbfee1b56b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/383856
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-03-19 15:40:31 +00:00
Mike Reed
adbaeaa365 Cache/inline ishardbreak
~ 5% improvement

Change-Id: I6411bce47301af038202cf2de408e52e43e660cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386563
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-03-18 16:17:26 +00:00
Mike Reed
1c22e62b71 faster layout
Change-Id: If058b818048ee2cd6ade2a160d72beaae50bed2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/385162
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-03-18 01:19:00 +00:00
Julia Lavrova
c70f8c331d Using non-breaking spaces as a hint to break too long words
Change-Id: Ic88e961ea3fb08e61340895115f514c6f5dec163
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379798
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-03-08 04:31:04 +00:00
Julia Lavrova
b7b9a23281 Treat control codepoints as resolved
The correct solution will be implemented to fix bug 11380.
https://bugs.chromium.org/p/skia/issues/detail?id=11380

Bug: skia:11370
Change-Id: I15a84e2e785d73a298558e5ef0dedcc69f7b6eef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376936
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-03-02 20:38:48 +00:00
Jason Simmons
0b398cb2f4 Support multiple default font families
Change-Id: I79da6b47bad97968b54f8b0288c65c037998d19b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375316
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2021-02-25 21:21:00 +00:00
Jason Simmons
3607dd4693 Fix the flag that enables use of SkFontMetrics.fStrikeoutPosition
Change-Id: I47e210dd92beb91c0ce394b2dc1b97b98c8c378d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371513
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-02-18 18:57:59 +00:00
Ben Wagner
bded42ab51 Split :tests into :test and :tests.
Split the :tests target into a :test target which contains the test
framework and :tests which collects all of the test cases. This allows
for all targets which define tests to depend on :test in order to define
tests, with :tests then depending on all targets which define tests. A
similar split should be considered for gms, samples, and benches.

Change-Id: Ic9f373ec0c1a8ea842fa68327e854db23477caae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371696
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-02-18 17:01:23 +00:00
Jason Simmons
ecfaeb3de0 Avoid allocating an SkString buffer for the TextStyle default font family
Change-Id: I3aa121bd5f84b9f9fdf21e3bdea4223136f47f43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370903
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2021-02-18 16:51:13 +00:00
Julia Lavrova
8d5ccce163 Glyph positioning in RTL empty lines
Bug: skia:11258
Change-Id: Icbb34e571ba53e893b2887c963a46677b16b43e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368754
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-02-10 22:27:18 +00:00
Julia Lavrova
39caaac7fd RTL Glyph positioning
Bug: skia:11257
Change-Id: I297763c9585b988f5f89fd87b596c39220115f6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368537
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-02-10 20:00:14 +00:00
Julia Lavrova
f756979dbf Fixing a crash in Flutter Text Editor
Change-Id: I01b92f7c5f6030afae164ba2999e3aa8168597b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368417
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-02-09 22:10:55 +00:00
Julia Lavrova
efae4d56e1 Glyph positions in empty lines (few places had to be fixed)
Bug: skia:11259
Change-Id: I6aa24f9f1f95698d39dbc2ae0e6836f404fd0b24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/365491
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-02-03 23:05:38 +00:00
Julia Lavrova
e1db1fb6df Grapheme clusters and glypheme clusters edges don't match.
Bug: skia:11163
Change-Id: I8ba13c13843a2c04f3257a6857ba1a2a813dba76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361636
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-02-03 22:06:59 +00:00
Julia Lavrova
045f87d27f Reasonable results for not styled text in findAllBlocks.
Bug: skia:11256
Change-Id: Ice964f722c3c9f15cf3feab3c74b1c7235bbea7f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/364636
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-02-03 14:40:09 +00:00
Ben Wagner
dd9449c23b Add SkShaper::PurgeCaches.
Allows the user to signal that any global outstanding cached data should
be cleaned up to free resources.

Change-Id: I59d4bb2bbb4356920dea8caf912d9cb5f13014cf
Bug: skia:10763
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360079
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-01-27 17:50:30 +00:00
Julia Lavrova
d20a1097e8 Round unresolved font blocks to grapheme edges
I had to stage the change with SK_PARAGRAPH_GRAPHEME_EDGES because of
some google3 tests.
Bug: skia:11196

Change-Id: Ic45e43e6c69f649c6bc0fedcc6f303891139b85e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359566
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-01-27 15:39:09 +00:00
Ben Wagner
1604ad6b48 Clean up ParagraphCache::abandon.
This makes ParagraphCache::abandon just forward to
ParagraphCache::reset. This removes re-entering fParagraphMutex and an
empty loop.

Change-Id: I1f31474ec4e381c71e6eba062ba572a1c29d1a6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359839
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-01-27 00:41:56 +00:00
Julia Lavrova
420a75d685 Include placeholder widths in minIntrinsicWidth
Bug: skia:11179
Change-Id: Ic69c5a54b142584eddb28351c326952f4dd77376
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355976
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-01-19 22:47:56 +00:00
Julia Lavrova
68afd4802b Fixed TextBehavior for one line
3 different cases cases: text, empty line inside text, empty paragraph

Bug: skia:11167
Change-Id: I139a3974511d0984dddd86b6fbf72be3983f8394
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353579
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-01-14 20:56:49 +00:00
Julia Lavrova
aed808c756 Position inside family glyph
Bugs: skia:11104,skia:11023
Change-Id: If94678ddb3f369244739ea3cb6dbf0464f9a2388
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352736
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-01-11 22:41:25 +00:00
Julia Lavrova
bdd9a7bf2e RTL run broken by text styles crashes SkParagraph
Bug: skia:11148
Change-Id: I92f941faa645b98e2fc6827eac80020637780a1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/351501
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-01-07 21:03:01 +00:00
Jason Simmons
62db68aad1 Precompute the size of fClusters in ParagraphImpl::buildClusterTable
Change-Id: I337564ed308abee0e014ce6afc4cab8035a35052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344521
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2020-12-17 20:02:15 +00:00
Jason Simmons
6d14f3841d Reland "Cache text blobs computed by TextLine::paintText"
Change-Id: If166d7a2b287774054f833ac0f7b564bbcac9fa8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342936
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2020-12-10 19:03:19 +00:00
Mike Klein
2e9a03ec11 Revert "Cache text blobs computed by TextLine::paintText"
This reverts commit ff7bfea4ab.

Reason for revert: several broken bots, e.g.

../SRC/skia/modules/skparagraph/src/TextLine.cpp:309:21: error: non-const lvalue reference to type 'skia::textlayout::TextLine::TextBlobRecord' cannot bind to a temporary of type 'void'
    TextBlobRecord& record = fTextBlobCache.emplace_back();
                    ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Original change's description:
> Cache text blobs computed by TextLine::paintText
>
> Change-Id: I7d4414fb64b14a714623e4c20199cab06e6ed18c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342297
> Commit-Queue: Jason Simmons <jsimmons@google.com>
> Reviewed-by: Julia Lavrova <jlavrova@google.com>

TBR=jsimmons@google.com,jlavrova@google.com

Change-Id: I467c61eead7b0d8c190cb2f883b05537de97a08e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342856
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-10 13:28:09 +00:00
Jason Simmons
ff7bfea4ab Cache text blobs computed by TextLine::paintText
Change-Id: I7d4414fb64b14a714623e4c20199cab06e6ed18c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342297
Commit-Queue: Jason Simmons <jsimmons@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2020-12-10 01:11:37 +00:00
Mike Klein
cdd6cced45 quiet SkParagraph non-tests
These print out all the time when I'm testing things locally.  :/

Change-Id: I110a80c5b59c3fa024bee99f1516853b1dfd05d9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341797
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-08 18:40:42 +00:00
Julia Lavrova
b42686ad01 Painting styled text blocks in RTL
Bug: skia:11017
Change-Id: I13bd210a0d38614bab4a5a98c4507150043224cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340317
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-12-03 21:51:40 +00:00
Julia Lavrova
f9433fa316 Fixing some round problems with metrics
Bug: skia:10996
Change-Id: I003086d3625bb713f4f6c682346ab190dddd7426
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339856
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-12-03 14:52:23 +00:00
Julia Lavrova
611b2a6a0d Heuristic for filtering out too big editing text cases
Bug: skia:10487

Change-Id: Ie13db40ceee6edfcc1cfb28a131ff2cfa02038fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335664
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-11-25 15:54:27 +00:00
Julia Lavrova
36d06a806f Fixing background rectangle sizes for Flutter
Bug: skia:10982
Change-Id: Id5b352c1139293195ca421b069e8632079acf37b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337181
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Jason Simmons <jsimmons@google.com>
2020-11-24 23:03:46 +00:00
Julia Lavrova
748db70156 Make sure maxIntrinsicWidth is always no less than minIntrinsicWidth
Bug: skia:10992
Change-Id: Ifd3b8e799c76d09f6a01623747f646ce15de51b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338045
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-11-24 21:13:06 +00:00
Julia Lavrova
c90084a9a3 Revert "Some testing images in Google3 look slightly different with this change. Need to change them, too."
This reverts commit b776a105e5.

Reason for revert: This will be the first step of a staged change.

Original change's description:
> Some testing images in Google3 look slightly different with this change. Need to change them, too.
>
> Revert "Roll back #10487 fix (so now spaces always resolved in the main font)"
>
> This reverts commit ff5d8700b3.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Roll back #10487 fix (so now spaces always resolved in the main font)
> >
> > Bug: skia:10715
> > Change-Id: I06bb881998d00228c79a218967eda6468cbc5bed
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334053
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> TBR=bungeman@google.com,jlavrova@google.com
>
> Change-Id: Icc1f262f60fa2ec9b4425ce3088b5eaac9313374
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10715
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334158
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=bungeman@google.com,jlavrova@google.com

Change-Id: I0f2f46fc21eec795026ea98696f68112915f7979
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10715
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334159
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-11-12 15:32:48 +00:00
Julia Lavrova
b776a105e5 Some testing images in Google3 look slightly different with this change. Need to change them, too.
Revert "Roll back #10487 fix (so now spaces always resolved in the main font)"

This reverts commit ff5d8700b3.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Roll back #10487 fix (so now spaces always resolved in the main font)
>
> Bug: skia:10715
> Change-Id: I06bb881998d00228c79a218967eda6468cbc5bed
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334053
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=bungeman@google.com,jlavrova@google.com

Change-Id: Icc1f262f60fa2ec9b4425ce3088b5eaac9313374
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10715
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334158
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-11-11 20:47:16 +00:00
Julia Lavrova
ff5d8700b3 Roll back #10487 fix (so now spaces always resolved in the main font)
Bug: skia:10715
Change-Id: I06bb881998d00228c79a218967eda6468cbc5bed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334053
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-11-11 18:11:25 +00:00
Julia Lavrova
1d1c5c1a18 Yet another workaround Thai \n problem (same as txtlib)
Bug: skia:10881

Change-Id: If451b662646e66e5d699ca0cca3795f5e078b84e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332257
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-11-06 19:33:39 +00:00
Julia Lavrova
f857a87d64 Underline decorations with gaps and no text
Bug: Skia:10822
Change-Id: I5ab2f743fe2837070065954bc6f5ba930292f0c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328596
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-10-21 19:43:33 +00:00
Julia Lavrova
36700ef54d ICU project: script iterator in SkShaper
Change-Id: Idcc9290a7666cb590532150a44304d704c8ee34c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319777
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-10-16 16:08:12 +00:00
Julia Lavrova
1b44330169 Placeholder at the end of the text right before \n.
Bug: skia:10838
Change-Id: I0f6ebe442d67ba4c91cbef4fcaec6dea02739d34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327339
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-10-15 19:15:16 +00:00
John Stiles
f4bda743ff Rename SkTArray::reserve to reserve_back.
The semantics of `vector::reserve` and `SkTArray::reserve` were not the
same. SkTArray::reserve takes a delta over the current array size,
whereas vector takes a total array size. This could lead to subtle
errors with over- or under-reservation, hurting performance.

This CL renames `SkTArray::reserve` to `SkTArray::reserve_back` to give
the SkTArray behavior a distinct (hopefully easily understandable) name,
leaving its functionality as-is.

Change-Id: Icbd3114bb317fd5f307f393c02ae6fb6f83764e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326956
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-10-14 21:42:11 +00:00
Julia Lavrova
87cb9a4a10 Select a position on an empty line
Bugs: skia:10821
Change-Id: I26746e7baa143a6be7afdc91c994e4b8731d07f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324879
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-10-13 18:59:01 +00:00
Julia Lavrova
69f3cab837 Changing the way we select a grapheme
Selecting only graphemes that are fully inside the
[start:end) range. Hopefully, it's a temporary
solution to simplify SkParagraph vs TxtLib comparison.

Change-Id: Iebc74fb4ae20c232bfae762a04e45f0979cf6236
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322438
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-10-08 19:02:12 +00:00
Harry Terkelsen
223ffcdff9 Add more paragraph bindings to CanvasKit
Change-Id: Ib02b6504724e4d7cfa197a3508f8c0b84b4135bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313146
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
Auto-Submit: Harry Terkelsen <het@google.com>
2020-10-04 12:56:57 +00:00
Jason Simmons
1a47d891c1 Add an API for clearing the SkParagraph font and paragraph caches
Change-Id: Id8de439c8d872a6dad56acb5db4153186a9a9d96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320397
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2020-09-29 19:56:08 +00:00
Julia Lavrova
b6b7fffc35 Reland "Removing ICU dependencies from skparagraph BUILD.gn file"
This reverts commit 05ce2817f2.

Reason for revert: Fixing the build

Original change's description:
> Revert "Removing ICU dependencies from skparagraph BUILD.gn file"
>
> This reverts commit f1711adb1a.
>
> Reason for revert: Build break
>
> Original change's description:
> > Removing ICU dependencies from skparagraph BUILD.gn file
> >
> > (and from the sources, too)
> >
> > Change-Id: I9d8ff51c91aad4b770b1f183c04734d31252b851
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313148
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> > Reviewed-by: Ben Wagner <bungeman@google.com>
>
> TBR=bungeman@google.com,jlavrova@google.com
>
> Change-Id: I1fce2436855e3e2a4cb7d1d7204b3ae49fd530e8
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314540
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=bungeman@google.com,jlavrova@google.com

Change-Id: I13d78d75698df47930adc2514d1328abc556a209
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316444
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-09-11 18:31:24 +00:00
Julia Lavrova
0f64e0dfd8 An attempt to make font resolution more predictable.
In case the default font family is not there.
Bug: skia:10701

Change-Id: Ie1155d820bfcc25870bedcd0310b0e779d55e942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316087
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-09-10 20:35:11 +00:00
Julia Lavrova
9bfe92a39d Fixing a bug (reusing wrong formatting state)
Bug: skia:10702
Change-Id: I2b7814917bb1f2a729f231db6df6f010a7ec1abb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315654
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-09-08 20:17:06 +00:00
Julia Lavrova
c0d3495e1e Return to save/translate/restore for drawing via SkPicture
Can't really cache (x, y) in the picture - it's coming from the paint

Change-Id: I4ff9abe19dcd5394b40af427dfab03e8c38fba0e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315648
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-09-08 18:35:12 +00:00
Julia Lavrova
b6030fb2c8 Direct paint by default; remove save/translate/restore
Change-Id: Ic0c85d106012374ae5c467edd3a43a93ff2b57d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315603
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-09-08 17:27:35 +00:00
John Stiles
7571f9e490 Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'.
Mechanically updated via Xcode "Replace Regular Expression":

  typedef (.*) INHERITED;
    -->
  using INHERITED = $1;

The ClangTidy approach generated an even larger CL which would have
required a significant amount of hand-tweaking to be usable.

Change-Id: I671dc9d9efdf6d60151325c8d4d13fad7e10a15b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314999
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-03 03:41:26 +00:00
Julia Lavrova
05ce2817f2 Revert "Removing ICU dependencies from skparagraph BUILD.gn file"
This reverts commit f1711adb1a.

Reason for revert: Build break

Original change's description:
> Removing ICU dependencies from skparagraph BUILD.gn file
> 
> (and from the sources, too)
> 
> Change-Id: I9d8ff51c91aad4b770b1f183c04734d31252b851
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313148
> Commit-Queue: Julia Lavrova <jlavrova@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

TBR=bungeman@google.com,jlavrova@google.com

Change-Id: I1fce2436855e3e2a4cb7d1d7204b3ae49fd530e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314540
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-09-01 20:51:33 +00:00
Julia Lavrova
f1711adb1a Removing ICU dependencies from skparagraph BUILD.gn file
(and from the sources, too)

Change-Id: I9d8ff51c91aad4b770b1f183c04734d31252b851
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313148
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-09-01 20:35:34 +00:00
Julia Lavrova
1798f4f35c Reland "Reland "ICU: SkShaper (bidi iterator only)""
This reverts commit 03cde5f999.

Reason for revert: Fixing the build

Original change's description:
> Revert "Reland "ICU: SkShaper (bidi iterator only)""
>
> This reverts commit 7bc5542a9e.
>
> Reason for revert: breaking Android roll
>
> Original change's description:
> > Reland "ICU: SkShaper (bidi iterator only)"
> >
> > This reverts commit 73f003acfd.
> >
> > Reason for revert: Fixed the build
> >
> > Original change's description:
> > > Revert "ICU: SkShaper (bidi iterator only)"
> > >
> > > This reverts commit 64e3d040e9.
> > >
> > > Reason for revert: Breaking google3
> > >
> > > Original change's description:
> > > > ICU: SkShaper (bidi iterator only)
> > > >
> > > > Change-Id: I845cc0a962790ce37600f943473f21f619ee029b
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308508
> > > > Reviewed-by: Ben Wagner <bungeman@google.com>
> > > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> > >
> > > TBR=djsollen@google.com,bungeman@google.com,reed@google.com,jlavrova@google.com
> > >
> > > Change-Id: Ib081d97f61e57f74bb9414b3973cca640f3b3929
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309442
> > > Reviewed-by: Julia Lavrova <jlavrova@google.com>
> > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> >
> > TBR=djsollen@google.com,bungeman@google.com,reed@google.com,jlavrova@google.com
> >
> > Change-Id: I2d9c79deaaac97d3e0eb9b39ec9d53815fdb1f59
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310757
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> TBR=bungeman@google.com,jlavrova@google.com
>
> Change-Id: I89e80462edf8e014d7ea273885feeca17748a63a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313378
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>

TBR=djsollen@google.com,bungeman@google.com,jlavrova@google.com

Change-Id: Idce514c64309e7463fa23425d10f1b13dd9c8d18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313407
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-26 17:46:33 +00:00
Derek Sollenberger
03cde5f999 Revert "Reland "ICU: SkShaper (bidi iterator only)""
This reverts commit 7bc5542a9e.

Reason for revert: breaking Android roll

Original change's description:
> Reland "ICU: SkShaper (bidi iterator only)"
> 
> This reverts commit 73f003acfd.
> 
> Reason for revert: Fixed the build
> 
> Original change's description:
> > Revert "ICU: SkShaper (bidi iterator only)"
> >
> > This reverts commit 64e3d040e9.
> >
> > Reason for revert: Breaking google3
> >
> > Original change's description:
> > > ICU: SkShaper (bidi iterator only)
> > >
> > > Change-Id: I845cc0a962790ce37600f943473f21f619ee029b
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308508
> > > Reviewed-by: Ben Wagner <bungeman@google.com>
> > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> >
> > TBR=djsollen@google.com,bungeman@google.com,reed@google.com,jlavrova@google.com
> >
> > Change-Id: Ib081d97f61e57f74bb9414b3973cca640f3b3929
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309442
> > Reviewed-by: Julia Lavrova <jlavrova@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> 
> TBR=djsollen@google.com,bungeman@google.com,reed@google.com,jlavrova@google.com
> 
> Change-Id: I2d9c79deaaac97d3e0eb9b39ec9d53815fdb1f59
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310757
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=bungeman@google.com,jlavrova@google.com

Change-Id: I89e80462edf8e014d7ea273885feeca17748a63a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313378
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2020-08-26 13:09:15 +00:00
Julia Lavrova
7bc5542a9e Reland "ICU: SkShaper (bidi iterator only)"
This reverts commit 73f003acfd.

Reason for revert: Fixed the build

Original change's description:
> Revert "ICU: SkShaper (bidi iterator only)"
>
> This reverts commit 64e3d040e9.
>
> Reason for revert: Breaking google3
>
> Original change's description:
> > ICU: SkShaper (bidi iterator only)
> >
> > Change-Id: I845cc0a962790ce37600f943473f21f619ee029b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308508
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> TBR=djsollen@google.com,bungeman@google.com,reed@google.com,jlavrova@google.com
>
> Change-Id: Ib081d97f61e57f74bb9414b3973cca640f3b3929
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309442
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=djsollen@google.com,bungeman@google.com,reed@google.com,jlavrova@google.com

Change-Id: I2d9c79deaaac97d3e0eb9b39ec9d53815fdb1f59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310757
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-25 18:22:52 +00:00
Mike Reed
92f6eb1602 use pathbuilder
Change-Id: I2bca419a3273a9cc8a984b0f4159f518968c6652
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313077
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-25 16:29:48 +00:00
Mike Reed
457c6ddff0 remove unused enums for picture-recorder
Change-Id: I43e74a56d0aa68260ac9a9020a06a308ad75f694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312248
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-08-21 21:20:40 +00:00
Julia Lavrova
d279cee2f2 Fixing incorrect boundaries calculations + 3 ways of drawing a paragraph
Bug: skia:10620
Change-Id: I70086013130b23435d4e7c5ba375731760deb174
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311447
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-20 18:47:42 +00:00
John Stiles
a008b0fa8b Enable ClangTidy check readability-redundant-smartptr-get.
To my surprise, this even works with homegrown smart pointers (such as
SkTLazy).

https://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-smartptr-get.html

Find and remove redundant calls to smart pointer’s .get() method.

Examples:

  ptr.get()->Foo()  ==>  ptr->Foo()
  *ptr.get()  ==>  *ptr
  *ptr->get()  ==>  **ptr
  if (ptr.get() == nullptr) ... => if (ptr == nullptr) ...

Change-Id: I8ff541e0229656b4d8e875c8053a7e6138302547
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310976
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-16 15:56:48 +00:00
John Stiles
fe0de30a87 Enable ClangTidy check modernize-use-nullptr.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html

The check converts the usage of null pointer constants (eg. NULL, 0) to
use the new C++11 nullptr keyword.

Change-Id: Iaea2d843154c70e49d62affdc5dceb3bca8c1089
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310297
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-14 16:14:30 +00:00
Julia Lavrova
73f003acfd Revert "ICU: SkShaper (bidi iterator only)"
This reverts commit 64e3d040e9.

Reason for revert: Breaking google3

Original change's description:
> ICU: SkShaper (bidi iterator only)
> 
> Change-Id: I845cc0a962790ce37600f943473f21f619ee029b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308508
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=djsollen@google.com,bungeman@google.com,reed@google.com,jlavrova@google.com

Change-Id: Ib081d97f61e57f74bb9414b3973cca640f3b3929
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309442
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-11 21:06:10 +00:00
Julia Lavrova
64e3d040e9 ICU: SkShaper (bidi iterator only)
Change-Id: I845cc0a962790ce37600f943473f21f619ee029b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308508
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-11 19:58:08 +00:00
John Stiles
31954bf23f Enable ClangTidy check performance-unnecessary-copy-initialization.
https://clang.llvm.org/extra/clang-tidy/checks/performance-unnecessary-copy-initialization.html

Finds local variable declarations that are initialized using the copy
constructor of a non-trivially-copyable type but it would suffice to
obtain a const reference.

The check is only applied if it is safe to replace the copy by a const
reference. This is the case when the variable is const qualified or when
it is only used as a const, i.e. only const methods or operators are
invoked on it, or it is used as const reference or value argument in
constructors or function calls.

Change-Id: I1261410deccd8ea64e85edec53fbd5360940e587
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308759
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-07 22:20:36 +00:00