Commit Graph

10 Commits

Author SHA1 Message Date
Khushal
2b8a0d1844 fonts: Cleanup cache miss logging for font remoting.
Add hooks to notify the embedder if there is a cache miss during draw.
Also remove the reference to SkStrikeClient from SkTypefaceProxy and
SkScalerContextProxy, since the proxies can outlive the client.

R=herb@google.com

Bug: 829622
Change-Id: Ib2fd1b91ebd057856c1d4e717cf50b49f08c903b
Reviewed-on: https://skia-review.googlesource.com/129402
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2018-05-22 22:01:35 +00:00
Khushal
35e0a1a690 fonts: Add support for distance field text to font remoting.
R=jvanverth@google.com, herb@google.com

Bug: skia:7913
Change-Id: Id3f5b3e75005be9a7234df774268359b406c99a8
Reviewed-on: https://skia-review.googlesource.com/128970
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-22 19:49:45 +00:00
Khushal
51371a4339 fonts: Handle fallback to using paths for text rendering for remoting.
SkRemoteGlyphCache only sends images for glyphs, even for cases where
the gpu falls back to drawing text as paths. This includes cases in
SkDraw::ShouldDrawTextAsPaths and when the glyph exceeds the max bounds
that can fit on the atlas. Fix this by identifying these cases in the
renderer and sending paths instead.

Note: We still don't handle distance field text correctly.

R=herb@google.com, bsalomon@google.com

Bug: skia:7913
Change-Id: I17d4eccbeaa2e995ae67b61c76cebd27f8280329
Reviewed-on: https://skia-review.googlesource.com/128203
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-17 20:50:43 +00:00
Khushal
b2e71274fe fonts: Fix memory accounting for deserialized glyphs.
When deserializing glyphs in the SkRemoteGlyphCache, we allocate from
the arena for the SkGlyphCache but don't account for it in the total
memory used by the cache. Fix that and avoid exposing the SkArenaAlloc
from SkGlyphCache, since that can result in such brittle use.

R=herb@google.com

Bug: 829622
Change-Id: Iecff9ce6e0ed2c641957535363edec3e3fad178d
Reviewed-on: https://skia-review.googlesource.com/128112
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-15 22:58:23 +00:00
Khushal
b2e3934569 fonts: Cleanup header guard and stray printfs.
R=herb@google.com

Change-Id: I9d2865438f61f8e246f3a5e3548c0befbf402bc1
Reviewed-on: https://skia-review.googlesource.com/125643
Auto-Submit: Khusal Sagar <khushalsagar@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-05-03 14:19:11 +00:00
Khushal
38a0843688 fonts: Reland push font remoting.
This relands the following changes:
1) https://skia-review.googlesource.com/c/skia/+/120283
2) https://skia-review.googlesource.com/c/skia/+/125029
3) https://skia-review.googlesource.com/c/skia/+/125140

The original changes had to be reverted due to a memory leak in
SkBaseDevice from SkTextBlobCacheDiffCanvas. This has been addressed by
https://skia-review.googlesource.com/c/skia/+/125160

TBR=herb@google.com

Bug: skia:7515, 831354
Change-Id: I73f4fcb1c397f31bf01553ff48c71ed2d6dd0770
Reviewed-on: https://skia-review.googlesource.com/125326
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
2018-05-02 18:39:31 +00:00
Mike Klein
8a232023e1 Revert "fonts: Set up remote glyph caching to push fonts."
This reverts commit 101d56359a.

Reason for revert: 5 of 5

Original change's description:
> fonts: Set up remote glyph caching to push fonts.
> 
> Currently the SkStrikeClient is designed to pull fonts from the server
> on demand, and to pre-fetch a batched request by analyzing the ops using
> a SkTextBlobCacheDiffCanvas. This change modifies the design to support
> a push based model, where the server pushes fonts required by the client
> and sets up the requisite SkGlyphCaches on the client prior to
> rasterizing the ops.
> 
> This model still relies on the SkTextBlobCacheDiffCanvas for analyzing
> the glyphs required for rasterizing an op. The glyph caches required for
> raster are locked and missing glyphs to be sent to the client are tracked
> by the SkStrikeServer. The embedder can serialize this font data at any
> point, but must ensure that this data is deserialized by the
> SkStrikeClient at the remote end, before rasterizing any ops analyzed
> prior to serialization. Any refs on the caches are released once the
> font data is serialized by the server.
> 
> The locking of glyph caches relies on the embedder providing discardable
> handles. These handles can be created on the server and serialized to be
> sent to the client, and map to an instance of SkGlyphCache. This allows
> the server to control the lifetime of the caches on the client.
> 
> Bug: skia:7515
> Change-Id: Id39f346b47b60899778404bbd0429ee811d0e53b
> Reviewed-on: https://skia-review.googlesource.com/120283
> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
> Reviewed-by: Herb Derby <herb@google.com>

TBR=mtklein@google.com,herb@google.com,khushalsagar@chromium.org

Change-Id: If72caf968ddcbf70b8b9d71782a2339a118ed202
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7515
Reviewed-on: https://skia-review.googlesource.com/125264
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-02 13:55:08 +00:00
Mike Klein
192b18a261 Revert "fonts: Bandaid fix for desc mismatch in SkRemoteGlyphCache."
This reverts commit ef4142a9bc.

Reason for revert: 2 of 5

Original change's description:
> fonts: Bandaid fix for desc mismatch in SkRemoteGlyphCache.
> 
> Since the typeface proxies on the client don't perform the same
> filtering done on the server during SkDescriptor generation, it causes
> the desc mismatches during raster. Disable this filtering on the server
> until this is resolved.
> 
> Bug: 831354
> Change-Id: I5683372fb497a4874dede5aec9c734cd1392872c
> Reviewed-on: https://skia-review.googlesource.com/125140
> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
> Reviewed-by: Herb Derby <herb@google.com>

TBR=herb@google.com,khushalsagar@chromium.org

Change-Id: I8e732f57aa49323c186e3c4ea6120ff1caf8e25b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 831354
Reviewed-on: https://skia-review.googlesource.com/125261
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-02 13:53:18 +00:00
Khushal
ef4142a9bc fonts: Bandaid fix for desc mismatch in SkRemoteGlyphCache.
Since the typeface proxies on the client don't perform the same
filtering done on the server during SkDescriptor generation, it causes
the desc mismatches during raster. Disable this filtering on the server
until this is resolved.

Bug: 831354
Change-Id: I5683372fb497a4874dede5aec9c734cd1392872c
Reviewed-on: https://skia-review.googlesource.com/125140
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2018-05-01 22:55:37 +00:00
Khushal
101d56359a fonts: Set up remote glyph caching to push fonts.
Currently the SkStrikeClient is designed to pull fonts from the server
on demand, and to pre-fetch a batched request by analyzing the ops using
a SkTextBlobCacheDiffCanvas. This change modifies the design to support
a push based model, where the server pushes fonts required by the client
and sets up the requisite SkGlyphCaches on the client prior to
rasterizing the ops.

This model still relies on the SkTextBlobCacheDiffCanvas for analyzing
the glyphs required for rasterizing an op. The glyph caches required for
raster are locked and missing glyphs to be sent to the client are tracked
by the SkStrikeServer. The embedder can serialize this font data at any
point, but must ensure that this data is deserialized by the
SkStrikeClient at the remote end, before rasterizing any ops analyzed
prior to serialization. Any refs on the caches are released once the
font data is serialized by the server.

The locking of glyph caches relies on the embedder providing discardable
handles. These handles can be created on the server and serialized to be
sent to the client, and map to an instance of SkGlyphCache. This allows
the server to control the lifetime of the caches on the client.

Bug: skia:7515
Change-Id: Id39f346b47b60899778404bbd0429ee811d0e53b
Reviewed-on: https://skia-review.googlesource.com/120283
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2018-05-01 18:15:15 +00:00