Commit Graph

24 Commits

Author SHA1 Message Date
Kevin Lubick
57abfe9737 Adjust variable names from paint to font
Bug: skia:
Change-Id: I9ca7c8dd5e0122b2a9d4edd4c4f4934e36151b7e
Reviewed-on: https://skia-review.googlesource.com/c/187383
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-01-28 20:57:56 +00:00
Ben Wagner
c5aa8ebe0d Use only icu c api in shaper.
Change-Id: I6e05404465b44ca48d391d0502dadbcef0b4b111
Reviewed-on: https://skia-review.googlesource.com/c/186702
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-01-24 21:53:25 +00:00
Mike Reed
77f94ea72b Move more utils into SkFontPriv, IWYU
Fissioned from https://skia-review.googlesource.com/c/skia/+/185460

Bug: skia:
Change-Id: Iaf980e931c17196f917602fc58fc39ab51e3d248
Reviewed-on: https://skia-review.googlesource.com/c/185840
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-22 22:24:03 +00:00
Florin Malita
a4e1a63452 [skshaper] Relax create_hb_font assert
Log a message in debug mode instead of crashing.

Change-Id: Ib8d7733f3aab2e9f1324188a221550ccf13563cb
Reviewed-on: https://skia-review.googlesource.com/c/185881
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-01-22 22:20:33 +00:00
Mike Reed
9a4a05e211 iwyu
Bug: skia:
Change-Id: I4b9e1ef1e352f3495e92479501cfc5b6422e7a6d
Reviewed-on: https://skia-review.googlesource.com/c/185682
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-22 14:08:13 +00:00
Florin Malita
6d415bce3a [skshaper] Build tweaks
Preps for building in Chromium & G3.

Change-Id: I4eb802f27aac7d3652c3b3ce427dcc758d6c31fe
Reviewed-on: https://skia-review.googlesource.com/c/185000
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-01-18 20:25:40 +00:00
Florin Malita
950243df0e Hack up SkShaper to pass additional callback info
- rename LineHandler -> RunHandler (since it gets called per run)
- pass additionl run info:

  * line index
  * cumulative advance
  * ascent/descent/leading

Bug: skia:
Change-Id: Ie848e5a35243088b99989c73fdec44c6a1bdd051
Reviewed-on: https://skia-review.googlesource.com/c/183300
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-01-11 17:04:26 +00:00
Mike Reed
22451ccae5 accessors for RunBuffer as points or rsxforms
trying to reduce casts at call-sites

Bug: skia:
Change-Id: I7c74cfd89111f7a197cbb1d77b499e2adc193579
Reviewed-on: https://skia-review.googlesource.com/c/180363
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-02 04:10:36 +00:00
Florin Malita
9867f61160 SkShaper per-line callback
Tweak SkShaper to call out for each line, instead of bundling everything
as a text blob.

Change-Id: Ic522f88afcf31cefd873dc8b5cde1ac2e107c64f
Reviewed-on: https://skia-review.googlesource.com/c/176592
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-12-12 17:54:12 +00:00
Mike Reed
6d59568196 change private alloc methods to also take fonts
Bug: skia:2664
Change-Id: I772534179ce0c948984640f9fffc22e0372fce97
Reviewed-on: https://skia-review.googlesource.com/c/174848
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-12-06 02:15:36 +00:00
Hal Canary
2a1848d2aa SkShaper->SkFont
Change-Id: I6293f08c426650e3d1da8b2f94a81f7b0a65e8a3
Reviewed-on: https://skia-review.googlesource.com/c/172969
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-11-27 18:53:32 +00:00
Hal Canary
ddef43ffdf SkShaper: better error info.
Change-Id: Ie7966e22282ef25861cc775bd0904c113ded76c1
Reviewed-on: https://skia-review.googlesource.com/c/171523
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-11-16 16:21:00 +00:00
Mike Reed
b5784ace85 use SkFontMetrics so we can deprecated the typedef
Bug: skia:
Change-Id: Icd40c042b0a8251bbd0b39dd3ee1a4634fff379f
Reviewed-on: https://skia-review.googlesource.com/c/170344
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-12 15:03:03 +00:00
Hal Canary
0dfa208450 SkShaper: Fix a couple of crashes when fonts aren't found
Change-Id: Id62bb0e0edde25fe90f63547d4dbedada2c09909
Reviewed-on: https://skia-review.googlesource.com/c/166803
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-10-31 17:46:54 +00:00
Ben Wagner
a900ad5400 Make fallback font iterator in shaper cache fallback.
Most of the time when doing fallback there is a simple ping pong between
the requested font and a given fallback font. Use the fallback entry as
a cache of one. This greatly speeds up the example layout.

In the future more work will be done on caching.

Change-Id: I3efe819d6d08d096715cf505cc8d894a282a745b
Reviewed-on: https://skia-review.googlesource.com/151100
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-09-04 18:00:56 +00:00
Cary Clark
e12a090a63 make some textblob builders private for now
Move SkTextBlobBuilder::allocRunText* to private: for the time
being, to reduce the documented interface footprint.

No code is deleted; the functions may be restored when a
client is ready to call them.

Also, add SkTextBlob::MakeFromString to complement
SkTextBlob::MakeFromText.

R=halcanary@google.com,fmalita@google.com
TBR=reed@google.com
Bug: skia:6818
Change-Id: If09d4da4ce38b680d73f25d187e3d06eeb0ec652
Reviewed-on: https://skia-review.googlesource.com/146521
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-08-09 15:01:31 +00:00
Ben Wagner
177742435e Some iwyu for SkShaper_harfbuzz.
This makes it easier to see what ties this module to Skia.

Change-Id: I392ae4f89fb1afe9193bdb2fda95036f4f5623ed
Reviewed-on: https://skia-review.googlesource.com/145882
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-08-07 19:00:58 +00:00
Ben Wagner
c0c99b3a69 Add context to shaper.
This allows correct shaping across any run breaks.

Change-Id: Ib305bd974ccee2471b1dfe8bd895fb28e475177f
Reviewed-on: https://skia-review.googlesource.com/145726
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-08-07 18:24:14 +00:00
Hal Canary
f107a2fd01 SkUTF
Create new header and namespace, `SkUTF` where we are putting all of our
robust, well documented UTF-8, UTF-16, and UTF-32 functions:
`SkUTF::{Count,Next,To}UTF{8,16,32}()`.

SkUTF.h and SkUTF.cpp do not depend on the rest of Skia and are suitable
for re-use in other modules.

Some of the old UTF-{8,16} functions still live in SkUtils.h; their use
will be phased out in future CLs.

Also added more unit testing and cleaned up old tests.

Removed functions that were unused outside of tests or used only once.

Change-Id: Iaa59b8705abccf9c4ba082f855da368a0bad8380
Reviewed-on: https://skia-review.googlesource.com/143306
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-07-31 20:11:19 +00:00
Hal Canary
4014ba6ec7 SkUtils: remove some versions of UTF routines.
Change-Id: Ib1f776ae472117c23d2145253adf25fceb412b32
Reviewed-on: https://skia-review.googlesource.com/143111
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-07-25 17:21:56 +00:00
Hal Canary
c640d0dc96 Revert "Revert "SkTypes: extract SkTo""
This reverts commit fdcfb8b7c2.

> Original change's description:
> > SkTypes: extract SkTo
> >
> > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
> > Reviewed-on: https://skia-review.googlesource.com/133620
> > Reviewed-by: Mike Klein <mtklein@google.com>

Change-Id: Ida74fbc5c21248a724a5edbf9fae18a33bcb23aa
Reviewed-on: https://skia-review.googlesource.com/134506
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-14 14:55:17 +00:00
Hal Canary
fdcfb8b7c2 Revert "SkTypes: extract SkTo"
This reverts commit 2a2f675926.

Reason for revert: this appears to be what is holding up the Chrome roll.

Original change's description:
> SkTypes: extract SkTo
>
> Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
> Reviewed-on: https://skia-review.googlesource.com/133620
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,halcanary@google.com

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae
Reviewed-on: https://skia-review.googlesource.com/134504
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-13 13:45:47 +00:00
Hal Canary
2a2f675926 SkTypes: extract SkTo
Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
Reviewed-on: https://skia-review.googlesource.com/133620
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-12 15:03:21 +00:00
Herb Derby
264182c3f7 Make SkShaper a module
Change-Id: I3709e49ba865f14260660cc07a762b9ac837cb3c
Reviewed-on: https://skia-review.googlesource.com/130602
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-05-30 04:04:07 +00:00