aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRemoteGlyphCache.cpp
Commit message (Collapse)AuthorAge
* fonts: Fix a trace name in SkRemoteGlyphCacheGravatar Khushal2018-05-09
| | | | | | | | | TBR=herb@google.com Change-Id: I5df4295a94d9af93e29ebf64b06f5259dc54ce90 Reviewed-on: https://skia-review.googlesource.com/126842 Reviewed-by: Khusal Sagar <khushalsagar@chromium.org> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
* fonts: Fix subpixel position mismatch in font remotingGravatar Khushal2018-05-08
| | | | | | | | | | R=herb@google.com Bug: skia:7786 Change-Id: Icb52be92d193eb17ac20734bfa7cb00370c6ea21 Reviewed-on: https://skia-review.googlesource.com/126664 Commit-Queue: Khusal Sagar <khushalsagar@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Use device and key descriptorsGravatar Herb Derby2018-05-08
| | | | | | | Change-Id: I2ac13303376f3d1464dd1e259637374a9c5ef237 Reviewed-on: https://skia-review.googlesource.com/125823 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Khushal Sagar <khushalsagar@google.com>
* Add move to quiet warningGravatar Herb Derby2018-05-03
| | | | | | | | | | Change-Id: I8d3200d42430901fa493b87c1e7275106f3abd32 Reviewed-on: https://skia-review.googlesource.com/125742 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Auto-Submit: Herb Derby <herb@google.com>
* 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>
* Take sk_sp<SkDevice> instead of SkDevice*Gravatar Herb Derby2018-05-02
| | | | | | | | | Change-Id: I0b296bf5b80adc19758a3dc99160be9d2ed05680 Reviewed-on: https://skia-review.googlesource.com/125160 Commit-Queue: Herb Derby <herb@google.com> Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com> Auto-Submit: Herb Derby <herb@google.com>
* 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>
* Revert "fonts: Dont memcpy with nullptr in SkRemoteGlyphCache"Gravatar Mike Klein2018-05-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7e7369f7131d0b00f87cfb94e0fcbf91b02b4ee6. Reason for revert: 3 of 5 Original change's description: > fonts: Dont memcpy with nullptr in SkRemoteGlyphCache > > The behaviour is undefined and causes ASAN bots to complain. > > Bug: skia:7515 > Change-Id: I454714ab9047a6fced5ab7bfdbc12214d728eadf > Reviewed-on: https://skia-review.googlesource.com/125029 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Khusal Sagar <khushalsagar@chromium.org> TBR=herb@google.com,brianosman@google.com,khushalsagar@chromium.org Change-Id: I6548019d7bf34b38f964234034e58af09d0b8508 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7515 Reviewed-on: https://skia-review.googlesource.com/125262 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Revert "fonts: Bandaid fix for desc mismatch in SkRemoteGlyphCache."Gravatar Mike Klein2018-05-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ef4142a9bc5fb5fe3158139e18f41e7da867ff93. 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>
* fonts: Bandaid fix for desc mismatch in SkRemoteGlyphCache.Gravatar Khushal2018-05-01
| | | | | | | | | | | | | 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>
* fonts: Dont memcpy with nullptr in SkRemoteGlyphCacheGravatar Khushal2018-05-01
| | | | | | | | | | The behaviour is undefined and causes ASAN bots to complain. Bug: skia:7515 Change-Id: I454714ab9047a6fced5ab7bfdbc12214d728eadf Reviewed-on: https://skia-review.googlesource.com/125029 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
* 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>
* 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>
* 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>
* SkStrikeDifferences::operator() -> add()Gravatar Mike Klein2018-04-17
| | | | | | | | | | Am I crazy or is this use of operator() rather unclear? Change-Id: If388047f8a02be90f30e54452c75ebfec8b57a37 Reviewed-on: https://skia-review.googlesource.com/121880 Auto-Submit: Mike Klein <mtklein@chromium.org> Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Herb Derby <herb@google.com>
* Remove SkPaint::kGenA8FromLCD_Flag.Gravatar Ben Wagner2018-04-16
| | | | | | | | | | | | | The original intent of this flag is now handled by SkPixelGeomety on SkSurfaceProps on SkSurface. BUG=skia:7515 Change-Id: I54bb1be072b5b5b2164a59196bfeacac254823c7 Reviewed-on: https://skia-review.googlesource.com/121346 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Remove all notion of transport from the API - V2.Gravatar Herb Derby2018-04-16
| | | | | | | | | | | | There is only a need to pass buffers in and out of the system. All transport is external to the system. BUG=skia:7515 Change-Id: Ie50cbc3fa1b9776e56dab8e49e91ce640e0b3954 Reviewed-on: https://skia-review.googlesource.com/119893 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Revert "Remove all notion of transport from the API."Gravatar Herb Derby2018-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4961a938586e3c46cf80f15ecb70a011324bfe59. Reason for revert: Breaks MSVC Original change's description: > Remove all notion of transport from the API. > > There is only a need to pass buffers in and out of the system. > All transport is external to the system. > > Change-Id: I26dfc8e0b4cce9969395c96d5230078e7dca3f3d > Reviewed-on: https://skia-review.googlesource.com/119062 > Commit-Queue: Herb Derby <herb@google.com> > Reviewed-by: Khushal Sagar <khushalsagar@google.com> TBR=herb@google.com,reed@google.com,khushalsagar@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: I62cbac1be4483702ba7464822d93fb9f818f88b7 Reviewed-on: https://skia-review.googlesource.com/119580 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Better layer tracking fidelityGravatar Herb Derby2018-04-06
| | | | | | | | | | | | | | Track layer processing more faithfully. This temporary until we can remove the old system for dissabling the unneeded system for falling back to A8 format. BUG=skia:7786 Change-Id: Iee9154f4209c4020f16b04edd03e42c6b7d0ec98 Reviewed-on: https://skia-review.googlesource.com/119104 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Remove all notion of transport from the API.Gravatar Herb Derby2018-04-06
| | | | | | | | | | There is only a need to pass buffers in and out of the system. All transport is external to the system. Change-Id: I26dfc8e0b4cce9969395c96d5230078e7dca3f3d Reviewed-on: https://skia-review.googlesource.com/119062 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Khushal Sagar <khushalsagar@google.com>
* Distinguish between glyphs with empty path and no path.Gravatar Ben Wagner2018-04-05
| | | | | | | | | BUG=skia:4904 Change-Id: I065e3b4d8596b415ddaf094d7f9a4b65da64d4d4 Reviewed-on: https://skia-review.googlesource.com/117280 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Herb Derby <herb@google.com>
* Clean up buffering and serializatoin.Gravatar Herb Derby2018-04-04
| | | | | | | | | BUG=skia:7515 Change-Id: Id580e8f464c6263fa32a5d6347f505b00bba29d7 Reviewed-on: https://skia-review.googlesource.com/118460 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Cleanup Ops - remove extra bytes sent and receivedGravatar Herb Derby2018-04-02
| | | | | | | | | BUG=skia:7515 Change-Id: I0a1da98cbf20e39fec9f318e7aa9e253bd3878b4 Reviewed-on: https://skia-review.googlesource.com/117864 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Various cleanup to remote_demoGravatar Herb Derby2018-03-27
| | | | | | | | | | | | | Integrate SkRemoteGlyphCacheRenderer into SkStrikeServer Add a Timer. Remove unused code. BUG=skia:7515 Change-Id: Idffb477af71cbcc4035df190e29e8910b61aa6e5 Reviewed-on: https://skia-review.googlesource.com/116485 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Move cache difference code into remote cache filesGravatar Herb Derby2018-03-26
| | | | | | | | | BUG=skia:7515 Change-Id: I59e75d460b4ed4d0a737c833520b2335808a4ce4 Reviewed-on: https://skia-review.googlesource.com/115706 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Try to have glyph count go through to allow easier glyphid setsGravatar Herb Derby2018-03-21
| | | | | | | Change-Id: I402e7240629db58c4212049583d6a06bcf7dcc40 Reviewed-on: https://skia-review.googlesource.com/115606 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Add glyph cache warming - prototypeGravatar Herb Derby2018-03-14
| | | | | | | | | | | | | | | | | A system for prewarming the cache using a single "RPC" This improve performance by ~5X. This is a checkin of rough code so I can use small changes clean it up. BUG=skia:7515 Change-Id: Id0192b4f533c257b0a7eea0170b1e25c336d6432 Reviewed-on: https://skia-review.googlesource.com/105440 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Generate cache traffic each iterationGravatar Herb Derby2018-02-05
| | | | | | | | | | | | | | | The old timing system would generate cache traffic for the first drawing of the picture caching everyting on the GPU side. Further iterations would just use the cache. This change forces cache traffic to be generated each iteration. BUG=skia:7515 Change-Id: I0d857e123796cdc7d655634446082598bef3f962 Reviewed-on: https://skia-review.googlesource.com/103021 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
* Consolidate all the id handling and caching code.Gravatar Herb Derby2018-02-01
BUG=skia:7515 Change-Id: Iab31e8cadfaa1ce09d85aab9cc84a3e614ea5e45 Reviewed-on: https://skia-review.googlesource.com/100420 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Herb Derby <herb@google.com>