aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkStrikeCache.h
Commit message (Collapse)AuthorAge
* Use local strike caches to avoid flaky test behaviorGravatar Herb Derby2018-06-21
| | | | | | | | | | | | | | The remote glyph cache tests assume that the strike cache will not change during a test. This is not true because other test also mutate the strike cache. This is causing flaky tests. BUG=skia:8091 Change-Id: I397d411f9412006715f6860941dfb05ad54ae1b6 Reviewed-on: https://skia-review.googlesource.com/136741 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Make SkStrikeCache::Validate call non global versionGravatar Herb Derby2018-06-21
| | | | | | | | | | | | Change Validate to ValidateGlyphCacheDataSize. Make it call a non-global version. BUG=skia:8091 Change-Id: Iec31a06569a0ab1ec318e693e699a808eb9ad247 Reviewed-on: https://skia-review.googlesource.com/136638 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Expand ExclusiveStrikePtr with StrikeCacheGravatar Herb Derby2018-06-21
| | | | | | | | | | | | Add an SkStrikeCache to ExclusiveStrikePtr to allow it to return a glyph cache to one of multiple strike caches. BUG=skia:8091 Change-Id: I5440a6451838e08f21677eb5d5b4ade6c6b75ca0 Reviewed-on: https://skia-review.googlesource.com/136617 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Allow access to global glyph cacheGravatar Herb Derby2018-06-21
| | | | | | | | | | | | | The global glyph cache pointer is closed over in SkStrikeCache.cpp. Allow access to it for future code to move away from the global glyph cache. BUG=skia:8091 Change-Id: I6e1fb712c082452e6a3b54f5fb5e6167caf9e757 Reviewed-on: https://skia-review.googlesource.com/136613 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Revert "Make SkRemoteGlyphCache tests use private glyph cache"Gravatar Herb Derby2018-06-21
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3e36ce6e660ad585c58c5cc5591f23a46fcab767. Reason for revert: Too much verification Original change's description: > Make SkRemoteGlyphCache tests use private glyph cache > > Change-Id: If6aa189f3badc7558ab8ecf71ee3d704b275b20f > Reviewed-on: https://skia-review.googlesource.com/136225 > Commit-Queue: Herb Derby <herb@google.com> > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,herb@google.com Change-Id: Ia0c096abd0ab651bc7c907f0595af4f07c88fb5e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/136478 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Make SkRemoteGlyphCache tests use private glyph cacheGravatar Herb Derby2018-06-20
| | | | | | | Change-Id: If6aa189f3badc7558ab8ecf71ee3d704b275b20f Reviewed-on: https://skia-review.googlesource.com/136225 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* fonts: Fix memory allocation for fallback glyphs.Gravatar Khushal2018-06-12
| | | | | | | | | | | | | | | | When allocating the mask for a fallback glyph, we allocate it on the arena on the SkScalerContext while the image belongs to a glyph on a different cache. This can lead to use-after-free bugs if accessing the image after the context owning that memory is destroyed. Fix this by allocating on the arena from the owning cache. R=herb@google.com, mtklein@google.com Bug: 829622 Change-Id: Ife53e24f5bc868f36c43f2adcd7a2629ab5577fe Reviewed-on: https://skia-review.googlesource.com/134182 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Glyph search of desperationGravatar Herb Derby2018-06-08
| | | | | | | Change-Id: I0ae768c5517c3ee3f6822fea0926b3f27214a0e4 Reviewed-on: https://skia-review.googlesource.com/132260 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* fonts: Fix memory accounting for deserialized glyphs.Gravatar Khushal2018-05-15
| | | | | | | | | | | | | | | 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>
* fonts: Reland push font remoting.Gravatar Khushal2018-05-02
| | | | | | | | | | | | | | | | | | | 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>
* Revert "fonts: Set up remote glyph caching to push fonts."Gravatar Mike Klein2018-05-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 101d56359a5a5dc3b8a2a4149ac171e25eb0bec0. 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>
* fonts: Set up remote glyph caching to push fonts.Gravatar Khushal2018-05-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Track tail of strike cacheGravatar Herb Derby2018-04-26
| | | | | | | | | Change-Id: Ic5d5ae5d4c45d0bc5b82dd2257752184a8b529d0 Reviewed-on: https://skia-review.googlesource.com/123935 Commit-Queue: Herb Derby <herb@google.com> Commit-Queue: Ben Wagner <bungeman@google.com> Auto-Submit: Herb Derby <herb@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Generalize to SkDescriptorMapGravatar Herb Derby2018-04-23
| | | | | | | Change-Id: I4e7ff8093dbbe24cd5de4d4ea478716514d519f2 Reviewed-on: https://skia-review.googlesource.com/123041 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Adding pinning to the strike cacheGravatar Herb Derby2018-04-19
| | | | | | | | | | | | Here is a simple API for the object that pins, and how it flows through the cache. BUG=skia:7515 Change-Id: I1b8304dc6f9d8652282300fc1e52d52debb5b6f4 Reviewed-on: https://skia-review.googlesource.com/122500 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
* Untangle strike cache and glyph cacheGravatar Herb Derby2018-04-19
| | | | | | | | | | | | The strike cache and the glpyh cache have been friends for a long time. Untangle this twisted relationship. BUG=skia:7515 Change-Id: Ie77393f6923e9886ec90ff7a60a1200e78319937 Reviewed-on: https://skia-review.googlesource.com/122084 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Move strike cache Find*() to strike cacheGravatar Herb Derby2018-04-18
| | | | | | | | | BUG=skia:7515 Change-Id: Ic1580d4752d51a62df5427a28f843bc7b3181797 Reviewed-on: https://skia-review.googlesource.com/122020 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Simplify strike cache NodeGravatar Herb Derby2018-04-18
| | | | | | | | Change-Id: Ia7d65d84ad0ebe2a62fbd98629c7c37273a6167a Reviewed-on: https://skia-review.googlesource.com/121980 Auto-Submit: Herb Derby <herb@google.com> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Move node information to SkStrikeCacheGravatar Herb Derby2018-04-17
| | | | | | | | | | | | | | Move all the information for handling nodes into SkStrikeCache. Having all the cache organization in SkStrikeCache will localize all the Chrome pinning machinery to this class. BUG=skia:7515 Change-Id: I5bc5488ddfe1806d62927d13148af36dac08eae9 Reviewed-on: https://skia-review.googlesource.com/121888 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Reorganize strike cache and glyph cache codeGravatar Herbert Derby2018-04-17
| | | | | | | | | BUG=skia:7515 Change-Id: I05867890e88de7a7d23b60d9eec989d93d39d333 Reviewed-on: https://skia-review.googlesource.com/121783 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Rename SkGlyphCacheGlobals to SkStrikeCacheGravatar Herb Derby2018-04-16
Change-Id: I7773c1fff309bf9416f16fe9908191eeba94eb99 Reviewed-on: https://skia-review.googlesource.com/121356 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>