Commit Graph

325 Commits

Author SHA1 Message Date
Brian Salomon
efb32fe3c0 Fix -Wunused-but-set-variable warnings
Change-Id: I5a044983e3de84901f29bddca5503167edc8fcee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535436
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-04-29 15:20:59 +00:00
Jason Simmons
c35e492a19 ParagraphBuilder efficiency improvements and simplification
* Use SkSTArray instead of stack/deque for fTextStyles
* Use fParagraphStyle for the base style instead of pushing an extra copy
  into fTextStyles
* Call endRunIfNeeded only when starting a new styled block

Change-Id: I5f80c052a7589d8da7e6a797b155884efd5449a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533983
Commit-Queue: Jason Simmons <jsimmons@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2022-04-27 17:57:00 +00:00
Julia Lavrova
62f07d262c Like breaking for a single line text
Change-Id: Ib9955d56bcf658aa78eb8dc8d5c48e8ccdf01581
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528440
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-04-15 14:47:49 +00:00
Kevin Lubick
83cee23c98 [bazel] Run buildifier on BUILD.bazel files
buildifier --lint=fix -r .

Change-Id: I6a41858270d20137978f8271c8f6160b51120777
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529751
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-04-14 18:13:43 +00:00
Kevin Lubick
b98328a27b [bazel] Add license to all our BUILD.bazel files
find -name "BUILD.bazel" -exec sed -i -e '1i licenses(["notice"])\n' {} +

Change-Id: Ie48f163b7d8d6ede9ba5f952e87232dd5c9fa8e6
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529808
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-04-13 19:50:29 +00:00
Julia Lavrova
55c56abac3 Simplify the most commont paint case
Change-Id: Ie6efa0cdcf682ad7ea5c1d4ca6232af6224a68f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527282
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-04-08 14:20:38 +00:00
Julia Lavrova
597877ab4a Simplify or even skip glyph spacing if possible
Change-Id: Ibcf5db117b338c9a4c0582067e63e98f55e25a3a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526271
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-04-04 18:35:14 +00:00
Ben Wagner
b198752832 Correct FontArguments.h location in build file.
Change-Id: Ia12c07752a9d31dfbf846f2cd2bb63d47532d6f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526677
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2022-04-01 18:09:18 +00:00
Jason Simmons
a990ef91b3 Clone the contents of SkFontArguments when storing the key of the FontCollection typeface cache
Change-Id: I871f82006b78abc872c3af7a70c875c2f5cacc14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525823
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2022-04-01 15:56:00 +00:00
Julia Lavrova
cf3e1c4fe9 Remove DrawOptions (except direct drawing)
That would allow us not to query glyph bounds

Change-Id: Ibee53446e33fd6a54affc1ded438191186cd21be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526296
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-04-01 15:46:39 +00:00
Jason Simmons
cbe01216b5 Check font arguments when determining whether text styles have the same font
Change-Id: Ib8289d9ece43781e61db2a3ed080dedef296e539
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525738
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2022-03-30 17:42:29 +00:00
Julia Lavrova
0e5601d08b Letter/Word spacing gone on the initial Runs
So we don't have to drag these shifts through the entire process.
This is the first step for simplified layout optimization.
(Need letter spacing because it's common in iOS Flutter)

Change-Id: I28b066e4dd8bcc6e489752dafbda1b73b0444fbe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524223
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-03-29 16:46:30 +00:00
Kevin Lubick
aab019a15e [bazel] Fix build
Most of these are pretty mechanical generated changes.

IWYU noticed one issue with DSLCore.h, which was fixed here.

Change-Id: I5629565ad3c2817daa71907c62f932d93f9d78ab
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524617
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-03-28 13:56:16 +00:00
Julia Lavrova
7f57bceae2 Ellipsis in RTL
For entirely RTL text the ellipsis expected to be on the left side.

Bug: skia:13069
Change-Id: I853687e1e741dd57af950f17717fa8553648b477
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523856
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-03-24 20:27:49 +00:00
Jason Simmons
78abc00dab SkParagraph support for variable fonts
Change-Id: Ibfa8e1840b2d2faa859b60dd189342c0411db59a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516998
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2022-03-23 20:42:08 +00:00
Julia Lavrova
0861eaf302 Fixing getRectForRange in case with ellipsis
Bug: skia:510084
Change-Id: I49cd012676347f298cce885827546a781698ba97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510857
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-02-22 18:43:20 +00:00
John Stiles
2122f40c4b Update REPORTER_ASSERT/ERRORF to check format strings.
Previously, REPORTER_ASSERT/ERRORF relied on a helper function named
`reporter_string` which papered over zero-argument and one-argument
messages (where one-argument messages are assumed to ignore printf
formatting rules entirely, and just forward the message as-is).

Replacing this helper with a direct call to `SkStringPrintf` allows
the compiler to check format arguments for correctness, but sacrifices
the one-argument special case. In practice the one-argument special
case was very rarely used, so it's not a significant sacrifice,
and this did uncover several real errors in assertion format strings
(including some cases where the wrong number of arguments was passed).

Change-Id: I4378c43b16fd8fdbf4c78d849a9f2f0a254f7abc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506617
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-02-10 16:37:05 +00:00
John Stiles
4250effcc5 Prepare to reenable unreachable-code warnings.
Adding double-parens around an `if ((false))` squelches the warning.
In other cases, you can squelch the warning by assigning the
always-constant(-on-this-machine) check into a constexpr bool.

Change-Id: I5a344fb45779c5bd2865edb3cffaf839ba9a5d85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504597
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-04 21:45:39 +00:00
Julia Lavrova
24a8aa9d1f Updating the API description for Flutter
bug: skia:12850
Change-Id: I78148b2d99701a9127c377ddf709c89a885fcfc2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502312
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-02-01 15:36:41 +00:00
Dan Field
dc17274403 ParagraphBuilder::Reset
Allow callers to reset the ParagraphBuilder to an initial state for
reuse and caching.

Bug: https://github.com/flutter/flutter/issues/97182
Change-Id: Ifc80bdd53a1c68d4bfe355c74bbefa27b1d2d7de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/499236
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Dan Field <dnfield@google.com>
2022-01-25 19:24:40 +00:00
Julia Lavrova
85a7045856 Fixing some getRectsForRange issues
This fix only affects 2 very specific cases used for text selection
in Flutter (via getRectsForRange).

bug: skia:12785
Change-Id: I22d141210d129d78ed028592162fef02b9120292
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491450
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-01-06 18:53:23 +00:00
Jason Simmons
ddbf93159f Move Run per-glyph data into an object held in a shared_ptr
This will reduce memcpy overhead when runs are copied into a paragraph
or when paragraph cache entries are read or written

Change-Id: Id81725f3d8fc70daa17d154093ae7bc8b519118c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/483022
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2021-12-13 22:24:30 +00:00
Jason Simmons
c307c5566d Efficiency improvements to SkParagraph ParagraphCacheKey
* Compute and store the hash in the ParagraphCacheKey ctor
* Move the ParagraphCacheKey into the ParagraphCacheValue during construction

Change-Id: If267fe6757c6a6bf7528f4dcc838e88f5458946f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481239
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2021-12-08 18:55:59 +00:00
Kevin Lubick
4bd08c52c0 [infra] Add SkParagraph (harfbuzz, ICU) to Canvaskit Bazel build.
As a follow-up to https://skia-review.googlesource.com/c/skia/+/476219,
this sketches out how we can maybe use cc_library for the things
in //modules to make sure something in //src doesn't depend on
anything in //modules, for example.

The following succeeds:
bazel build //modules/skparagraph:skparagraph --config=clang \
  --shaper_backend=harfbuzz_shaper --with_icu

As does `make bazel_canvaskit_debug` in //modules/canvaskit

Suggested Review Order:
 - third_party/BUILD.bazel for ICU and harfbuzz rules. Pay
   special attention to the genrules used to call the python
   script for turning the icu .dat file into .S or .cpp.
 - bazelrc and bazel/ for new flags and defines that control
   use of ICU and harfbuzz. Unlike GN, with the public_defines
   that get added in automatically if icu or harfbuzz is
   depended upon, we need to set the defines at the top level.
   This necessity might go away if we change the atoms to
   depend on //modules/skshaper, which could define that flag.
 - Top level BUILD.bazel files in //modules/skparagraph,
   //modules/skshaper, //modules/skunicode, //modules/canvaskit
 - All other .bazel file changes are automatic.

Bug: skia:12541
Change-Id: I38a9e0a9261d7e142eeb271c2ddb23f362f91473
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478116
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-30 21:01:06 +00:00
Julia Lavrova
8a4ba51fa7 Flutter RTL/LTR positioning fix
Bug: skia:12647
Change-Id: I7de8931183c3ed9ae82864ed766fff9a196e856c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471777
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-11-16 20:23:05 +00:00
Robert Phillips
297d096cfb [graphite] More testing infrastructure
With this CL we can run as:

     dm --src gm skp tests --config grmtl -v --nocpu --nogpu

and not get all the non-Graphite unit tests.

Bug: skia:12466
Change-Id: Ib3f04f315fe4b5731a54e4c72979a0c1e00baf24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457898
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-10-13 15:15:29 +00:00
Julia Lavrova
0c1f6e5dab Implementing baseline shift for JetBrains
Bug: skia:12390
Change-Id: I90d99e1ca18c1274ac53ab35a3f63b716d26cb5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457097
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-10-12 14:35:33 +00:00
Julia Lavrova
398ef4487b Reland "Reland "Small changes for SkText that are not in experimental directory""
This reverts commit b51994990b.

Reason for revert: Fixed the test

Original change's description:
> Revert "Reland "Small changes for SkText that are not in experimental directory""
>
> This reverts commit ce32c8a074.
>
> Reason for revert: Skottie test is broken
>
> Original change's description:
> > Reland "Small changes for SkText that are not in experimental directory"
> >
> > This reverts commit 481a58dfe0.
> >
> > Reason for revert: Fixing the build
> >
> > Original change's description:
> > > Revert "Small changes for SkText that are not in experimental directory"
> > >
> > > This reverts commit 92f1bc0083.
> > >
> > > Reason for revert: Blocking Android roll.
> > >
> > > Original change's description:
> > > > Small changes for SkText that are not in experimental directory
> > > >
> > > > (also made utf 8<->16 conversion static on SkUnicode)
> > > >
> > > > Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
> > > > Reviewed-by: Mike Reed <reed@google.com>
> > > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> > >
> > > Change-Id: Ieb9eb0495dddfc0f9e9e74861b24efc0201fd520
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448656
> > > Auto-Submit: Brian Osman <brianosman@google.com>
> > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> >
> > Change-Id: I1e5859c9dd943c701d4c4e648bdc3e44412eca54
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448676
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> Change-Id: Ib8e5ec05a5555f34106a0ee61878a8199b82bb82
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448897
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Florin Malita <fmalita@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: I3bc103c0e1c495342a6673e80765b5f26862e8dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448898
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-09-15 15:31:14 +00:00
Julia Lavrova
b51994990b Revert "Reland "Small changes for SkText that are not in experimental directory""
This reverts commit ce32c8a074.

Reason for revert: Skottie test is broken

Original change's description:
> Reland "Small changes for SkText that are not in experimental directory"
>
> This reverts commit 481a58dfe0.
>
> Reason for revert: Fixing the build
>
> Original change's description:
> > Revert "Small changes for SkText that are not in experimental directory"
> >
> > This reverts commit 92f1bc0083.
> >
> > Reason for revert: Blocking Android roll.
> >
> > Original change's description:
> > > Small changes for SkText that are not in experimental directory
> > >
> > > (also made utf 8<->16 conversion static on SkUnicode)
> > >
> > > Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
> > > Reviewed-by: Mike Reed <reed@google.com>
> > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> >
> > Change-Id: Ieb9eb0495dddfc0f9e9e74861b24efc0201fd520
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448656
> > Auto-Submit: Brian Osman <brianosman@google.com>
> > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
>
> Change-Id: I1e5859c9dd943c701d4c4e648bdc3e44412eca54
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448676
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: Ib8e5ec05a5555f34106a0ee61878a8199b82bb82
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448897
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-09-14 20:32:02 +00:00
Julia Lavrova
ce32c8a074 Reland "Small changes for SkText that are not in experimental directory"
This reverts commit 481a58dfe0.

Reason for revert: Fixing the build

Original change's description:
> Revert "Small changes for SkText that are not in experimental directory"
>
> This reverts commit 92f1bc0083.
>
> Reason for revert: Blocking Android roll.
>
> Original change's description:
> > Small changes for SkText that are not in experimental directory
> >
> > (also made utf 8<->16 conversion static on SkUnicode)
> >
> > Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> Change-Id: Ieb9eb0495dddfc0f9e9e74861b24efc0201fd520
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448656
> Auto-Submit: Brian Osman <brianosman@google.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>

Change-Id: I1e5859c9dd943c701d4c4e648bdc3e44412eca54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448676
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-09-14 14:30:22 +00:00
Brian Osman
481a58dfe0 Revert "Small changes for SkText that are not in experimental directory"
This reverts commit 92f1bc0083.

Reason for revert: Blocking Android roll.

Original change's description:
> Small changes for SkText that are not in experimental directory
>
> (also made utf 8<->16 conversion static on SkUnicode)
>
> Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: Ieb9eb0495dddfc0f9e9e74861b24efc0201fd520
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448656
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-09-14 13:27:19 +00:00
Julia Lavrova
92f1bc0083 Small changes for SkText that are not in experimental directory
(also made utf 8<->16 conversion static on SkUnicode)

Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-09-13 18:22:33 +00:00
Robert Phillips
be2c3ee05d Fix compilation with "skia_enable_skparagraph = false"
Change-Id: I034d841618fbf878223c82ec30f0ad37678d737e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443899
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-31 18:50:20 +00:00
Julia Lavrova
5dbdb1e75d Line metrics: return all indices in UTF16
Bug: skia:12383
Change-Id: Ibf5521caa8858a7f18fd2717f5f55ff52ffeef54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443403
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-08-30 18:51:58 +00:00
Julia Lavrova
078a8ddc77 Yet another bug in line metrics
Bug: skia:12382
Change-Id: I18039db0a4e89a25c31d27ea7f60ae7bde50730f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443401
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-08-30 18:21:27 +00:00
Julia Lavrova
0f629d7f48 Positioning in chinese glyphs
+small fix for placeholder in getGlyphPositionAtCoordinate

Bug: skia:12322
Change-Id: I8f03c5c808db54fc9742e5817768db4a088bc5b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440458
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-08-25 20:49:48 +00:00
John Stiles
13c9f6690e Fix additional cases of variable shadowing.
These changes will allow us to enable shadowed-variable warnings.

Change-Id: I24ee7e198c1c77b58836237c37557c00452680e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439476
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-08-16 17:47:14 +00:00
Julia Lavrova
8343e003ca SkText: implement select via styles
Change-Id: I047f7fc4027572892433d759f4098f5da9da4662
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438657
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-08-11 19:49:35 +00:00
John Stiles
b65b4da554 Fix cases of variable shadowing in /modules/.
If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.

Change-Id: Id56c227be7c29c56d6e9253aefcd33607bb1129e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438576
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-08-11 17:14:42 +00:00
John Stiles
1be6cbbb96 Fix cases of variable shadowing in module/.
These were reviewed last year at http://review.skia.org/312480 but never
landed. Splitting into small chunks to land individually.

If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.

Change-Id: If993bfe66969d2278009d3a3aba999467f4ac3a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435719
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-08-02 19:13:02 +00:00
Florin Malita
40f3db41af Reland "Experimental ICU runtime linking"
This is a reland of f4aab0584d

Original change's description:
> Experimental ICU runtime linking
>
> Introduce a build config option where ICU symbols are resolved at
> runtime, against existing system libs.
>
> Change-Id: I2325537438de0063fcc4a7c0f8411764cf550f09
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431037
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: I6f67a5eb842743d2486ccc4519e2d8cb9fac3458
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433277
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-07-27 19:51:31 +00:00
Florin Malita
6cce9615a0 Revert "Experimental ICU runtime linking"
This reverts commit f4aab0584d.

Reason for revert: build failures

Original change's description:
> Experimental ICU runtime linking
>
> Introduce a build config option where ICU symbols are resolved at
> runtime, against existing system libs.
>
> Change-Id: I2325537438de0063fcc4a7c0f8411764cf550f09
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431037
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

TBR=djsollen@google.com,bungeman@google.com,fmalita@chromium.org,fmalita@google.com,jlavrova@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ic252af1d7ba0a72b3c596e61f86746c27a0685b7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433276
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-07-27 12:13:39 +00:00
Florin Malita
f4aab0584d Experimental ICU runtime linking
Introduce a build config option where ICU symbols are resolved at
runtime, against existing system libs.

Change-Id: I2325537438de0063fcc4a7c0f8411764cf550f09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431037
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-07-26 21:18:17 +00:00
Julia Lavrova
fb4d380747 Wrong line metrics in case of a force text wrapping
Change-Id: I8fb6530c46ba8fb7f6fa2894227193ca6a9e391b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430220
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-07-20 17:22:40 +00:00
Mike Reed
4043111918 Purge 2020 picture versions
Pull a thread, and end up removing logs of old fontmgr code.

Change-Id: I73cebf9c011a99e9d12fd728e8677fcb0700407f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429338
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-07-19 19:35:49 +00:00
John Stiles
55f0d7acfa Always enforce format specifiers on SkDebugf.
Change-Id: Icba60060ab4dec45c8ef1b1e2f35056626adc0a7
Bug: skia:12143, 192062380
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428616
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2021-07-15 20:11:24 +00:00
Julia Lavrova
3cf050bba6 Fixing placeholder position
Bug: skia:12130
Change-Id: Iac2f4f1799f054694d33259f31d1216aa040c5e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426923
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-07-13 20:47:50 +00:00
Julia Lavrova
3a44eb92e9 Apparently, line metrics should not include newlines
(Flutter doc is wrong)
Bug: skia:12127

Change-Id: I422a870d3cf6346cf8b37834fe89c846f804e236
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423586
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-07-13 17:16:23 +00:00
Julia Lavrova
f3ee264564 Count trailing spaces when calculating glyph position
Bug: skia:12126
Change-Id: I1431ef3e63f8f07785a39887fa4ac6f60685c549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423636
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-07-13 14:54:13 +00:00
John Stiles
7bf799956d Reland "Add format-specifier warnings to SkDebugf."
This is a reland of e58831cd95

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>

Bug: skia:12143
Change-Id: Id3c0c21436ebd13899908d5ed5d44c42a0e23921
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421918
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-25 17:57:43 +00:00