aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDistanceFieldTextContext.h
Commit message (Collapse)AuthorAge
* Emulate distance field gamma fix by making glyphs thicker or thinnerGravatar jvanverth2015-04-01
| | | | | | | | | | | | The idea here is that we determine the 0.5 crossover for each row in the gamma table, then invert the mapping to determine which point that maps to in the original range [-.65, .65]. That gives us a change in the apparent width of the glyph that closely corresponds to the change produced by the gamma fix. BUG=skia:2933 Review URL: https://codereview.chromium.org/1042373002
* C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}Gravatar mtklein2015-03-25
| | | | | | | | | NOPRESUBMIT=true BUG=skia: DOCS_PREVIEW= https://skia.org/?cl=1037793002 Review URL: https://codereview.chromium.org/1037793002
* Add more parameters to GrTextContext::canDrawGravatar cdalton2015-03-25
| | | | | | | | | | | | | Updates canDraw to accept all the same Skia/Gr objects as the drawText functions, since that information may very well be relevant in determining whether a context can draw. Also moves the onDrawTextBlob implementation directly into drawTextBlob. BUG=skia: Review URL: https://codereview.chromium.org/1010113004
* Let text contexts fall back directly to pathsGravatar joshualitt2015-03-20
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1015173002
* I'd really like to land this before the branch so speedy reviews are ↵Gravatar joshualitt2015-02-25
| | | | | | | | | | appreciated. BUG=skia: Committed: https://skia.googlesource.com/skia/+/586d5d640b19860dfbbd903a5188da1bbbe87336 Review URL: https://codereview.chromium.org/936943002
* Revert of Pass clip to context (patchset #8 id:180001 of ↵Gravatar joshualitt2015-02-25
| | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/936943002/) Reason for revert: Strange blur problems on nexus 5 Original issue's description: > I'd really like to land this before the branch so speedy reviews are appreciated. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/586d5d640b19860dfbbd903a5188da1bbbe87336 TBR=jvanverth@google.com,senorblanco@google.com,bsalomon@google.com,senorblanco@chromium.org,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/956083002
* I'd really like to land this before the branch so speedy reviews are ↵Gravatar joshualitt2015-02-25
| | | | | | | | appreciated. BUG=skia: Review URL: https://codereview.chromium.org/936943002
* Pass Rendertarget into context.Gravatar joshualitt2015-02-18
| | | | | | | | Adding Jim for text context stuff, and Steven for image blur stuff. BUG=skia: Review URL: https://codereview.chromium.org/939623005
* Fix up all the easy virtual ... SK_OVERRIDE cases.Gravatar mtklein2015-01-09
| | | | | | | | | | | | This fixes every case where virtual and SK_OVERRIDE were on the same line, which should be the bulk of cases. We'll have to manually clean up the rest over time unless I level up in regexes. for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end BUG=skia: Review URL: https://codereview.chromium.org/806653007
* remove view matrix from contextGravatar joshualitt2014-12-17
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/808703006
* Ganesh text rendering cleanup.Gravatar jvanverth2014-12-04
| | | | | | | | | Rename GrTextStrike.{cpp.h} to GrFontCache.{cpp,h} Move contents of GrTextStrike_impl.h to GrFontCache.h Move glyph uploading to a separate function and remove harmful gotos Add assert on glyph upload failure (shouldn't happen) Review URL: https://codereview.chromium.org/780923002
* Cleanup conversion that the new NDK compiler tries to over optimize.Gravatar djsollen2014-10-30
| | | | | | | This allows us to upgrade to NDK r10c as the dftext gm no longer fails when compiled with -O2. Review URL: https://codereview.chromium.org/690053002
* Allocate only the vertices we need for text.Gravatar jvanverth2014-10-23
| | | | | | | | | | This restructures the vertex allocation for text rendering to compute the max number of vertices we would need for a line of text, and then only allocate that much. If this number exceeds the quad index limit, then it will allocate for the max number of quads, and reallocate for the rest later. Review URL: https://codereview.chromium.org/663423003
* Add color emoji fallback for distance field text.Gravatar jvanverth2014-10-20
| | | | | | BUG=skia:3033 Review URL: https://codereview.chromium.org/670533002
* Revert of Change drawText() to generate positions and send to drawPosText() ↵Gravatar jvanverth2014-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #4 id:60001 of https://codereview.chromium.org/653133004/) Reason for revert: A large number of GMs on Ubuntu12 are failing. The text layout on GPU is visibly different than that for 8888. Original issue's description: > Change drawText() to generate positions and send to drawPosText() > > The idea here is to have a central place that does layout for drawText(), and > then always feed text through drawPosText(). This both makes all of the > GrTextContexts consistent in drawText() output, and does a better job of > stressing drawPosText(). > > Because of the effect of matrices on hinting and approximation error, the > generated text is not 100% identical to that produced by the raster pipeline. > > BUG=skia:2778 > > Committed: https://skia.googlesource.com/skia/+/7851a56895c9c076f73a835a7dd51d3c6180c16f TBR=cdalton.nvidia@gmail.com,bungeman@google.com,reed@google.com NOTREECHECKS=true NOTRY=true BUG=skia:2778 Review URL: https://codereview.chromium.org/659993003
* Change drawText() to generate positions and send to drawPosText()Gravatar jvanverth2014-10-16
| | | | | | | | | | | | | | The idea here is to have a central place that does layout for drawText(), and then always feed text through drawPosText(). This both makes all of the GrTextContexts consistent in drawText() output, and does a better job of stressing drawPosText(). Because of the effect of matrices on hinting and approximation error, the generated text is not 100% identical to that produced by the raster pipeline. BUG=skia:2778 Review URL: https://codereview.chromium.org/653133004
* Change GrTextContext fallbacks to be a linked list chain.Gravatar jvanverth2014-10-14
| | | | | | | | | Preliminary work for getting color emoji working with distance field text. BUG=skia:2887 Review URL: https://codereview.chromium.org/650273003
* Rearrange code in TextContexts to be more consistent and match style guide.Gravatar jvanverth2014-10-08
| | | | Review URL: https://codereview.chromium.org/641613003
* Revert of Revert of Fix SkTextBlob offset semantics. (patchset #1 id:1 of ↵Gravatar fmalita2014-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/609223003/) Reason for revert: Re-landing: Chromium-side fix to be landed with the roll (https://codereview.chromium.org/607853003/) Original issue's description: > Revert of Fix SkTextBlob offset semantics. (patchset #2 id:20001 of https://codereview.chromium.org/605533002/) > > Reason for revert: > Breaking the Chrome builds with the error: > > [14:54:14.317833] ../../skia/ext/pixel_ref_utils.cc:221:16: error: 'drawPosText' marked 'override' but does not override any member functions > [14:54:14.318022] virtual void drawPosText(const SkDraw& draw, > [14:54:14.318082] ^ > > Original issue's description: > > Fix SkTextBlob offset semantics. > > > > Implement proper x/y drawTextBlob() handling by plumbing a > > drawPosText() offset parameter (to act as an additional glyph pos > > translation) throughout the device layer. > > > > The new offset superceeds the existing constY, with a minor semantic > > tweak: whereas previous implementations were ignoring constY in 2D > > positioning mode (scalarsPerGlyph == 2), now the offset is always > > observed, in all positioning modes. We can do this because existing > > drawPosText() clients always pass constY == 0 for full positioning mode. > > > > R=reed@google.com, jvanverth@google.com, robertphillips@google.com > > > > Committed: https://skia.googlesource.com/skia/+/c13bc571d3e61a43b87eb97f0719abd304cafaf2 > > TBR=jvanverth@google.com,reed@google.com,bsalomon@google.com,fmalita@chromium.org > NOTREECHECKS=true > NOTRY=true > > Committed: https://skia.googlesource.com/skia/+/d46b8d2bab7cfba8458432248e1568ac377429e9 R=jvanverth@google.com, reed@google.com, bsalomon@google.com, robertphillips@google.com TBR=bsalomon@google.com, jvanverth@google.com, reed@google.com, robertphillips@google.com NOTREECHECKS=true NOTRY=true Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/607413003
* Revert of Fix SkTextBlob offset semantics. (patchset #2 id:20001 of ↵Gravatar robertphillips2014-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/605533002/) Reason for revert: Breaking the Chrome builds with the error: [14:54:14.317833] ../../skia/ext/pixel_ref_utils.cc:221:16: error: 'drawPosText' marked 'override' but does not override any member functions [14:54:14.318022] virtual void drawPosText(const SkDraw& draw, [14:54:14.318082] ^ Original issue's description: > Fix SkTextBlob offset semantics. > > Implement proper x/y drawTextBlob() handling by plumbing a > drawPosText() offset parameter (to act as an additional glyph pos > translation) throughout the device layer. > > The new offset superceeds the existing constY, with a minor semantic > tweak: whereas previous implementations were ignoring constY in 2D > positioning mode (scalarsPerGlyph == 2), now the offset is always > observed, in all positioning modes. We can do this because existing > drawPosText() clients always pass constY == 0 for full positioning mode. > > R=reed@google.com, jvanverth@google.com, robertphillips@google.com > > Committed: https://skia.googlesource.com/skia/+/c13bc571d3e61a43b87eb97f0719abd304cafaf2 R=jvanverth@google.com, reed@google.com, bsalomon@google.com, fmalita@chromium.org TBR=bsalomon@google.com, fmalita@chromium.org, jvanverth@google.com, reed@google.com NOTREECHECKS=true NOTRY=true Author: robertphillips@google.com Review URL: https://codereview.chromium.org/609223003
* Fix SkTextBlob offset semantics.Gravatar Florin Malita2014-09-26
| | | | | | | | | | | | | | | | Implement proper x/y drawTextBlob() handling by plumbing a drawPosText() offset parameter (to act as an additional glyph pos translation) throughout the device layer. The new offset superceeds the existing constY, with a minor semantic tweak: whereas previous implementations were ignoring constY in 2D positioning mode (scalarsPerGlyph == 2), now the offset is always observed, in all positioning modes. We can do this because existing drawPosText() clients always pass constY == 0 for full positioning mode. R=reed@google.com, jvanverth@google.com, robertphillips@google.com Review URL: https://codereview.chromium.org/605533002
* Patch to create a distinct geometry processor. The vast majority of this patchGravatar joshualitt2014-09-23
| | | | | | | | | | | | | is just a rename. The meat is in GrGeometryProcessor, GrProcessor, GrGL*Processor, GrProcessorStage, Gr*BackendProcessorFactory, GrProcessUnitTestFactory, and the builders BUG=skia: R=bsalomon@google.com Author: joshualitt@chromium.org Review URL: https://codereview.chromium.org/582963002
* Fix SDF font positions when using global scale.Gravatar jvanverth2014-09-22
| | | | | | | | | | | | Also fixes a crash in the dftext GM when using SampleApp, and adds new test case in dftext. BUG=skia:2928 R=joshualitt@google.com, egdaniel@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/588223002
* Fix scaling issue with distance field text.Gravatar jvanverth2014-09-16
| | | | | | | | | | | | | Picks the correct distance field size based on both the text size and the max matrix scale. Adjusts the matrix scale if non-unity. Also adds GM for verifying proper distance field scaling. BUG=skia:2928 R=bsalomon@google.com, joshualitt@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/568843002
* Revert Jim's CL.Gravatar Mike Klein2014-08-29
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/517123005
* Restore text vertex buffer alloc and other optimizations.Gravatar jvanverth2014-08-28
| | | | | | | | | | | | Modifies the fontcache GM to ensure that the font cache is forced to flush. Committed: https://skia.googlesource.com/skia/+/9c3d24b9d1ba3d955094ff0cb1ba2d11e1c1adca R=bsalomon@google.com, robertphillips@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/466363009
* Revert of Restore text alloc optimizations. (patchset #4 of ↵Gravatar djsollen2014-08-27
| | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/466363009/) Reason for revert: GM failures on http://108.170.220.120:10115/builders/Test-Ubuntu12-ShuttleA-GTX660-x86-Release/builds/1867/ Original issue's description: > Restore text vertex buffer alloc and other optimizations. > > Modifies the fontcache GM to ensure that the font cache is forced to flush. > > Committed: https://skia.googlesource.com/skia/+/9c3d24b9d1ba3d955094ff0cb1ba2d11e1c1adca R=bsalomon@google.com, robertphillips@google.com, jvanverth@google.com TBR=bsalomon@google.com, jvanverth@google.com, robertphillips@google.com NOTREECHECKS=true NOTRY=true Author: djsollen@google.com Review URL: https://codereview.chromium.org/510103003
* Restore text vertex buffer alloc and other optimizations.Gravatar jvanverth2014-08-27
| | | | | | | | | | Modifies the fontcache GM to ensure that the font cache is forced to flush. R=bsalomon@google.com, robertphillips@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/466363009
* Rollback text allocation changes.Gravatar jvanverth2014-08-01
| | | | | | | | | | | This also addresses an inadvertantly introduced distance field bug. BUG=399125 R=bsalomon@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/438683006
* Add vertex bounds check for distance field rendering.Gravatar jvanverth2014-07-30
| | | | | | | | R=bsalomon@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/432443002
* Add effect caching to distance field text.Gravatar jvanverth2014-07-30
| | | | | | | | | | | | This also is a step towards unifying GrDistanceFieldTextureEffect and GrDistanceFieldLCDTextureEffect. Committed: https://skia.googlesource.com/skia/+/137bac067306c5446bc4f9797bedc3bbaf302822 R=robertphillips@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/424103002
* Revert of Add effect caching to distance field text. ↵Gravatar bensong2014-07-29
| | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/424103002/) Reason for revert: breaking Chrome canary. Original issue's description: > Add effect caching to distance field text. > > This also is a step towards unifying GrDistanceFieldTextureEffect and GrDistanceFieldLCDTextureEffect. > > Committed: https://skia.googlesource.com/skia/+/137bac067306c5446bc4f9797bedc3bbaf302822 R=robertphillips@google.com, jvanverth@google.com TBR=jvanverth@google.com, robertphillips@google.com NOTREECHECKS=true NOTRY=true Author: bensong@google.com Review URL: https://codereview.chromium.org/424173002
* Add effect caching to distance field text.Gravatar jvanverth2014-07-29
| | | | | | | | | | This also is a step towards unifying GrDistanceFieldTextureEffect and GrDistanceFieldLCDTextureEffect. R=robertphillips@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/424103002
* Move vertex buffer setup out of drawPackedGlyph().Gravatar jvanverth2014-07-25
| | | | | | | | | | | | This gets a very welcome ~10% speedup on my Mac. Committed: https://skia.googlesource.com/skia/+/1d38619389cc1100bd516b9acbf17b7bd42d33ce R=bsalomon@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/414573002
* Revert of Move vertex buffer setup out of drawPackedGlyph(). ↵Gravatar jvanverth2014-07-25
| | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/414573002/) Reason for revert: Breaking Ubuntu and Windows bots. Original issue's description: > Move vertex buffer setup out of drawPackedGlyph(). > > This gets a very welcome ~10% speedup on my Mac. > > Committed: https://skia.googlesource.com/skia/+/1d38619389cc1100bd516b9acbf17b7bd42d33ce R=bsalomon@google.com TBR=bsalomon@google.com NOTREECHECKS=true NOTRY=true Author: jvanverth@google.com Review URL: https://codereview.chromium.org/419943002
* Move vertex buffer setup out of drawPackedGlyph().Gravatar jvanverth2014-07-25
| | | | | | | | | | This gets a very welcome ~10% speedup on my Mac. R=bsalomon@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/414573002
* Gamma correction for distance field text.Gravatar jvanverth2014-06-10
| | | | | | | | | | | | | | Handles both non-LCD and LCD text. Uses a texture to look up the gamma correction values for a given text color or luminance. BUG=skia: Committed: https://skia.googlesource.com/skia/+/4d517fdbb145cb95e5e935470df331e1b6667cfc R=reed@google.com, bungeman@google.com, robertphillips@google.com, bsalomon@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/258883002
* Revert of Gamma correction for distance field text. ↵Gravatar scroggo2014-06-09
| | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/258883002/) Reason for revert: Memory leaks. I suspect this is due to the lack of destructors in SkAutoGlyphCache Original issue's description: > Gamma correction for distance field text. > > Handles both non-LCD and LCD text. Uses a texture to look up the gamma correction values for a given text color or luminance. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/4d517fdbb145cb95e5e935470df331e1b6667cfc NOTRY=true NOTREECHECKS=true R=reed@google.com, bungeman@google.com, robertphillips@google.com, bsalomon@google.com, jvanverth@google.com, mtklein@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/323513005
* Gamma correction for distance field text.Gravatar jvanverth2014-06-09
| | | | | | | | | | | Handles both non-LCD and LCD text. Uses a texture to look up the gamma correction values for a given text color or luminance. BUG=skia: R=reed@google.com, bungeman@google.com, robertphillips@google.com, bsalomon@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/258883002
* Add flag for SkGpuSurface creation to enable distance fields.Gravatar commit-bot@chromium.org2014-05-02
| | | | | | | | | | | BUG=skia:2173 R=bsalomon@google.com, reed@google.com, bungeman@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/261783004 git-svn-id: http://skia.googlecode.com/svn/trunk@14525 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add LCD support for distance field text.Gravatar commit-bot@chromium.org2014-04-03
| | | | | | | | | | | | | LCD support is handled by shifting the uv coordinate by 1/3 of a pixel (transformed by the inverse CTM) to the left and right of the original texture coordinate, and using left, center, and right lookups to set the RGB values. This supports both RGB and BGR subpixel order. BUG=skia:2173 R=robertphillips@google.com, egdaniel@google.com, bungeman@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/219243012 git-svn-id: http://skia.googlecode.com/svn/trunk@14049 2bbb7eff-a529-9590-31e7-b0007b416f81
* SK_SUPPORT_LEGACY_GRTYPES to hide duplicate types from SkTypes.hGravatar commit-bot@chromium.org2014-03-28
| | | | | | | | | | | BUG=skia: R=bsalomon@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/216503004 git-svn-id: http://skia.googlecode.com/svn/trunk@13982 2bbb7eff-a529-9590-31e7-b0007b416f81
* Drop executable flag from headers so that they can be packagedGravatar robertphillips@google.com2014-03-11
| | | | | | | | https://codereview.chromium.org/194883004/ git-svn-id: http://skia.googlecode.com/svn/trunk@13746 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2014-01-31
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@13258 2bbb7eff-a529-9590-31e7-b0007b416f81
* Replace factory generation of TextContexts with persistent objects.Gravatar commit-bot@chromium.org2014-01-30
| | | | | | | | | | | BUG=skia:2018 R=bsalomon@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/150743002 git-svn-id: http://skia.googlecode.com/svn/trunk@13249 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move GrTextContext to private interfaceGravatar commit-bot@chromium.org2014-01-30
NOTRY=true R=bsalomon@google.com, reed@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/145073005 git-svn-id: http://skia.googlecode.com/svn/trunk@13239 2bbb7eff-a529-9590-31e7-b0007b416f81