aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text/GrTextUtils.h
Commit message (Collapse)AuthorAge
* 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>
* 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>
* Rename GrAtlasTextBlob -> GrTextBlobGravatar Herb Derby2018-05-29
| | | | | | | Change-Id: I61311b48f206890dfd1a20796d7d678cd05ef5a3 Reviewed-on: https://skia-review.googlesource.com/130140 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: 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>
* sk_sp-ify GrGlyphCacheGravatar Robert Phillips2018-03-01
| | | | | | | | | Hopefully, this makes it clearer that the subRuns of the GrAtlasTextBlobs carry a ref on the GrAtlasTextStrikes Change-Id: I3d612074d98bc26240465f717711b7a2bcecb6ed Reviewed-on: https://skia-review.googlesource.com/110981 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Fission GrAtlasGlyphCache in two (take 2)Gravatar Robert Phillips2018-03-01
| | | | | | | | | | | | | | | | | | | | | Reland all the things This CL splits the old GrAtlasGlyphCache into a GrAtlasGlyphCache and an GrAtlasManager. The GrAtlasManager itself is split into a rather limited base class (GrRestrictedAtlasManager) and the all powerful GrAtlasManager. The GrRestrictedAtlasManager is available at op creation time and provides access to the proxies backing the atlases. The full GrAtlasManager is only available at flush time and allows instantiation of the proxies and uploading to them. In the DDL world all of the DDL Contexts will receive a GrRestrictedAtlasManager-version of the GrAtlasManager in the main thread. This future atlas manager will have had all of its GrDrawOpAtlases created (but not instantiated) so there should be no race conditions. TBR=jvanverth@google.com Change-Id: I05c6cd8d301bf2decca39765e5cae62993d9da04 Reviewed-on: https://skia-review.googlesource.com/111362 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Fission GrAtlasGlyphCache in two"Gravatar Robert Phillips2018-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit acf17904d6286f2a63a5d895541804d0ea1be646. Reason for revert: Chrome Original change's description: > Fission GrAtlasGlyphCache in two > > This CL splits the old GrAtlasGlyphCache into a GrAtlasGlyphCache and an GrAtlasManager. > > The GrAtlasManager itself is split into a rather limited base class (GrRestrictedAtlasManager) > and the all powerful GrAtlasManager. The GrRestrictedAtlasManager is available at op creation > time and provides access to the proxies backing the atlases. The full GrAtlasManager is > only available at flush time and allows instantiation of the proxies and uploading to them. > > In the DDL world all of the DDL Contexts will receive a GrRestrictedAtlasManager-version of the > GrAtlasManager in the main thread. This future atlas manager will have had all of its > GrDrawOpAtlases created (but not instantiated) so there should be no race conditions. > > Change-Id: I9967d3a4116af50128f390c5039a712b8cd4db08 > Reviewed-on: https://skia-review.googlesource.com/108001 > Commit-Queue: 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: I7c760ea1a9f041a310b96d552aa1497ee5902cd8 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/111040 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Fission GrAtlasGlyphCache in twoGravatar Robert Phillips2018-02-27
| | | | | | | | | | | | | | | | | | This CL splits the old GrAtlasGlyphCache into a GrAtlasGlyphCache and an GrAtlasManager. The GrAtlasManager itself is split into a rather limited base class (GrRestrictedAtlasManager) and the all powerful GrAtlasManager. The GrRestrictedAtlasManager is available at op creation time and provides access to the proxies backing the atlases. The full GrAtlasManager is only available at flush time and allows instantiation of the proxies and uploading to them. In the DDL world all of the DDL Contexts will receive a GrRestrictedAtlasManager-version of the GrAtlasManager in the main thread. This future atlas manager will have had all of its GrDrawOpAtlases created (but not instantiated) so there should be no race conditions. Change-Id: I9967d3a4116af50128f390c5039a712b8cd4db08 Reviewed-on: https://skia-review.googlesource.com/108001 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Add full scaling for color emoji.Gravatar Jim Van Verth2018-02-16
| | | | | | | | Bug: skia:7562 Change-Id: If6788a5004fe060b42a4e437f9b8c18459623225 Reviewed-on: https://skia-review.googlesource.com/106821 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Cleanup of large text rendering, take 2.Gravatar Jim Van Verth2018-02-08
| | | | | | | | | | | | | | | | | * Switch all path glyphs to be rendered as part of the fBigGlyphs (now fPathGlyphs) system * Use one flush command for both cached and throwaway blobs * Store and render path glyphs per run rather than one list for the entire blob (fixes a layering bug) * Fix bug with scaled fallback glyphs, where fallback glyphs were trying to use more than one descriptor * Set paint flags correctly for paths Bug: skia:7562 Change-Id: I9455eda2867860a713fbdbbda79c74109e95f9f2 Reviewed-on: https://skia-review.googlesource.com/105020 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Revert "Cleanup of large text rendering."Gravatar Jim Van Verth2018-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2fb7c8aef57e4b94d5215e618d8c3b4cccd35edf. Reason for revert: Causing flakes and incorrect GMs on ChromeOS. Original change's description: > Cleanup of large text rendering. > > * Switch all path glyphs to be rendered as part of the fBigGlyphs > (now fPathGlyphs) system > * Use one flush command for both cached and throwaway blobs > * Store and render path glyphs per run rather than one list for the > entire blob (fixes a layering bug) > * Fix bug with scaled fallback glyphs, where fallback glyphs were > trying to use more than one descriptor > > Bug: skia:7562 > Change-Id: Ic3d01887e2203a844102a04afe8674a16149b4bb > Reviewed-on: https://skia-review.googlesource.com/102400 > 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: I103a7419df96db9859e0f6f4d0a8e5aea4ba8ddc No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7562 Reviewed-on: https://skia-review.googlesource.com/104640 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Cleanup of large text rendering.Gravatar Jim Van Verth2018-02-06
| | | | | | | | | | | | | | | | * Switch all path glyphs to be rendered as part of the fBigGlyphs (now fPathGlyphs) system * Use one flush command for both cached and throwaway blobs * Store and render path glyphs per run rather than one list for the entire blob (fixes a layering bug) * Fix bug with scaled fallback glyphs, where fallback glyphs were trying to use more than one descriptor Bug: skia:7562 Change-Id: Ic3d01887e2203a844102a04afe8674a16149b4bb Reviewed-on: https://skia-review.googlesource.com/102400 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Move more internal methods from GrContext to GrContextPriv (take 3)Gravatar Robert Phillips2018-01-22
| | | | | | | | Change-Id: Ied630e61cf95780bf85032867e6ce663e1ef9c2f Reviewed-on: https://skia-review.googlesource.com/98000 Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Move more internal methods from GrContext to GrContextPriv (take 2)"Gravatar Leon Scroggins2018-01-20
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c22e50bd317fe3658445c04e18a6e319d746c510. Reason for revert: Speculative fix for Android roll Original change's description: > Move more internal methods from GrContext to GrContextPriv (take 2) > > Change-Id: I47108910517d61edeb52f82793d384fdb5605d45 > Reviewed-on: https://skia-review.googlesource.com/97241 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I3a77ac33c5f48529357cf9c683d5f4cacaa2379f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/97582 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Move more internal methods from GrContext to GrContextPriv (take 2)Gravatar Robert Phillips2018-01-19
| | | | | | | Change-Id: I47108910517d61edeb52f82793d384fdb5605d45 Reviewed-on: https://skia-review.googlesource.com/97241 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Revert "Move more internal methods from GrContext to GrContextPriv"Gravatar Hal Canary2018-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f440cecbfdf1910104f36aedd0e963da2ae8b6a8. Reason for revert: breaking android builds. Original change's description: > Move more internal methods from GrContext to GrContextPriv > > TBR=bsalomon@google.com > Change-Id: Ia8cf0e0d30451c69bc7a08215aafa6abe6e0ddbe > Reviewed-on: https://skia-review.googlesource.com/97080 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: If263f8161f0fbe3fc6ee8f34bb09e237705c3694 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/97200 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Move more internal methods from GrContext to GrContextPrivGravatar Robert Phillips2018-01-19
| | | | | | | | TBR=bsalomon@google.com Change-Id: Ia8cf0e0d30451c69bc7a08215aafa6abe6e0ddbe Reviewed-on: https://skia-review.googlesource.com/97080 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Begin support for large color emoji glyphsGravatar Jim Van Verth2018-01-12
| | | | | | | | Bug: skia: Change-Id: I10184a0c2ffae9baf3adb3c670d5e61ceeaf90ff Reviewed-on: https://skia-review.googlesource.com/93360 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Move bmp/mask/sdf functionality from GrTextUtils to GrAtlasTextContextGravatar Brian Salomon2017-11-07
| | | | | | | Change-Id: I3924f2f9fd2860749f0404030d0be502a8153faa Reviewed-on: https://skia-review.googlesource.com/68211 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Add GrTextUtils::TargetGravatar Brian Salomon2017-10-30
| | | | | | | | | This abstracts the portion of GrRenderTargetContext that is used by GrAtlasTextContext and opens the door to creating alternative consumers of GrAtlasTextOps. Change-Id: Iaa48f93f4d7d49e231744d44427e9396c5d36fe7 Reviewed-on: https://skia-review.googlesource.com/64760 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Pass GrRenderTargetContext's GrColorSpaceInfo to SkShader and SkColorFilter.Gravatar Brian Salomon2017-10-25
| | | | | | | | | | | | | | Also to SkColorTo(Premul|Unpremul)GrColor4f. This can avoid cache lookups to find GrColorSpaceXforms as the xform pointer is stored in GrColorSpaceInfo after the first lookup. Also uses GrColorSpaceInfo to construct GrTextUtils::Paint. Bug: skia: Change-Id: Idf19d512a60d2269e6921c7fb54d93aee499a70d Reviewed-on: https://skia-review.googlesource.com/63660 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Add GrColorSpaceInfo and use in place of GrRenderTargetContext in paint ↵Gravatar Brian Salomon2017-10-24
| | | | | | | | | | | conversion. This moves us closer to making GrAtlasTextContext and related classes usable without a GrRenderTargetContext. Change-Id: Ife52d69a3f925e23da88043acb4d8dc9f672a025 Reviewed-on: https://skia-review.googlesource.com/63304 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Fix LCD distance field text color filteringGravatar Jim Van Verth2017-06-08
| | | | | | | | | | | Distance field text was applying the color filter to determine any gamma adjustments, but not any effects of the shader as well. Bug: skia:6669 Change-Id: I73384f68141fb523ea2058e00d0a9fbb2fbc622b Reviewed-on: https://skia-review.googlesource.com/19049 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Fix GPU text colors when color spaces are involvedGravatar Brian Osman2017-05-11
| | | | | | | | | | | | | 1) Only store GrColors in GrTextUtils::Paint. We still store premul and unpremul versions, but this is slightly clearer. 2) GrTextUtils::Paint also needs info from the render target context to linearize and transform the color to dst space. Bug: skia:6605 Change-Id: I6e12c55eafaecd2a090c82b4f56827401305bf3a Reviewed-on: https://skia-review.googlesource.com/16486 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Delay SkPaint->GrPaint conversion in text rendering.Gravatar Brian Salomon2017-01-13
| | | | | | | | | | | This fixes an issue where color filters aren't correctly applied to color glyphs. Instead we apply the filter to the SkPaint's color which is correct for mask glyphs only. Add color filter and alpha + various effects to coloremoji gm Change-Id: If77dece71d43468fec65499857eaaaedb56428e9 Reviewed-on: https://skia-review.googlesource.com/6891 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Rename GrBatchFontCache->GrAtlasGlyphCacheGravatar Brian Salomon2016-12-16
| | | | | | | Change-Id: Ie21e18b631daa24e70df630b9f910213f62bdbdf Reviewed-on: https://skia-review.googlesource.com/6164 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Rename GrDrawContext to GrRenderTargetContextGravatar Brian Osman2016-10-27
| | | | | | | | | | | | | | This is in preparation for GrTextureContext and GrSurfaceContext BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4030 Change-Id: Ie58c93052e68f3f1f5fe8d15d63760de274a6fbd Reviewed-on: https://skia-review.googlesource.com/4030 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Remove GrFontScaler class.Gravatar bsalomon2016-05-17
| | | | | | | | | | This class is now effectively a set of helpers for interacting with a SkGlyphCache by GrBatchTextStrike. The class is deleted and the code is made into static functions in GrBatchFontCache.cpp BUG=chromium:608566 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1985163002 Review-Url: https://codereview.chromium.org/1985163002
* Decouple contrast boost from fake gamma.Gravatar brianosman2016-04-08
| | | | | | | | | | | | | | Replace FakeGamma with FontWeightFlags. Largely mechanical, except for the changes in ignorePreBlend. With this change, text GMs generally look the same (or at least more similar) in 8888/srgb/gpu/gpusrgb configs. No public API changes. TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1866293003 Review URL: https://codereview.chromium.org/1866293003
* sRGB text fake-gamma progress:Gravatar brianosman2016-04-07
| | | | | | | | | | | | | | | | | Determine if we should use fake-gamma based on the render target format and paint parameters (ie will gamma-correct blending happen?). Plumb that down to the appropriate places in the bitmap text rendering for now. Still need to alter the behavior of the DF text renderer (using the same cue, most likely?). Also, this still doesn't account for the contrast hack. The end result of this change is a pleasant normalizing of weight when viewing text in the gpusrgb config. (Dark text gets heavier, light text gets lighter). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1865953003 Review URL: https://codereview.chromium.org/1865953003
* Delete GrTextContextGravatar joshualitt2016-02-16
| | | | | | | | TBR=bsalomon@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1699073004 Review URL: https://codereview.chromium.org/1699073004
* Move distance field text positioning into GrTextUtilsGravatar joshualitt2016-01-20
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1521633002 Review URL: https://codereview.chromium.org/1521633002
* Reland of Make draw* lines responsible for cache management (patchset #1 ↵Gravatar joshualitt2015-12-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:1 of https://codereview.chromium.org/1552513003/ ) Reason for revert: might have been premature Original issue's description: > Revert of Make draw* lines responsible for cache management (patchset #1 id:1 of https://codereview.chromium.org/1521613002/ ) > > Reason for revert: > seeing crashes on android and linux > > Original issue's description: > > Make draw* lines responsible for cache management > > > > TBR=bsalomon@google.com > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/66957946c0c418e71c0f36bb2904cc38c334eba4 > > TBR=bsalomon@google.com,jvanverth@google.com,joshualitt@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/90e293dae4990a86cb952663ccde8fae55112d7d TBR=bsalomon@google.com,jvanverth@google.com,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1551563003
* Revert of Make draw* lines responsible for cache management (patchset #1 ↵Gravatar joshualitt2015-12-28
| | | | | | | | | | | | | | | | | | | | | | | id:1 of https://codereview.chromium.org/1521613002/ ) Reason for revert: seeing crashes on android and linux Original issue's description: > Make draw* lines responsible for cache management > > TBR=bsalomon@google.com > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/66957946c0c418e71c0f36bb2904cc38c334eba4 TBR=bsalomon@google.com,jvanverth@google.com,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1552513003
* Make draw* lines responsible for cache managementGravatar joshualitt2015-12-15
| | | | | | | TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1521613002
* Move all text stuff to its own folderGravatar joshualitt2015-12-11
BUG=skia: Review URL: https://codereview.chromium.org/1521453002