aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRemoteGlyphCache.cpp
Commit message (Collapse)AuthorAge
* Hide SkTextBlob::GlyphPositioning from public APIGravatar Florin Malita2018-07-27
| | | | | | | | | | | | | Make private, add corresponding SkTextBlobRunIterator enum. Also move SkTextBlobRunIterator to SkTextBlobPriv.h. Change-Id: If3e0beabb0e8484b1ac73c6fc0827e920ca1f93b Reviewed-on: https://skia-review.googlesource.com/142501 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* const all the thingsGravatar Herb Derby2018-07-27
| | | | | | | | | | | Having the glyph run list be const as it passes through the stack means that future change can't be introduced in the device code that changes behavior. Try to force all text changes into the SkGylphRun system. Change-Id: I9412bc094c7adb8554887c725a6264af306e1d42 Reviewed-on: https://skia-review.googlesource.com/143702 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* fonts: Don't recompute device descs on glyph cache hit.Gravatar Khushal2018-07-25
| | | | | | | | | | | | | | | Testing using serialization PaintOpPerfTest, this had the following improvement in serialization speed: Before: ~515,000 ops/s After: ~600,000 ops/s R=herb@google.com Change-Id: Iefd80467ea4ff7cc88e8ca1f431883502d249857 Reviewed-on: https://skia-review.googlesource.com/142972 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
* Convert remote glyph cache to use glyp runsGravatar Herb Derby2018-07-20
| | | | | | | Change-Id: I763a3570ff6b970cfcbf172d786370c77a0db0d7 Reviewed-on: https://skia-review.googlesource.com/142507 Reviewed-by: Khusal Sagar <khushalsagar@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
* Device interface uses glyph run listGravatar Herb Derby2018-07-16
| | | | | | | | | | | | | Have devices just treat all runs as drawPosText except for SkGPUDevice and SkRemoteGlyphCache. Those two just pass the blob to the old code. This way the change over from blobs to run lists can happen in smaller steps. Change-Id: I3407bffeafe7fbd1c369f6b3c3db8d64b4b6c3b1 Reviewed-on: https://skia-review.googlesource.com/141300 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Remove SkDrawFilter.Gravatar Ben Wagner2018-07-12
| | | | | | | | | Change-Id: I0204a9522e828c87bb7c6c20ae34ce51161442af Reviewed-on: https://skia-review.googlesource.com/137895 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Revert "Remove drawTextBlob from device use drawGlyphRunList"Gravatar Robert Phillips2018-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e2e52e46ca63540d429656baeee48fd3a402be26. Reason for revert: See if this is blocking the Chrome roll Original change's description: > Remove drawTextBlob from device use drawGlyphRunList > > Convert all backends to use GlyphRunList instead of > text blobs. If the device did not originally implement > drawTextBlob it will be simulated by drawPosText on the > device. > > Other changes: > Change to using an origin from absolulte positioning. The GPU > code uses origin change to update blobs under translation. > > Change cluster to use const uint32_t instead of just > uint32_t. > > Add SkPaint to runs. > > The draw filter is hosted up to the canavas level and applied there. > > Change-Id: Ib105b6bd26b67db55f1c954e37c79fbdcaa9d4a2 > Reviewed-on: https://skia-review.googlesource.com/137224 > Reviewed-by: Herb Derby <herb@google.com> > Reviewed-by: Khusal Sagar <khushalsagar@chromium.org> > Reviewed-by: Hal Canary <halcanary@google.com> > Reviewed-by: Jim Van Verth <jvanverth@google.com> > Commit-Queue: Herb Derby <herb@google.com> TBR=jvanverth@google.com,halcanary@google.com,bungeman@google.com,herb@google.com,reed@google.com,khushalsagar@chromium.org,khushalsagar@google.com Change-Id: I4d93a534990c89deee7d3aaa00ec40d47e0d2ece No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/138120 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Remove drawTextBlob from device use drawGlyphRunListGravatar Herb Derby2018-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | | Convert all backends to use GlyphRunList instead of text blobs. If the device did not originally implement drawTextBlob it will be simulated by drawPosText on the device. Other changes: Change to using an origin from absolulte positioning. The GPU code uses origin change to update blobs under translation. Change cluster to use const uint32_t instead of just uint32_t. Add SkPaint to runs. The draw filter is hosted up to the canavas level and applied there. Change-Id: Ib105b6bd26b67db55f1c954e37c79fbdcaa9d4a2 Reviewed-on: https://skia-review.googlesource.com/137224 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Khusal Sagar <khushalsagar@chromium.org> Reviewed-by: Hal Canary <halcanary@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Herb Derby <herb@google.com>
* 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>
* 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: Ignore re-initialization of fallback glyphs from the server.Gravatar Khushal2018-06-13
| | | | | | | | | | | | | | If the client finds that the server re-initializes a cached path/image, we consider this an error and invalid data. But since we might initialize a glyph using a fallback on the client, and receive the correct version from the server later, this is not longer true. Bug: 829622 Change-Id: I34ab17b54139d89a15179265d4aed4a1fe36fd47 Reviewed-on: https://skia-review.googlesource.com/133566 Commit-Queue: Khusal Sagar <khushalsagar@chromium.org> Commit-Queue: Mike Klein <mtklein@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>
* trim #include <new> from SkPostConfig.hGravatar Mike Klein2018-06-11
| | | | | | | Change-Id: I693ddcd4ade101ba4eb4102e03adce183aa1d672 Reviewed-on: https://skia-review.googlesource.com/133829 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* 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>
* font remoting: Fix errors with sub-pixel positioning mismatch.Gravatar Khushal2018-05-31
| | | | | | | | | | | | | | | | | 1) Use correct offset from SkTextBlobRunIterator. Only kHorizontal_Positioning needs to use the y offset specified on the run. 2) Use the same mapping function from SkFindAndPlaceGlyph for mapping the glyph position from transform for the run. This avoids minor rounding differences between analysis and draw. R=bungeman@google.com,herb@google.com Bug:829622 Change-Id: Iaef74a8d01f0850ce042149458b2ea795c2a2b61 Reviewed-on: https://skia-review.googlesource.com/131169 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
* fonts: Fix image cache miss from glyphs too large for atlas.Gravatar Khushal2018-05-31
| | | | | | | | | | R=herb@google.com Bug: 829622 Change-Id: I17994663318c8db3537e99ef11aaee7beb2da23f Reviewed-on: https://skia-review.googlesource.com/131056 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: 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>
* Rename GrAtlasTextContext -> GrTextContextGravatar Herb Derby2018-05-24
| | | | | | | | Change-Id: I309b39425afc9b45095241eeb299096bc426afed Reviewed-on: https://skia-review.googlesource.com/130029 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Herb Derby <herb@google.com>
* 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>
* fonts: Use empty glyphs on cache miss.Gravatar Khushal2018-05-17
| | | | | | | | | | | | | | In case of a cache miss, we end up using a glyph with garbage memory which can result in arbitrary memory allocations for generating images for these glyphs. Use empty glyphs instead. R=herb@google.com Bug: skia:7913 Change-Id: Ie81b006a6872e077f9fd37e0a5751750c66f9ecb Reviewed-on: https://skia-review.googlesource.com/128701 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
* 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: 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>