aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSoftwarePathRenderer.cpp
Commit message (Collapse)AuthorAge
* Correctly distinguish hairline paths in the SW path renderer's cacheGravatar Brian Osman2018-07-26
| | | | | | | | | | | | | | | We typically don't get hairline paths in the SW path renderer, but an upcoming change (https://skia-review.googlesource.com/c/skia/+/142272) makes it possible. Therefore, we need to distinguish between hairline and filled paths. Additionally, the CPU renderer draws hairline paths differently with round/square caps (extended by 1/2 pixel) than with butt caps, so include that in the key, too. Bug: skia:8188 Change-Id: I223c11f62ef1c13f0488f2ca8c19a19875fc3d9f Reviewed-on: https://skia-review.googlesource.com/143540 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Reland "Make GPU cache invalidation SkMessageBus messages go to one GrContext."Gravatar Brian Salomon2018-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of f4c5bb9aba485aa47c27b15905d81992b7cf4707 Original change's description: > Make GPU cache invalidation SkMessageBus messages go to one GrContext. > > Makes it so the template param to SkMessageBus must implement: > bool shouldSend(uint32_t inboxID) const > > Updates all GPU backend message types to only go to the GrContext that > is adding a cache entry. > > Bug: skia: > Change-Id: I3e8a4eb90654b7b8ac57cac9fb508c0ef1d51058 > Reviewed-on: https://skia-review.googlesource.com/140220 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Reviewed-by: Jim Van Verth <jvanverth@google.com> Bug: skia: Change-Id: I8402bfe3ed0170c99936d47050458817030b473b Reviewed-on: https://skia-review.googlesource.com/140801 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Make GPU cache invalidation SkMessageBus messages go to one GrContext."Gravatar Brian Salomon2018-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f4c5bb9aba485aa47c27b15905d81992b7cf4707. Reason for revert: Accidentally submitted without CQ Original change's description: > Make GPU cache invalidation SkMessageBus messages go to one GrContext. > > Makes it so the template param to SkMessageBus must implement: > bool shouldSend(uint32_t inboxID) const > > Updates all GPU backend message types to only go to the GrContext that > is adding a cache entry. > > Bug: skia: > Change-Id: I3e8a4eb90654b7b8ac57cac9fb508c0ef1d51058 > Reviewed-on: https://skia-review.googlesource.com/140220 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Reviewed-by: Jim Van Verth <jvanverth@google.com> TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: Iadb667d8027341703d254325320ddaa528fb33a1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/140800 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Make GPU cache invalidation SkMessageBus messages go to one GrContext.Gravatar Brian Salomon2018-07-11
| | | | | | | | | | | | | | Makes it so the template param to SkMessageBus must implement: bool shouldSend(uint32_t inboxID) const Updates all GPU backend message types to only go to the GrContext that is adding a cache entry. Bug: skia: Change-Id: I3e8a4eb90654b7b8ac57cac9fb508c0ef1d51058 Reviewed-on: https://skia-review.googlesource.com/140220 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Deinline some GrPathRenderer method and one GrDrawingMananger method.Gravatar Brian Salomon2018-07-10
| | | | | | | | | | | | | | Removes circular dependencies from coming change. Some IWYU fallout from removing #includes from GrPathRenderer.h and GrDrawingManager.h Bug: skia: Change-Id: Ice377538e6d64b6a74a59e6140e1de9a58ab99bf Reviewed-on: https://skia-review.googlesource.com/140181 Commit-Queue: Brian Salomon <bsalomon@google.com> Auto-Submit: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Plumb GrContext everywhereGravatar Robert Phillips2018-06-12
| | | | | | | | | | There is no good way to split the monster CL up. This breaks out the GrContext plumbing but doesn't use it. Change-Id: I90856d428d372bcec3f8821e6364667b367927d4 Reviewed-on: https://skia-review.googlesource.com/133382 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Make the SkPathRef GenIDChangeListener ref countedGravatar Chris Dalton2018-06-08
| | | | | | | | Bug: skia: Change-Id: I2780e3fc76153373b4efca6059ded82f4f749325 Reviewed-on: https://skia-review.googlesource.com/133502 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Dump additional details about the gpu resources.Gravatar Derek Sollenberger2018-03-29
| | | | | | | | | | | | | | | | | GpuResources now dump optional string values that describe the type and category of the resource. The type provides a description of the kind of resource it is (e.g. texture, buffer object, stencil, etc.) and the category describes what the resource is currently tasked to do (e.g. path masks, images, scratch, etc.) This CL also refactors the dump logic in an attempt to consolidate duplicated code into GrGpuResources.cpp. Bug: b/74435803 Change-Id: I83cae825f41e6450a21398ab3ecea349c7c61c15 Reviewed-on: https://skia-review.googlesource.com/115989 Commit-Queue: Derek Sollenberger <djsollen@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Alter GrSurface/GrSurfaceProxy flags to prepare for GrTexture/GrTextureProxy ↵Gravatar Robert Phillips2018-03-19
| | | | | | | | | | | | | | | | -specific flags This CL: moves GrRenderTarget::fFlags to GrSurface::fSurfaceFlags adds a GrInternalSurfaceFlags type and uses it for GrSurfaceProxy::fSurfaceFlags The goal of this is to provide a location where GrTexture/GrTextureProxy-specific flags (i.e., isExternal & isRectangle) can be stored. Change-Id: I8df7b79036a6853dd378ff6cf10d4b37c60dd511 Reviewed-on: https://skia-review.googlesource.com/114796 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Remove GrSurfaceOrigin from GrSurfaceDesc.Gravatar Brian Salomon2018-03-05
| | | | | | | | | | | | This field has no interpretation at the GrTexture/GrGpu as the orientation is handled at the GrSurfaceProxy level. This change requires GrGpu to accept a GrSurfaceOrigin when creating a texture with initial data. The origin refers to the texel data to be uploaded. Longer term the plan is to remove this and require the data to be kTopLeft. Additionally, kBottomLeft will only be allowed for wrapped texture/RTs as this evolves. Change-Id: I7d25b0199aafd9bf3b74c39b2cae451acadcd772 Reviewed-on: https://skia-review.googlesource.com/111806 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Funnel most proxy creation through GrProxyProviderGravatar Robert Phillips2018-01-16
| | | | | | | | | This is to provide a choke point for DDL to create Lazy Proxies. Change-Id: If178da13bc6447b31b7601810236d34502d9efbd Reviewed-on: https://skia-review.googlesource.com/93303 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Add GrProxyProviderGravatar Robert Phillips2018-01-08
| | | | | | | | | This pulls all the proxy tracking & creation functionality out of the GrResourceCache and GrResourceProvider and consolidates it in the GrProxyProvider. Change-Id: I7256f7c544319a70c1bd93dd5a9ccbe5fa0a544f Reviewed-on: https://skia-review.googlesource.com/91501 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Revert "Revert "Fix int overflow issues with clip and path bounds, take 2.""Gravatar Jim Van Verth2017-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e3a700522f6e088be00011bc98fcdc4a13bd798b. Reason for revert: The GM changes I saw appear to be due to a new bot. Original change's description: > Revert "Fix int overflow issues with clip and path bounds, take 2." > > This reverts commit 430ad1f2065c182746e43e67ca95fb911cc55892. > > Reason for revert: Many bad GMs. > > Original change's description: > > Fix int overflow issues with clip and path bounds, take 2. > > > > * Change IsInsideClip test to be more int overflow friendly > > * Check to make sure path bounds can have representable width and height > > > > Bug: skia:7239 > > Bug: skia:7240 > > Change-Id: If8468e46bc74a428c25d466ff3756d0cad385c09 > > Reviewed-on: https://skia-review.googlesource.com/66154 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Commit-Queue: Jim Van Verth <jvanverth@google.com> > > TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com > > Change-Id: I5b1a651b60340bb4230893ef5f5d2df2ce6fd241 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:7239, skia:7240 > Reviewed-on: https://skia-review.googlesource.com/67240 > Reviewed-by: Jim Van Verth <jvanverth@google.com> > Commit-Queue: Jim Van Verth <jvanverth@google.com> TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I710ebeec30a4d7eb5fe7dd3a168df28073733cab No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7239, skia:7240 Reviewed-on: https://skia-review.googlesource.com/66862 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Revert "Fix int overflow issues with clip and path bounds, take 2."Gravatar Jim Van Verth2017-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 430ad1f2065c182746e43e67ca95fb911cc55892. Reason for revert: Many bad GMs. Original change's description: > Fix int overflow issues with clip and path bounds, take 2. > > * Change IsInsideClip test to be more int overflow friendly > * Check to make sure path bounds can have representable width and height > > Bug: skia:7239 > Bug: skia:7240 > Change-Id: If8468e46bc74a428c25d466ff3756d0cad385c09 > Reviewed-on: https://skia-review.googlesource.com/66154 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Jim Van Verth <jvanverth@google.com> TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I5b1a651b60340bb4230893ef5f5d2df2ce6fd241 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7239, skia:7240 Reviewed-on: https://skia-review.googlesource.com/67240 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Fix int overflow issues with clip and path bounds, take 2.Gravatar Jim Van Verth2017-11-02
| | | | | | | | | | | | * Change IsInsideClip test to be more int overflow friendly * Check to make sure path bounds can have representable width and height Bug: skia:7239 Bug: skia:7240 Change-Id: If8468e46bc74a428c25d466ff3756d0cad385c09 Reviewed-on: https://skia-review.googlesource.com/66154 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Revert "Fix int overflow issues with clip and path bounds."Gravatar Mike Klein2017-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b1fc36829de69da5376019403fdd649c06f4cf1b. Reason for revert: I hate to revert this, but I think it's caused some layout test diffs that are holding up the roll. https://storage.googleapis.com/chromium-layout-test-archives/linux_trusty_blink_rel/17909/layout-test-results/results.html Original change's description: > Fix int overflow issues with clip and path bounds. > > * Clamp scissor clip bounds to query bounds (which are RT bounds) > * Change IsInsideClip test to be more int overflow friendly > * Check to make sure path bounds can have representable width and height > > Bug: skia:7239 > Bug: skia:7240 > Change-Id: I4c512d05c5609a5a466393408282101697ebea83 > Reviewed-on: https://skia-review.googlesource.com/65506 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Jim Van Verth <jvanverth@google.com> TBR=jvanverth@google.com,bsalomon@google.com,csmartdalton@google.com Change-Id: Ic5c15219cdbe92811284130bce1e984823f0c4d1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7239, skia:7240 Reviewed-on: https://skia-review.googlesource.com/65920 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Fix int overflow issues with clip and path bounds.Gravatar Jim Van Verth2017-10-31
| | | | | | | | | | | | | * Clamp scissor clip bounds to query bounds (which are RT bounds) * Change IsInsideClip test to be more int overflow friendly * Check to make sure path bounds can have representable width and height Bug: skia:7239 Bug: skia:7240 Change-Id: I4c512d05c5609a5a466393408282101697ebea83 Reviewed-on: https://skia-review.googlesource.com/65506 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Remove color space xform from GrTextureDomain & GrSimpleTextureEffectGravatar Brian Osman2017-10-18
| | | | | | | | Bug: skia: Change-Id: I31435d334da28cce9bbc654c4b98746b03078897 Reviewed-on: https://skia-review.googlesource.com/61460 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Add MDB comments to recent kNoPendingIO changesGravatar Brian Osman2017-10-03
| | | | | | | | Bug: skia: Change-Id: I93de3aea986fe64fe536fdf6db8b075c101082b2 Reviewed-on: https://skia-review.googlesource.com/54461 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert^6 "Make threaded proxy generation MDB-friendly, and defer instantiation"Gravatar Brian Osman2017-10-02
| | | | | | | | | | | | | | ANGLE bots were getting lots of corrupted GMs - we set fPreferVRAMUseOverFlushes to false. In that case, multiple deferred proxies were instantiating to the same scratch resource. Any proxy that we're going to fill with an ASAP upload needs to have no pending IO - we hoist all those loads to the front of the flush, so normal IO tracking doesn't really help. Bug: skia: Change-Id: Id36fd8700e522db412a3c992b93c778e2ebb1188 Reviewed-on: https://skia-review.googlesource.com/53940 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Revert "Revert "Revert "Revert "Make threaded proxy generation ↵Gravatar Brian Osman2017-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDB-friendly, and defer instantiation""""" This reverts commit fdd2cb52b781dd68f515a1eb9fe6d054a0ebc226. Reason for revert: ANGLE gold failures Original change's description: > Revert "Revert "Revert "Revert "Make threaded proxy generation MDB-friendly, and defer instantiation"""" > > This reverts commit 9f8d4d36b514ffe3cc3a4a48900e3dc1fecb2a96. > > Bug: skia: > Change-Id: I8d7c1df24d8b13b94404f3d9ba69a1ab55ee00c0 > Reviewed-on: https://skia-review.googlesource.com/52920 > Commit-Queue: Brian Osman <brianosman@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: Ie461de167fbd37323cabd4adf064f99204ba4878 Reviewed-on: https://skia-review.googlesource.com/53801 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Revert "Revert "Revert "Make threaded proxy generation MDB-friendly, ↵Gravatar Brian Osman2017-09-29
| | | | | | | | | | | | and defer instantiation"""" This reverts commit 9f8d4d36b514ffe3cc3a4a48900e3dc1fecb2a96. Bug: skia: Change-Id: I8d7c1df24d8b13b94404f3d9ba69a1ab55ee00c0 Reviewed-on: https://skia-review.googlesource.com/52920 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Revert "Revert "Revert "Make threaded proxy generation MDB-friendly, and ↵Gravatar Brian Osman2017-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | defer instantiation""" This reverts commit e8b8397664666bfcba8f088ea073ede915da8a41. Reason for revert: More crashing. Original change's description: > Revert "Revert "Make threaded proxy generation MDB-friendly, and defer instantiation"" > > This reverts commit 837c6c7c0cc76bdb9d61a05244ca5f31e7573c37. > > Bug: skia: > Change-Id: I1821f1b2b772c67f1b749692b398eb757d8073c9 > Reviewed-on: https://skia-review.googlesource.com/52744 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Brian Osman <brianosman@google.com> TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com Change-Id: I1c8a81ed1000446c298d646d2cd5e7ebd212f18c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/52860 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Revert "Make threaded proxy generation MDB-friendly, and defer ↵Gravatar Brian Osman2017-09-28
| | | | | | | | | | | | instantiation"" This reverts commit 837c6c7c0cc76bdb9d61a05244ca5f31e7573c37. Bug: skia: Change-Id: I1821f1b2b772c67f1b749692b398eb757d8073c9 Reviewed-on: https://skia-review.googlesource.com/52744 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Use wider types to compute bounds area and avoid overflowGravatar Brian Osman2017-09-28
| | | | | | | | | Bug: skia: Change-Id: I3ea8c8acf56d103a8f38e652b418239e0f517839 Reviewed-on: https://skia-review.googlesource.com/52720 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Make threaded proxy generation MDB-friendly, and defer instantiation"Gravatar Brian Osman2017-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 742f3d02a1c6a916d7e0ed3bedb0b546bbe3c15f. Reason for revert: Aaah! Original change's description: > Make threaded proxy generation MDB-friendly, and defer instantiation > > Replaces GrPrepareCallback with GrDeferredProxyUploader, stored directly > on GrTextureProxy. Op lists now store a list of referenced proxies that > are being generated by worker threads. At flush time, iterate over those > proxies, and invoke their uploader. > > Lifetime of the uploader object is now tied to the proxy, but the ASAP > upload function will free the proxy's uploader, if it's called. > > Bug: skia: > Change-Id: Ieb2c6a805d19990012839a8e103c3ca5b8d3dfc6 > Reviewed-on: https://skia-review.googlesource.com/49904 > Commit-Queue: Brian Osman <brianosman@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com Change-Id: I8f76a67044dc4159f903097d8b1ef19ffb48c730 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/52760 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Make threaded proxy generation MDB-friendly, and defer instantiationGravatar Brian Osman2017-09-28
| | | | | | | | | | | | | | | | Replaces GrPrepareCallback with GrDeferredProxyUploader, stored directly on GrTextureProxy. Op lists now store a list of referenced proxies that are being generated by worker threads. At flush time, iterate over those proxies, and invoke their uploader. Lifetime of the uploader object is now tied to the proxy, but the ASAP upload function will free the proxy's uploader, if it's called. Bug: skia: Change-Id: Ieb2c6a805d19990012839a8e103c3ca5b8d3dfc6 Reviewed-on: https://skia-review.googlesource.com/49904 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Invalidate textures cached by SW path renderer when paths go awayGravatar Brian Osman2017-09-26
| | | | | | | | Bug: skia: Change-Id: Icfc2f1bd57c0cf7be54469b6d86cbd436b59155d Reviewed-on: https://skia-review.googlesource.com/51201 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Add ability to remove unique key from proxy and underlying surface.Gravatar Greg Daniel2017-09-26
| | | | | | | | Bug: skia: Change-Id: I66b891ce9ca35906fdbddb36f565b35b25825112 Reviewed-on: https://skia-review.googlesource.com/51240 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Temporary patch for Mac TSAN bot (with threaded Ganesh mask generation)Gravatar Robert Phillips2017-09-21
| | | | | | | | Change-Id: Id84e1534b00583eb2d76699386f42277d2007602 Reviewed-on: https://skia-review.googlesource.com/49900 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Do software clip mask generation with worker threadsGravatar Brian Osman2017-09-11
| | | | | | | | | | | Also refactor the prepare callback stuff to share logic between software path rendering and clip mask generation. Bug: skia: Change-Id: I0c56c6df8703eb59d2d49a4c3985bd4f5ef20f01 Reviewed-on: https://skia-review.googlesource.com/44421 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Skip making a surface context when doing threaded SW pathsGravatar Brian Osman2017-09-08
| | | | | | | | Bug: skia: Change-Id: I4f78abc836f22a216e94a47cb2a7414edccbd2b6 Reviewed-on: https://skia-review.googlesource.com/44201 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Improve GrPathRendererChain heuristicsGravatar Chris Dalton2017-09-07
| | | | | | | | | | | | Changes GrPathRenderer::canDrawPath to return a 'CanDrawPath' enum, which contains a new kAsBackup value that means "I'm better than SW, but give the path renderers below me a chance first." Bug: skia: Change-Id: Ia339567800a3127e61b9beaed19504cd504f18af Reviewed-on: https://skia-review.googlesource.com/43761 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Revert "Improve GrPathRendererChain heuristics"Gravatar Chris Dalton2017-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 60f42494f5d45c38e260ce089cdddfb600f799b2. Reason for revert: breaking gold Original change's description: > Improve GrPathRendererChain heuristics > > Changes GrPathRenderer::canDrawPath to return a 'CanDrawPath' enum, > which contains a new kAsBackup value that means "I'm better than SW, > but give the path renderers below me a chance first." > > Bug: skia: > Change-Id: I45aac5462ca1bc0bc839eb1c315db9493901a07e > Reviewed-on: https://skia-review.googlesource.com/42222 > Reviewed-by: Brian Osman <brianosman@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Chris Dalton <csmartdalton@google.com> TBR=jvanverth@google.com,bsalomon@google.com,brianosman@google.com,csmartdalton@google.com,senorblanco@google.com Change-Id: I46020dbd56b6f6b88668894285b9b7b80f89b9a2 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/43780 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Improve GrPathRendererChain heuristicsGravatar Chris Dalton2017-09-07
| | | | | | | | | | | | | Changes GrPathRenderer::canDrawPath to return a 'CanDrawPath' enum, which contains a new kAsBackup value that means "I'm better than SW, but give the path renderers below me a chance first." Bug: skia: Change-Id: I45aac5462ca1bc0bc839eb1c315db9493901a07e Reviewed-on: https://skia-review.googlesource.com/42222 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Rework GrSamplerParams to be more compact and use its own wrap mode enum.Gravatar Brian Salomon2017-09-07
| | | | | | | | | The main change is to make GrSamplerParams smaller by making its enums have byte-sized underlying types. The rest is cosmetic. Change-Id: Ib71ea50612d24619a85e463826c6b8dfb9b445e3 Reviewed-on: https://skia-review.googlesource.com/43200 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* With threaded software paths, free mask memory earlierGravatar Brian Osman2017-09-01
| | | | | | | | | | | | | This alleviates memory pressure in my benchmarking, and makes a measurable impact on overall time when drawing many SW paths. Bug: skia: Change-Id: Iacabc9aa51522578da9f4d9411995b8d4fd381ba Reviewed-on: https://skia-review.googlesource.com/41848 Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Make GrSWMaskHelper take a matrix for each drawGravatar Brian Salomon2017-08-30
| | | | | | | Change-Id: I52659857174848696f360d64552a9690db24ed50 Reviewed-on: https://skia-review.googlesource.com/40883 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Threaded generation of software pathsGravatar Brian Osman2017-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Re-land of: https://skia-review.googlesource.com/36560 All information needed by the thread is captured by the prepare callback object, the lambda captures a pointer to that, and does the mask render. Once it's done, it signals the semaphore (also owned by the callback). The callback defers the semaphore wait even longer (into the ASAP upload), so the odds of waiting for the thread are REALLY low. Also did a bunch of cleanup along the way, and put in some trace markers so we can monitor how well this is working. Traces of a GM that includes GPU and SW path rendering (path-reverse): Original: https://screenshot.googleplex.com/f5BG3901tQg.png Threaded, with wait in the callback (notice pre flush callback blocking): https://screenshot.googleplex.com/htOSZFE2s04.png Current version, with wait deferred to ASAP upload function: https://screenshot.googleplex.com/GHjD0U3C34q.png Bug: skia: Change-Id: Idb92f385590749f41328a9aec65b2a93f4775079 Reviewed-on: https://skia-review.googlesource.com/40775 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Threaded generation of software paths"Gravatar Brian Salomon2017-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 76323bc0615044a5921afef0e19a350f3d04ffe0. Reason for revert: Breaking NUC bots in threaded gm comparison: https://chromium-swarm.appspot.com/task?id=382e589753187f10&refresh=10 Original change's description: > Threaded generation of software paths > > All information needed by the thread is captured by the prepare > callback object, the lambda captures a pointer to that, and does the > mask render. Once it's done, it signals the semaphore (also owned by the > callback). The callback defers the semaphore wait even longer (into the > ASAP upload), so the odds of waiting for the thread are REALLY low. > > Also did a bunch of cleanup along the way, and put in some trace markers > so we can monitor how well this is working. > > Traces of a GM that includes GPU and SW path rendering (path-reverse): > > Original: > https://screenshot.googleplex.com/f5BG3901tQg.png > Threaded, with wait in the callback (notice pre flush callback blocking): > https://screenshot.googleplex.com/htOSZFE2s04.png > Current version, with wait deferred to ASAP upload function: > https://screenshot.googleplex.com/GHjD0U3C34q.png > > Bug: skia: > Change-Id: I3d5a230bbd68eb35e1f0574b308485c691435790 > Reviewed-on: https://skia-review.googlesource.com/36560 > Commit-Queue: Brian Osman <brianosman@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com Change-Id: Icac0918a3771859f671b69ae07ae0fedd3ebb3db No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/38560 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Threaded generation of software pathsGravatar Brian Osman2017-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | All information needed by the thread is captured by the prepare callback object, the lambda captures a pointer to that, and does the mask render. Once it's done, it signals the semaphore (also owned by the callback). The callback defers the semaphore wait even longer (into the ASAP upload), so the odds of waiting for the thread are REALLY low. Also did a bunch of cleanup along the way, and put in some trace markers so we can monitor how well this is working. Traces of a GM that includes GPU and SW path rendering (path-reverse): Original: https://screenshot.googleplex.com/f5BG3901tQg.png Threaded, with wait in the callback (notice pre flush callback blocking): https://screenshot.googleplex.com/htOSZFE2s04.png Current version, with wait deferred to ASAP upload function: https://screenshot.googleplex.com/GHjD0U3C34q.png Bug: skia: Change-Id: I3d5a230bbd68eb35e1f0574b308485c691435790 Reviewed-on: https://skia-review.googlesource.com/36560 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Move DrawToTargetWithShapeMask to GrSoftwarePathRendererGravatar Brian Osman2017-08-17
| | | | | | | | | | | | | That function has nothing to do with software masks - I claim it was only in GrSWMaskHelper because it was used by the software path renderer. Also trimmed some includes. Bug: skia: Change-Id: I6939010c70309cdc4135cb250afe85ad7b7be451 Reviewed-on: https://skia-review.googlesource.com/35821 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Cache more aggressively in GrSoftwarePathRenderer for AndroidGravatar Stan Iliev2017-08-16
| | | | | | | | | | | | | | Discard fractional translation from the cache key in GrSoftwarePathRenderer for Android framework. This improves cache hit ratio and speeds up draw frame 50th percentile for quick settings jank test by 0.7ms. This quality trade-off is fine and it is matching HWUI OpenGL renderer behavior. Bug: b/64487466 Change-Id: I865169aa2acbca80f1399da8bdd7f624f413295e Reviewed-on: https://skia-review.googlesource.com/34900 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stan Iliev <stani@google.com>
* Hide GrPaint copy constructor and add GrPaint::Clone and remove MoveOrNew ↵Gravatar Brian Salomon2017-08-10
| | | | | | | | | | | and MoveOrCopy. Also makes paint clones use cloned fragment processors. Change-Id: I60efcfc6a46a4f8430a72f4d1ec79c7d99fbe593 Reviewed-on: https://skia-review.googlesource.com/33084 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Reduce dependence on GrSurface's origin field (take 3)Gravatar Robert Phillips2017-07-25
| | | | | | | | | TBR=bsalomon@google.com Change-Id: I8c95c6774897dbd87e3c5c87d92f75c5b64d4e76 Reviewed-on: https://skia-review.googlesource.com/26424 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Revert "Reduce dependence on GrSurface's origin field (take 2)"Gravatar Robert Phillips2017-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 22115b4fc6ab169d45a1cfb65dae2dc7e544c80a. Reason for revert: GrAHardwareBufferImageGenerator.cpp Original change's description: > Reduce dependence on GrSurface's origin field (take 2) > > TBR=bsalomon@google.com > Change-Id: Ia238fc66b0fe10a3626c7967b2ac1f1a4bf4cd71 > Reviewed-on: https://skia-review.googlesource.com/25800 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: I6dc77f02eed3073317128c48f0b426b81926787f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/26480 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Reduce dependence on GrSurface's origin field (take 2)Gravatar Robert Phillips2017-07-25
| | | | | | | | TBR=bsalomon@google.com Change-Id: Ia238fc66b0fe10a3626c7967b2ac1f1a4bf4cd71 Reviewed-on: https://skia-review.googlesource.com/25800 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Second small fragment from "Reduce dependence on GrSurface's origin field"Gravatar Robert Phillips2017-07-24
| | | | | | | | TBR=bsalomon@google.com Change-Id: Ifcfe56b1117b64821b2bfc34ba36d120227d15fa Reviewed-on: https://skia-review.googlesource.com/25802 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Reduce dependence on GrSurface's origin field"Gravatar Robert Phillips2017-07-21
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 467022b1861033d968195687da15270c208279ff. Reason for revert: GrAHardwareBufferImageGenerator.cpp Original change's description: > Reduce dependence on GrSurface's origin field > > Unfortunately, GrGPU and its ilk are still using the GrSurface's origin a lot. I will clean that up in a second CL. > > Change-Id: Iba729440ce8ea8d24bb7f4e5de55ed576a0f176d > Reviewed-on: https://skia-review.googlesource.com/24700 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: I1b3f5c3b82d250ac164beb1d5c83abb6c3c6ab3b No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/25620 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Reduce dependence on GrSurface's origin fieldGravatar Robert Phillips2017-07-21
| | | | | | | | | Unfortunately, GrGPU and its ilk are still using the GrSurface's origin a lot. I will clean that up in a second CL. Change-Id: Iba729440ce8ea8d24bb7f4e5de55ed576a0f176d Reviewed-on: https://skia-review.googlesource.com/24700 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>