aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRemoteGlyphCache.h
Commit message (Collapse)AuthorAge
* 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>
* fonts: Perform blob analysis at SkBaseDevice layer instead of canvas.Gravatar Khushal2018-06-08
| | | | | | | | | | | | | | | | | Currently we use the onDrawTextBlob hook to analyze the text blob, which requires replicating the logic for applying the SkDrawLooper and misses the optimization for skipping ops outside the current clip. Avoid this by using SkBaseDevice::drawTextBlob instead to ensure we re-use all the SkCanvas code until the device level. R=herb@google.com Bug: 829622 Change-Id: I2721c02541d337e2fb3744132e85758f7c804841 Reviewed-on: https://skia-review.googlesource.com/133101 Commit-Queue: Khusal Sagar <khushalsagar@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* fonts: Hook up FallbackTextHelper to font remoting.Gravatar Khushal2018-06-07
| | | | | | | | | | | | | | | | Use GrContext::FallbackTextHelper in SkTextBlobCacheDiffCanvas to replicate glyph generation logic for fallback text during analysis. This ensures that we correctly handle these fallback cases when using distance field or paths for text rendering. R=herb@google.com, jvanverth@google.com Bug: skia:7913 Change-Id: I3067c4f1bd09231a564ac7c4cd89efcb876d2abd Reviewed-on: https://skia-review.googlesource.com/132285 Reviewed-by: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
* Turn off logging for testsGravatar Herb Derby2018-06-04
| | | | | | | Change-Id: I00bb3059bb92b5c11178022aff8a87918bb3781e Reviewed-on: https://skia-review.googlesource.com/131640 Reviewed-by: Khushal Sagar <khushalsagar@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Reland fonts: Use correct SurfaceProps in analysis canvas for remoting.Gravatar Khushal2018-05-31
| | | | | | | | | | | This reverts commit cd21d676b782cf27a9ded17a69c0393e4d3e34cc. TBR=herb@google.com Bug: 829622 Change-Id: I515fdf67fde118db774ab170e021100eef13ce68 Reviewed-on: https://skia-review.googlesource.com/130701 Commit-Queue: Khusal Sagar <khushalsagar@chromium.org> Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
* Revert "fonts: Use correct SurfaceProps in analysis canvas for remoting."Gravatar Ravi Mistry2018-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4f078f7cfac6580dce6e213c022708922739ac6d. Reason for revert: Seems to have caused these breakages: * https://chromium-swarm.appspot.com/task?id=3dc6788dc7b77010&refresh=10 * https://chromium-swarm.appspot.com/task?id=3dc67452db797c10&refresh=10 Original change's description: > fonts: Use correct SurfaceProps in analysis canvas for remoting. > > SaveLayer may not preserve the behaviour for lcd text, in which case > the surfaceProps used for desc generation are inconsistent. > > R=​herb@google.com > > Bug: 829622 > Change-Id: I3adfc6780f26e4eb333a8aff76eaa4b5a9f0a0a7 > Reviewed-on: https://skia-review.googlesource.com/129557 > Reviewed-by: Herb Derby <herb@google.com> > Commit-Queue: Khusal Sagar <khushalsagar@chromium.org> TBR=herb@google.com,khushalsagar@chromium.org Change-Id: I0372a3d834f8c4c929feb71c2b6b13739443eaaa No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 829622 Reviewed-on: https://skia-review.googlesource.com/130680 Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Ravi Mistry <rmistry@google.com>
* fonts: Use correct SurfaceProps in analysis canvas for remoting.Gravatar Khushal2018-05-29
| | | | | | | | | | | | | SaveLayer may not preserve the behaviour for lcd text, in which case the surfaceProps used for desc generation are inconsistent. R=herb@google.com Bug: 829622 Change-Id: I3adfc6780f26e4eb333a8aff76eaa4b5a9f0a0a7 Reviewed-on: https://skia-review.googlesource.com/129557 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
* Reland fonts: Cleanup cache miss logging for font remoting.Gravatar Khushal2018-05-24
| | | | | | | | | | | This reverts commit fc6cf92e4b21c92ead769fae557534056eac6d83. TBR=herb@google.com Bug: skia:7913 Change-Id: I93301e49839fdb895a5f1f5845bb9975981c69fc Reviewed-on: https://skia-review.googlesource.com/129880 Reviewed-by: Khusal Sagar <khushalsagar@chromium.org> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
* Reland fonts: Add support for distance field text to font remoting.Gravatar Khushal2018-05-24
| | | | | | | | | | | This reverts commit 7257e22e43a56a5f4f772b687034580061cd011f. TBR=herb@google.com, bsalomon@google.com Bug: skia:7913 Change-Id: I51ca5bccdda64cd98e2ad59874e7136ee58cec10 Reviewed-on: https://skia-review.googlesource.com/129809 Reviewed-by: Khusal Sagar <khushalsagar@chromium.org> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
* Revert "fonts: Add support for distance field text to font remoting."Gravatar Mike Klein2018-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 35e0a1a6908492c754156d1abb785da3a9ce2a6b. Reason for revert: looks like we're leaking paths? https://chromium-swarm.appspot.com/task?id=3da25e2f0cadb210&refresh=10 Original change's description: > 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> TBR=jvanverth@google.com,bsalomon@google.com,bungeman@google.com,herb@google.com,khushalsagar@chromium.org Change-Id: I37c54c8748db9b20e1f48016d8298808a1999fdb No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7913 Reviewed-on: https://skia-review.googlesource.com/129681 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Revert "fonts: Cleanup cache miss logging for font remoting."Gravatar Mike Klein2018-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2b8a0d1844ed236259284fbc2efe08dab0ed539f. Reason for revert: reverting a CL this builds on Original change's description: > 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> TBR=herb@google.com,khushalsagar@chromium.org Change-Id: I8a331545988885c620685008f4b60240d80f3712 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 829622 Reviewed-on: https://skia-review.googlesource.com/129682 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* fonts: Cleanup cache miss logging for font remoting.Gravatar Khushal2018-05-22
| | | | | | | | | | | | | | 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>
* fonts: Add support for distance field text to font remoting.Gravatar Khushal2018-05-22
| | | | | | | | | | | 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>
* fonts: Handle fallback to using paths for text rendering for remoting.Gravatar Khushal2018-05-17
| | | | | | | | | | | | | | | | | | 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>
* Fix compiler warning for MSVCGravatar Herb Derby2018-05-16
| | | | | | | | | BUG=skia:7954 Change-Id: I2b100f723a88a57aaa4de08860f40ab73b9b674f Reviewed-on: https://skia-review.googlesource.com/128580 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: 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>
* fonts: Cleanup header guard and stray printfs.Gravatar Khushal2018-05-03
| | | | | | | | | | 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>
* 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>
* 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>
* 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 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>
* 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>
* 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>