aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrDistanceFieldGeoProc.h
Commit message (Collapse)AuthorAge
* Remove array of TextureSampler pointers from GrIOResourceProcessor.Gravatar Brian Salomon2018-07-30
| | | | | | | | | | Instead store sampler count on base class and subclasses implement a virtual to get the ith sampler. Change-Id: I13e2447a6467a09761d8615acb4aa360b87b1476 Reviewed-on: https://skia-review.googlesource.com/141563 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Revert "Revert "Change how vertex/instance attributes are handled in ↵Gravatar Brian Salomon2018-06-19
| | | | | | | | | | | | | geometry processors."" This reverts commit 5045e501d2aec23e5f1e4b46346033ac3202c6b0. TBR=csmartdalton@google.com Change-Id: Ifbf5f1d8f8ef340fdc69653e931b6d68d4bf0854 Reviewed-on: https://skia-review.googlesource.com/135862 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Change how vertex/instance attributes are handled in geometry ↵Gravatar Mike Klein2018-06-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | processors." This reverts commit 19c1233c447f625c2522e7ecd0a0adecc629bb2f. Reason for revert: want to make sure Google3 can roll Original change's description: > Change how vertex/instance attributes are handled in geometry processors. > > * No longer register vertex/instance attributes on base class, just counts > > * Separate instance and vertex attributes and remove InputRate and offset > > * Make attributes constexpr where possible > > Change-Id: I1f1d5e772fa177a96d2aeb805aab7b69f35bfae6 > Reviewed-on: https://skia-review.googlesource.com/132405 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Chris Dalton <csmartdalton@google.com> TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com Change-Id: I4800632515e14fbf54af52826928ac915657b59f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/135661 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Change how vertex/instance attributes are handled in geometry processors.Gravatar Brian Salomon2018-06-18
| | | | | | | | | | | | | * No longer register vertex/instance attributes on base class, just counts * Separate instance and vertex attributes and remove InputRate and offset * Make attributes constexpr where possible Change-Id: I1f1d5e772fa177a96d2aeb805aab7b69f35bfae6 Reviewed-on: https://skia-review.googlesource.com/132405 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
* Fix check for valid proxies returned by AtlasManager.Gravatar Jim Van Verth2018-05-16
| | | | | | | | | | | | Also renames a lot of variables to make it clearer that getProxies() returns the number of instantiated proxies, not the number of all proxies. Bug: skia: Change-Id: Ifbc910cbd6635dccdb4e7f0df2e69a0f341130af Reviewed-on: https://skia-review.googlesource.com/128660 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Separate creation time & flush time behavior in GrDrawOpAtlas (take 3)Gravatar Robert Phillips2018-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache. For the GrDrawOpAtlas: At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated. The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time. During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive. The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas It now carries a GrProxyProvider for when it needs to create an atlas It passes in a GrResourceProvider* at flush time to allow instantiation. It does not, yet, allocate that GrDrawOpAtlases it might ever require. TBR=bsalomon@google.com Change-Id: I276d339d81e7b709140e082a7b58c5584f73ab70 Reviewed-on: https://skia-review.googlesource.com/111100 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Remove unused color from all distance field GPs and GrAtlasTextOpGravatar Brian Osman2018-01-03
| | | | | | | | Bug: skia: Change-Id: I7f2bd68cc4f6ad65660a4415a08777bc71d34ab6 Reviewed-on: https://skia-review.googlesource.com/90522 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Revert "move homogenous with stride to matrixpriv""Gravatar Brian Salomon2017-12-19
| | | | | | | | | | | | | This reverts commit de71572f650005e36d4fc2fe95fb5677a25ae4f6. Revert "Revert "Transform vertices for distance field glyphs on CPU."" This reverts commit f226e66d75374e370f3ae2c6895bc689670e9e18. Change-Id: I2545afae3beb1d6b14bba056853ed826ae7a4679 Reviewed-on: https://skia-review.googlesource.com/86603 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Transform vertices for distance field glyphs on CPU."Gravatar Greg Daniel2017-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0215e39d7e415d0530231df6ad20d5f215c72152. Reason for revert: break intel 540 and HD2000 intel release bots on gltestthreading gm dftext_blob_pers Original change's description: > Transform vertices for distance field glyphs on CPU. > > This allows batching of DF draws with different view matrices. > > For perspective matrices this means the transformed position vertex > attribute must have w values. Currently, non-perspective DF draws still > use 2 component positions, though this could be changed in the future. > Consequently, perspective draws can batch with other perspective draws > but not non-perspective draws. > > Adds a GM to test batching and reusing the same blobs with both perspective > and non-perspective matrices. > > Change-Id: I0e42c5449ebf3a5a54025dbcdec824d904d5bd9e > Reviewed-on: https://skia-review.googlesource.com/79900 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Jim Van Verth <jvanverth@google.com> TBR=jvanverth@google.com,bsalomon@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: Idc658d9263976d5b5e00a5026c5d6d3c8f4bdc2d Reviewed-on: https://skia-review.googlesource.com/86560 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Transform vertices for distance field glyphs on CPU.Gravatar Brian Salomon2017-12-15
| | | | | | | | | | | | | | | | | | This allows batching of DF draws with different view matrices. For perspective matrices this means the transformed position vertex attribute must have w values. Currently, non-perspective DF draws still use 2 component positions, though this could be changed in the future. Consequently, perspective draws can batch with other perspective draws but not non-perspective draws. Adds a GM to test batching and reusing the same blobs with both perspective and non-perspective matrices. Change-Id: I0e42c5449ebf3a5a54025dbcdec824d904d5bd9e Reviewed-on: https://skia-review.googlesource.com/79900 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Batch better in GrSmallPathRenderer and add perspective support.Gravatar Jim Van Verth2017-10-12
| | | | | | | | | | Minor optimization to text regen also snuck in. Bug: skia: Change-Id: I0c5d97defdcf60b9ce663548c056db0e8bf7149b Reviewed-on: https://skia-review.googlesource.com/57942 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Allow GrDrawOpAtlas to grow as needed""Gravatar Jim Van Verth2017-09-18
| | | | | | | | Bug: skia:3550 Change-Id: I11a3b39ed7470542447f0e46141a26eef7a9bdaf Reviewed-on: https://skia-review.googlesource.com/47240 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Revert "Allow GrDrawOpAtlas to grow as needed"Gravatar Jim Van Verth2017-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 03168b8a62a0d3d14b7a0d14642df4d82203b87c. Reason for revert: Assert in resetting texture proxies. Original change's description: > Allow GrDrawOpAtlas to grow as needed > > Bug: skia:3550 > Change-Id: Ib5312c8c06ba8549d90545658df6686c45058255 > Reviewed-on: https://skia-review.googlesource.com/45841 > Commit-Queue: Jim Van Verth <jvanverth@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> TBR=jvanverth@google.com,robertphillips@google.com Change-Id: I05e084b4cefa57e558f296d6087d4f03fa16ac81 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:3550 Reviewed-on: https://skia-review.googlesource.com/47140 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Allow GrDrawOpAtlas to grow as neededGravatar Jim Van Verth2017-09-15
| | | | | | | | Bug: skia:3550 Change-Id: Ib5312c8c06ba8549d90545658df6686c45058255 Reviewed-on: https://skia-review.googlesource.com/45841 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Add support for additional textures in GrDrawOpAtlasGravatar Jim Van Verth2017-09-12
| | | | | | | | | | Step two in supporting growable/shrinkable atlases. Bug: skia:3550 Change-Id: I0cdec2a9f59cc8ced071bfeec2f8ed5a228c4b7a Reviewed-on: https://skia-review.googlesource.com/43260 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Robert Phillips <robertphillips@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>
* Add proper aliased support for SDF textGravatar Jim Van Verth2017-07-06
| | | | | | | | | | | | | Previously, when asked to render aliased text with distance fields, we would get the aliased glyph from the cache and then try to anti-alias the edge. This change instead grabs the anti-aliased glyph, then deliberately aliases the edge. Bug: chromium:707979 Change-Id: I05766af17d7ae58bca27aaffd9e08e5c586e789c Reviewed-on: https://skia-review.googlesource.com/21728 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* GR_TEST_UTILS fixesGravatar Brian Salomon2017-07-06
| | | | | | | | | | | | | | Fixes build of Skia lib when GR_TEST_UTILS=0 Makes GR_TEST_UTILS=0 for official builds Makes "Mini" builder bot exercise building GPU with is_official_build=true Bug: skia:6786 Change-Id: I6186683a3a216d2e779645bd9e8276a66bcff4d5 Reviewed-on: https://skia-review.googlesource.com/21524 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Clean up GrResourceProvider usageGravatar Robert Phillips2017-06-15
| | | | | | | | | | | | | The only substantive changes are the removal of GrProxy instantiation in: SkGpuBlurUtils::GaussianBlur GrSimpleTextureEffect::Make* Change-Id: I10970609693bd6ff5b3a3c21b41d82642bb277bc Reviewed-on: https://skia-review.googlesource.com/19965 Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Mark overridden destructors with 'override' and remove 'virtual'Gravatar Brian Salomon2017-03-22
| | | | | | | | | This silences a new warning in clang 5.0 Change-Id: Ieb5b75a6ffed60107c3fd16075d2ecfd515b55e8 Reviewed-on: https://skia-review.googlesource.com/10006 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Retract GrContext from src/gpu/effectsGravatar Robert Phillips2017-03-15
| | | | | | | Change-Id: Iceb7263098286bafb2605ef17d1fe6bb25d71e97 Reviewed-on: https://skia-review.googlesource.com/9693 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Clean up/remove unused GrFragmentProcessor-derived ctorsGravatar Robert Phillips2017-02-28
| | | | | | | | | This is the simple (i.e., non-TextureAdjuster) portion of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors) Change-Id: I8f673ebe922e03c69473c18c166bcf818507c662 Reviewed-on: https://skia-review.googlesource.com/8997 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Remove GrProcessorTestData's GrTexturesGravatar Robert Phillips2017-02-21
| | | | | | | | | | | (No longer) Blocked on: https://skia-review.googlesource.com/c/8450/ (Remove asTextureRef from SkSpecialImage & update effects accordingly (take 2)) This also (unfortunately) picks up a few straggling effects that didn't have a sk_sp<GrTextureProxy> factory. Change-Id: I5ce583a084aa8fe00e866eec1db90e2ec9dd2ab0 Reviewed-on: https://skia-review.googlesource.com/8500 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Removes tracking of whether color is ignored by XP.Gravatar Brian Salomon2017-01-04
| | | | | | | | | Removes the feedback to GrDrawOp via GrPipelineOptimizations. Change-Id: I3cb17cad41779af292a92385fcd5ac23ae5a1ffd Reviewed-on: https://skia-review.googlesource.com/6561 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Merge GrGLSLCaps into GrShaderCapsGravatar Brian Salomon2016-11-29
| | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5121 Change-Id: If8d13638f80f42161cbc766a2666c5789e5772c8 Reviewed-on: https://skia-review.googlesource.com/5121 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Rename GrTextureParams to GrSamplerParamsGravatar Brian Salomon2016-11-17
| | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4965 Change-Id: I7d52e81c670e92ca96117284f44b274ce3cc3671 Reviewed-on: https://skia-review.googlesource.com/4965 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Rename GrTextureAccess to GrProcessor::TextureSampler.Gravatar Brian Salomon2016-11-17
| | | | | | | | | | | Renames vars and methods that used the work "access" to refer to this type. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4931 Change-Id: Ibcf488fbd445c5119fc13d190544cd98981bdbee Reviewed-on: https://skia-review.googlesource.com/4931 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Remove "f" suffix from literal in LCD DF text shader.Gravatar bsalomon2016-09-15
| | | | | | | Also improve DF GP names GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2340603003 Review-Url: https://codereview.chromium.org/2340603003
* sk_sp for Ganesh.Gravatar bungeman2016-06-09
| | | | | | | | | | Convert use of GrFragmentProcessor, GrGeometryProcessor, and GrXPFactory to sk_sp. This clarifies ownership and should reduce reference count churn by moving ownership. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041113004 Review-Url: https://codereview.chromium.org/2041113004
* Rename lots of things from 'sRGB' to 'GammaCorrect', where appropriateGravatar brianosman2016-04-13
| | | | | | | | | | | Trying to be much more explicit about where we really mean sRGB as a format, and where we mean gamma-correct, as in: "not legacy behavior". Most of the changes to rendering behavior are dependent on the latter, so let's be precise. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1884873006 Review URL: https://codereview.chromium.org/1884873006
* sRGB support for distance field text.Gravatar brianosman2016-04-12
| | | | | | | | | | | | | | | | | | | | | Add a second distance field adjust table that only applies contrast, not fake-gamma correction. Store a flag in the batch at creation time, using the same logic we apply elsewhere (render target format, plus paint flags). That gets us close, but not as good as bitmap text. The final step is to use a linear step function (rather than smoothstep) to map distance to coverage, when we have sRGB output. Smoothstep's nonlinear response is actually doing some fake-gamma, so it ends up over-correcting when the output is already gamma-correct. Results are now very close between L32 (old table, smoothstep) and S32 (contrast-only table, linstep). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1885613002 Review URL: https://codereview.chromium.org/1885613002
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* Use correct gradient calculation for rotated distance fields.Gravatar jvanverth2016-03-10
| | | | | | | | | | | | | For all uniform scaled matrices, we were using the y coordinate of the y-direction gradient of the v texel space coordinate to scale the distance values. The problem is, if you rotate by 90 degrees this value becomes 0. The correct answer is to take the length of the y-direction gradient. BUG=skia:4864 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1776383002 Review URL: https://codereview.chromium.org/1776383002
* Remove uniform color for GrDistanceFieldGeoProcGravatar joshualitt2015-12-10
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1512533003
* Allow LCD text to batch across colorchanges. This will always useGravatar joshualitt2015-12-08
| | | | | | | | color vertices, even when we can't batch across color changes BUG=skia: Review URL: https://codereview.chromium.org/1502253003
* Rename some processor functions from GL to GLSLGravatar egdaniel2015-11-13
| | | | | | | | TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1443743002
* Move GrGLPrimitive/GeometryProc to GLSLGravatar egdaniel2015-11-13
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1441683008
* Remove batchtrackerGravatar joshualitt2015-09-11
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1332923003
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* Preliminary attempt to remove batch trackerGravatar joshualitt2015-05-19
| | | | | | | | BUG=skia: Committed: https://skia.googlesource.com/skia/+/cbfe91d82500f4ae8c3ff7bd74b3021a4b89fd84 Review URL: https://codereview.chromium.org/1139723004
* Revert of Preliminary attempt to remove batch tracker (patchset #3 id:40001 ↵Gravatar joshualitt2015-05-19
| | | | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.org/1139723004/) Reason for revert: breaking bots Original issue's description: > Preliminary attempt to remove batch tracker > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/cbfe91d82500f4ae8c3ff7bd74b3021a4b89fd84 TBR=robertphillips@google.com,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1132323003
* Preliminary attempt to remove batch trackerGravatar joshualitt2015-05-19
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1139723004
* Remove viewmatrix from GrGeometryProcessor base classGravatar joshualitt2015-05-14
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1127953003
* remove color from GrGeometryProcessorGravatar joshualitt2015-05-13
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1140983002
* removing equality / compute invariant loops from GrGeometryProcessorsGravatar joshualitt2015-05-13
| | | | | | | | BUG=skia: Committed: https://skia.googlesource.com/skia/+/ef292a0901205b9785a30daae2c036aa34a970ca Review URL: https://codereview.chromium.org/1111603004
* Revert of removing equality / compute invariant loops from ↵Gravatar joshualitt2015-04-28
| | | | | | | | | | | | | | | | | | | | | | GrGeometryProcessors (patchset #2 id:20001 of https://codereview.chromium.org/1111603004/) Reason for revert: breaks gl programs Original issue's description: > removing equality / compute invariant loops from GrGeometryProcessors > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/ef292a0901205b9785a30daae2c036aa34a970ca TBR=bsalomon@google.com,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1110993002
* removing equality / compute invariant loops from GrGeometryProcessorsGravatar joshualitt2015-04-28
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1111603004
* Use GLSLCaps for creating processor keys and GLSL-specific programsGravatar jvanverth2015-04-28
| | | | | | | | | Effectively all this does is future-proof any GLSL-specific code, as GLSLCaps is just a typedef of GLCaps. BUG=skia: Review URL: https://codereview.chromium.org/1109863004
* Real fix for the Mali bug.Gravatar jvanverth2015-04-15
| | | | | | | | | The dFdy(st.y) computation seems to be better than the dFdx(st.x) computation on the Mali, so using that. The end result should be about the same. BUG=skia:3528 Review URL: https://codereview.chromium.org/1082913006
* Rename DistanceFieldTextureEffect.{cpp,h}Gravatar jvanverth2015-04-09
BUG=skia: Review URL: https://codereview.chromium.org/1073473005