aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text/GrTextContext.cpp
Commit message (Collapse)AuthorAge
* Move path leaf loop to drawerGravatar Herb Derby2018-07-31
| | | | | | | | | | | This CL makes GPU and Raster use the same path drawing interface. When I get the main body of regenerate over into the glyph run system, I I can refactor a lot of annoyingly similar code away. Change-Id: I6bd2e6119570062695d6943565749d85555b03fa Reviewed-on: https://skia-review.googlesource.com/144350 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Move one leaf loop from GPU to glyph drawerGravatar Herb Derby2018-07-31
| | | | | | | | | | | | Encapsulate the bitmap inner loop of regenerate in the SkGlyphRunListDrawer. This changed required placing an SkGlyphRunListDrawer in the two TextTargets. Change-Id: I7ef7a2d0074fe898fce4da82d26ea1f47e1f7a98 Reviewed-on: https://skia-review.googlesource.com/144302 Reviewed-by: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Combine GPU drawing routines into one large routineGravatar Herb Derby2018-07-30
| | | | | | | | | | | Combining drawDFGlyphRun, DrawBmpGlyphRunAsPaths, and DrawBmpGlyphRun into regenerateGlyphRunList represents the code that must be encapsulated into SkGlyphRunListDrawer. Change-Id: Ia0a710200d8ca7f66495d220698915d87de5a079 Reviewed-on: https://skia-review.googlesource.com/144301 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Make a glyphrun version of DrawBmpPosTextAsPathsGravatar Herb Derby2018-07-30
| | | | | | | | | | | | | | | | Make a copy of DrawBmpPosTextAsPaths called DrawBmpGlyphRunAsPaths which uses a glyph run instead of having to process all the text types. In addition, rearrange the other loops to be located closely in the code. So, only DrawBmpGlyphRunAsPaths is changed code. Change-Id: Ic19678ee59189341d2151ccf55f78c8e111f8f4c Reviewed-on: https://skia-review.googlesource.com/144300 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com> Auto-Submit: Herb Derby <herb@google.com>
* Make regenerateGlyphRunList on use the iteratorGravatar Herb Derby2018-07-27
| | | | | | | | Change-Id: Iba68c94a62b535031594dcff46fd73ed36613b95 Reviewed-on: https://skia-review.googlesource.com/144120 Commit-Queue: Herb Derby <herb@google.com> Auto-Submit: Herb Derby <herb@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Duplicate drawDFPosText into drawDFGlyphRunGravatar Herb Derby2018-07-27
| | | | | | | | | | | This CL has duplicate code, but this should be a small CL to judge how glyphRuns will change the code. Change-Id: Ib4700aa9d19ae3811090796a2c59bbe746361202 Reviewed-on: https://skia-review.googlesource.com/144022 Auto-Submit: Herb Derby <herb@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* 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>
* SkUtils: remove some versions of UTF routines.Gravatar Hal Canary2018-07-25
| | | | | | | Change-Id: Ib1f776ae472117c23d2145253adf25fceb412b32 Reviewed-on: https://skia-review.googlesource.com/143111 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Use SkGlyphRunListIterator in gpuGravatar Herb Derby2018-07-19
| | | | | | | | | | | | | Instead of using the text blob through the stack start using the glyph run list. This CL is similar to a portion of https://skia-review.googlesource.com/c/skia/+/137224 which was reverted. Change-Id: I1f0619bd2d13523f9af1a68ab27fb26abd086add Reviewed-on: https://skia-review.googlesource.com/141543 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Introduce text blob processing but don't wire it upGravatar Herb Derby2018-07-13
| | | | | | | | | | | Have all the old code paths start using lists in preparation for introducing text blobs. Change-Id: I65cc02ee3da63bc3c9492db78a08b0eee3b1f931 Reviewed-on: https://skia-review.googlesource.com/141081 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Move to using pointers in simplifyDraw*Gravatar Herb Derby2018-07-12
| | | | | | | | | | Move to using pointers into buffers. This will allow multiple runs from blobs to share buffers. Change-Id: I6ebed2e490c5fe71077ddc921ead145ce17c5ebd Reviewed-on: https://skia-review.googlesource.com/141049 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@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>
* Replace isGammaCorrect with isLinearlyBlendedGravatar Brian Osman2018-07-03
| | | | | | | | | | | | | | | | | | | | We were using isGammaCorrect (presence of a color space) to trigger rendering effects that should only apply when doing linear blending. Rename and redefine that function to fix many of those issues. In a few places, we really do care about the color space. The big win here is text rendering, which is now the same on legacy gl and glsrgb configs. Also left some comments about our desire to do something smarter for text in the future. Bug: skia: Change-Id: I94106e95f5f81aaa0a28dbaccd65f5d94cf0de67 Reviewed-on: https://skia-review.googlesource.com/139109 Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: Brian Osman <brianosman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Klein <mtklein@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>
* gpu: Expose GrContextPriv::abandoned in the public API.Gravatar Khushal2018-06-27
| | | | | | | | | | TBR=bsalomon@google.com Bug: 854416 Change-Id: Iab71ca6e4724a925b0b9791267aac5ddc34f5b15 Reviewed-on: https://skia-review.googlesource.com/137692 Reviewed-by: Khusal Sagar <khushalsagar@chromium.org> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
* Use SkGlyphRun instead of builderGravatar Herb Derby2018-06-19
| | | | | | | | | | | | | Move from passing builder down the stack to passing the object we really want to be the interface down the stack. Move code that shunts from glyph run style to drawTextPos to the SkGlyphRun from the builder. Change-Id: Iefaca69104737ce46c06fbb26dc99996784b2bdb Reviewed-on: https://skia-review.googlesource.com/135620 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Revert "Revert "SkTypes: extract SkTo""Gravatar Hal Canary2018-06-14
| | | | | | | | | | | | | | | | This reverts commit fdcfb8b7c23fbf18f872d2c31d27978235033876. > Original change's description: > > SkTypes: extract SkTo > > > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > > Reviewed-on: https://skia-review.googlesource.com/133620 > > Reviewed-by: Mike Klein <mtklein@google.com> Change-Id: Ida74fbc5c21248a724a5edbf9fae18a33bcb23aa Reviewed-on: https://skia-review.googlesource.com/134506 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkTypes: extract SkTo"Gravatar Hal Canary2018-06-13
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2a2f67592602b18527bc3fd449132d420cd5b62e. Reason for revert: this appears to be what is holding up the Chrome roll. Original change's description: > SkTypes: extract SkTo > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > Reviewed-on: https://skia-review.googlesource.com/133620 > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,halcanary@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae Reviewed-on: https://skia-review.googlesource.com/134504 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkTypes: extract SkToGravatar Hal Canary2018-06-12
| | | | | | Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 Reviewed-on: https://skia-review.googlesource.com/133620 Reviewed-by: Mike Klein <mtklein@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>
* New more efficient run builderGravatar Herb Derby2018-06-08
| | | | | | | | | | | | | | | A system for building glyph runs. In the future the builder will only live in canvas, but it's internal structures facilitate interacting with the cache a single glyph at a time. When all the bulk code is in place, only runs will be passed around. Passing the builder down the text draw stack is temporary. Change-Id: I6e3ed184b3f3a58b919377f2d31936e971bd8efa Reviewed-on: https://skia-review.googlesource.com/132928 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: 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>
* Smarter use of glyph cacheGravatar Herb Derby2018-06-06
| | | | | | Change-Id: Ic9bea7310b375575503042881d9d54ff13996729 Reviewed-on: https://skia-review.googlesource.com/131924 Reviewed-by: Mike Klein <mtklein@chromium.org>
* Reland "Have draw(Text|PosText|PosTextH) use a single entry on the device"Gravatar Herb Derby2018-06-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 74b390d6b136a60f1df15ac5ecd19bd8ad5a394b. Reason for revert: reverting to add patch for valgrind Original change's description: > Revert "Have draw(Text|PosText|PosTextH) use a single entry on the device" > > This reverts commit 4225b3220ef4bf50f0d9403f812ea94d50c4ee59. > > Reason for revert: made valgrind unhappy. > > Original change's description: > > Have draw(Text|PosText|PosTextH) use a single entry on the device > > > > Handle the positioning of drawText at the canvas layer. Simplify > > the code by removing similar implementations. > > > > Change-Id: I8b711783435072f560e29fca1dd934fa2e345ed2 > > Reviewed-on: https://skia-review.googlesource.com/127131 > > Reviewed-by: Ben Wagner <bungeman@google.com> > > Commit-Queue: Herb Derby <herb@google.com> > > TBR=jvanverth@google.com,bungeman@google.com,herb@google.com > > Change-Id: I65c9d30ae6ecb1f87e8660e56d8f8ce5daab7551 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/132403 > Reviewed-by: Hal Canary <halcanary@google.com> > Commit-Queue: Hal Canary <halcanary@google.com> TBR=jvanverth@google.com,halcanary@google.com,bungeman@google.com,herb@google.com Change-Id: I9bbb73aac447b51eb8215ac42331759fa4c9fa45 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/132580 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Revert "Have draw(Text|PosText|PosTextH) use a single entry on the device"Gravatar Hal Canary2018-06-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4225b3220ef4bf50f0d9403f812ea94d50c4ee59. Reason for revert: made valgrind unhappy. Original change's description: > Have draw(Text|PosText|PosTextH) use a single entry on the device > > Handle the positioning of drawText at the canvas layer. Simplify > the code by removing similar implementations. > > Change-Id: I8b711783435072f560e29fca1dd934fa2e345ed2 > Reviewed-on: https://skia-review.googlesource.com/127131 > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Herb Derby <herb@google.com> TBR=jvanverth@google.com,bungeman@google.com,herb@google.com Change-Id: I65c9d30ae6ecb1f87e8660e56d8f8ce5daab7551 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/132403 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Have draw(Text|PosText|PosTextH) use a single entry on the deviceGravatar Herb Derby2018-06-05
| | | | | | | | | | Handle the positioning of drawText at the canvas layer. Simplify the code by removing similar implementations. Change-Id: I8b711783435072f560e29fca1dd934fa2e345ed2 Reviewed-on: https://skia-review.googlesource.com/127131 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@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>
* 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>
* 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
* Remove GrContext* from GrTextContextGravatar joshualitt2016-02-11
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1686143003 Review URL: https://codereview.chromium.org/1686143003
* Move surface props off of GrTextContextGravatar joshualitt2016-02-11
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1685653004 Review URL: https://codereview.chromium.org/1685653004
* Start whittling down GrTextContextGravatar joshualitt2016-02-10
| | | | | | | | TBR= BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1684733005 Review URL: https://codereview.chromium.org/1684733005
* Move all text stuff to its own folderGravatar joshualitt2015-12-11
BUG=skia: Review URL: https://codereview.chromium.org/1521453002