Commit Graph

12 Commits

Author SHA1 Message Date
fmalita
3dc40ac9f9 Conservative SkTextBlob bounds.
Compute cheaper/more conservative text blob bounds based on the typeface
maximum glyph bbox.

BUG=chromium:451401
R=reed@google.com,bungeman@google.com

Review URL: https://codereview.chromium.org/886473002
2015-01-28 10:56:06 -08:00
bsalomon
072803144a Stop overloading internal_dispose in SkTextBlob and SkData
Review URL: https://codereview.chromium.org/737093002
2014-11-20 08:02:46 -08:00
fmalita
3c196def91 Souped-up SkTextBlob.
Refactored text blob backend for improved performance: instead of using
separate buffers for runs/positions/glyphs, everything is now packed in
a consolidated slab (including the SkTextBlob object itself!).

Benefits:

 * number of allocations per blob construction reduced from ~4 to 1
   (also minimizes internal fragmentation)
 * run record size reduced by 8 bytes

This takes the blob construction overhead down to negligible levels
(for the current Blink uncached textblob implementation).

Unfortunately, the code is much more finicky (run merging in
particular) -- hence the assert spree.

Multi-run blobs are vulnerable to realloc storms but this is not a
problem at the moment because Blink is using one-run blobs 99% of the
time. Will be addressed in the future.

R=mtklein@google.com, reed@google.com, robertphillips@google.com

Committed: https://skia.googlesource.com/skia/+/13645ea0ea87038ebd71be3bd6d53b313069a9e4

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/581173003
2014-09-20 05:40:22 -07:00
fmalita
e50215e598 Revert of Souped-up SkTextBlob. (patchset #3 id:40001 of https://codereview.chromium.org/581173003/)
Reason for revert:
Broke the new blobshader gm.

Original issue's description:
> Souped-up SkTextBlob.
>
> Refactored text blob backend for improved performance: instead of using
> separate buffers for runs/positions/glyphs, everything is now packed in
> a consolidated slab (including the SkTextBlob object itself!).
>
> Benefits:
>
>  * number of allocations per blob construction reduced from ~4 to 1
>    (also minimizes internal fragmentation)
>  * run record size reduced by 8 bytes
>
> This takes the blob construction overhead down to negligible levels
> (for the current Blink uncached textblob implementation).
>
> Unfortunately, the code is much more finicky (run merging in
> particular) -- hence the assert spree.
>
> Multi-run blobs are vulnerable to realloc storms but this is not a
> problem at the moment because Blink is using one-run blobs 99% of the
> time. Will be addressed in the future.
>
>
> R=reed@google.com,mtklein@google.com,robertphillips@google.com
>
> Committed: https://skia.googlesource.com/skia/+/13645ea0ea87038ebd71be3bd6d53b313069a9e4

R=mtklein@google.com, reed@google.com, robertphillips@google.com
TBR=mtklein@google.com, reed@google.com, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/588853002
2014-09-19 19:03:06 -07:00
fmalita
13645ea0ea Souped-up SkTextBlob.
Refactored text blob backend for improved performance: instead of using
separate buffers for runs/positions/glyphs, everything is now packed in
a consolidated slab (including the SkTextBlob object itself!).

Benefits:

 * number of allocations per blob construction reduced from ~4 to 1
   (also minimizes internal fragmentation)
 * run record size reduced by 8 bytes

This takes the blob construction overhead down to negligible levels
(for the current Blink uncached textblob implementation).

Unfortunately, the code is much more finicky (run merging in
particular) -- hence the assert spree.

Multi-run blobs are vulnerable to realloc storms but this is not a
problem at the moment because Blink is using one-run blobs 99% of the
time. Will be addressed in the future.

R=mtklein@google.com, reed@google.com, robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/581173003
2014-09-19 18:37:00 -07:00
fmalita
aa1b912046 Expose drawTextBlob to devices.
Instead of unrolling blobs in SkCanvas, perform the equivalent ops in
SkBaseDevice.

This depends on https://codereview.chromium.org/511783005/.

R=jvanverth@google.com, reed@google.com, robertphillips@google.com, bsalomon@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/517663003
2014-08-28 14:32:24 -07:00
fmalita
228a6f275d SkTextBlob GPipe serialization.
Instead of relying on unrolling blobs in SkCanvas, serialize when
passing through a GPipe.

This is a prerequisite for pushing the blob draw op to the device.

R=mtklein@google.com, reed@google.com, robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/511783005
2014-08-28 13:59:42 -07:00
fmalita
b7425173f9 SkTextBlob plumbing
Add SkTextBlob serialization + drawTextBlob() overrides.

R=mtklein@google.com, reed@google.com, robertphillips@google.com
BUG=269080

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/499413002
2014-08-26 07:56:44 -07:00
jbroman
3053dfaefd Add SK_API to SkTextBlob and SkTextBlobBuilder.
BUG=skia:2868
R=fmalita@chromium.org, reed@google.com

Author: jbroman@chromium.org

Review URL: https://codereview.chromium.org/497993002
2014-08-25 06:22:12 -07:00
fmalita
37ecbaffd1 [SkTextBlob] Merge run font data at draw time.
R=bungeman@google.com, reed@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/496773002
2014-08-22 09:01:20 -07:00
fmalita
c6765d69e3 Add some SkTextBlob builder tests.
R=reed@google.com, robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/493443004
2014-08-21 15:03:04 -07:00
fmalita
00d5c2c652 SkTextBlob
Initial implementation.

R=bungeman@google.com, jbroman@chromium.org, mtklein@google.com, reed@google.com, robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/473633002
2014-08-21 08:53:26 -07:00