aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkFindAndPlaceGlyph.h
Commit message (Collapse)AuthorAge
* SkUTFGravatar Hal Canary2018-07-31
| | | | | | | | | | | | | | | | | | | | | Create new header and namespace, `SkUTF` where we are putting all of our robust, well documented UTF-8, UTF-16, and UTF-32 functions: `SkUTF::{Count,Next,To}UTF{8,16,32}()`. SkUTF.h and SkUTF.cpp do not depend on the rest of Skia and are suitable for re-use in other modules. Some of the old UTF-{8,16} functions still live in SkUtils.h; their use will be phased out in future CLs. Also added more unit testing and cleaned up old tests. Removed functions that were unused outside of tests or used only once. Change-Id: Iaa59b8705abccf9c4ba082f855da368a0bad8380 Reviewed-on: https://skia-review.googlesource.com/143306 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@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>
* Remove processText last vestige of drawTextGravatar Herb Derby2018-07-16
| | | | | | | Change-Id: I03a8c094533cdda1e6e3a43d0124889ef6476b0b Reviewed-on: https://skia-review.googlesource.com/141560 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* font remoting: Fix errors with sub-pixel positioning mismatch.Gravatar Khushal2018-05-31
| | | | | | | | | | | | | | | | | 1) Use correct offset from SkTextBlobRunIterator. Only kHorizontal_Positioning needs to use the y offset specified on the run. 2) Use the same mapping function from SkFindAndPlaceGlyph for mapping the glyph position from transform for the run. This avoids minor rounding differences between analysis and draw. R=bungeman@google.com,herb@google.com Bug:829622 Change-Id: Iaef74a8d01f0850ce042149458b2ea795c2a2b61 Reviewed-on: https://skia-review.googlesource.com/131169 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
* drawPosText no longer obeys paint alignmentGravatar Herb Derby2018-05-21
| | | | | | | Change-Id: Iac498b54dea4aa1b203d2b9c58e15bb5f2147f82 Reviewed-on: https://skia-review.googlesource.com/129462 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Reland "Remove devKerning"Gravatar Herb Derby2018-05-02
| | | | | | | | | | | | | | | | | | | | | | This is a reland of c86c5c0144b85d0bc8ec791f9609ee2d4e7d835a Original change's description: > Remove devKerning > > Dev kerning is not supported by any scalers. This is > mostly removed. The remaining fields fRsbDelta and > fLsbDelta are kept to keep Android compiling. > > Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809 > Reviewed-on: https://skia-review.googlesource.com/124921 > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Herb Derby <herb@google.com> Change-Id: Ibf5fac5f1442c7e62392d5146ad460da27b10d5c Reviewed-on: https://skia-review.googlesource.com/125300 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Revert "Remove devKerning"Gravatar Mike Klein2018-05-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c86c5c0144b85d0bc8ec791f9609ee2d4e7d835a. Reason for revert: 4 of 5 Original change's description: > Remove devKerning > > Dev kerning is not supported by any scalers. This is > mostly removed. The remaining fields fRsbDelta and > fLsbDelta are kept to keep Android compiling. > > Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809 > Reviewed-on: https://skia-review.googlesource.com/124921 > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Herb Derby <herb@google.com> TBR=bungeman@google.com,herb@google.com,reed@google.com Change-Id: If865f702868192a1b72cd811baa996dd1282bbce No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/125263 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Remove devKerningGravatar Herb Derby2018-05-01
| | | | | | | | | | | Dev kerning is not supported by any scalers. This is mostly removed. The remaining fields fRsbDelta and fLsbDelta are kept to keep Android compiling. Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809 Reviewed-on: https://skia-review.googlesource.com/124921 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Make rounding code publicGravatar Herb Derby2018-04-26
| | | | | | | Change-Id: I37fec55277fe99734980c7473f964d37ca4248b8 Reviewed-on: https://skia-review.googlesource.com/123931 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Make SubpixelAlignment publicGravatar Herb Derby2018-03-12
| | | | | | | | | | | | And, change the logic to handle NaN and Inf. Small cleanup. BUG=skia:7515 Change-Id: Ib02ad8f4bc66df57d226d4440ef6214fd2f813d6 Reviewed-on: https://skia-review.googlesource.com/113742 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
* make skmatrix getmapproc privateGravatar Cary Clark2017-10-20
| | | | | | | | | | | | | | Make SkMatrix MapXYProc MapPtsProc and friends private. Code search turned up no clients in chromium, google3, android. Fingers crossed. R:reed@google.com Bug: skia:6898 Change-Id: Iee20fe5150499215a09f67cc6f117b685f38f455 Reviewed-on: https://skia-review.googlesource.com/62140 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Replace SkFAIL with SK_ABORT.Gravatar Ben Wagner2017-08-16
| | | | | | | | | | | | SkFAIL is a legacy macro which is just SK_ABORT. This CL mechanically changes uses of SkFAIL to SK_ABORT in preparation for its removal. The related sk_throw macro will be changed independently, due to needing to actually clean up its users. Change-Id: Id70b5c111a02d2458dc60c8933f444df27d9cebb Reviewed-on: https://skia-review.googlesource.com/35284 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Replace variant system with arenaGravatar Herb Derby2017-06-22
| | | | | | | | Bug: skia:6764 Change-Id: I9327b953efeedd73e7985904d17b971939468e40 Reviewed-on: https://skia-review.googlesource.com/20500 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Fix: when pos is not finite, text pointer not advanced.Gravatar Herb Derby2017-01-03
| | | | | | | | | | | This fixes a problem introduced by change https://skia-review.googlesource.com/6404. BUG=skia:6076 Change-Id: Iabf05c40284700dc32431f92df5ba5fcdb6cac1d Reviewed-on: https://skia-review.googlesource.com/6534 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Protect glyph sub-pixel placement against NaN and Inf.Gravatar Herb Derby2016-12-21
| | | | | | | | | BUG=chromium:675106 Change-Id: I3f8f2575ca3d1b02615be00d66cf7a123407c5a3 Reviewed-on: https://skia-review.googlesource.com/6404 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Remove stray semicolons.Gravatar Mike Klein2016-09-27
| | | | | | | | | | | | | | | | Turns out function declarations don't end in semicolons... BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2720 No public API changes. TBR=reed@google.com Change-Id: I72b56d52e1ff7fa6e89c295b0de8c46599791ebb Reviewed-on: https://skia-review.googlesource.com/2720 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Change type of SkGlyph::fAdvance[XY] to float.Gravatar benjaminwagner2016-03-24
| | | | | | | BUG=skia:4632 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1737693006 Review URL: https://codereview.chromium.org/1737693006
* Ensure only fractional floats are converted to SkFixed in SubpixelAlignment.Gravatar benjaminwagner2016-03-11
| | | | | | | BUG=skia:4632 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1779083003 Review URL: https://codereview.chromium.org/1779083003
* Improve horizontal baseline detection.Gravatar bungeman2016-02-29
| | | | | | | | | | | | | | | | | | | The goal is to hint the baseline when hinting is possible, which is to say when the glyphs are be aligned with the pixel grid. The current code has three shortcomings. 1. correctly snaps when the horizontal baseline is on the x-axis but not when on the y-axis. Instead it is snapping the horizontal baseline when there is y-skew. 2. tests against the full device matrix instead of the relaxed matrix used by the scaler context. 3. has range issues when relaxing the matrix. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1740163002 Review URL: https://codereview.chromium.org/1740163002
* Use kSubpixelRounding in one missed location.Gravatar bungeman2016-02-25
| | | | | | | The kSubpixelRounding macro was created to clarify a block of code, but one simplification was missed. Review URL: https://codereview.chromium.org/1733843002
* Start using <type_traits> and <utility> (C++11).Gravatar bungeman2016-01-05
| | | | | | | | | | | | | | SkUtility.h and SkTLogic.h implement a number of type traits now available through <type_traits> and <utility>. This removes SkUtility.h, replacing it with <utility>, and moves a number of traits in SkTLogic.h to use the std:: equivelents. This change only uses C++11 parts of the standard library; SkTLogic.h will continue to provide C++14 and beyond for now in the skstd namespace. The changes to SkTLogic.h are being done gradually so that safe changes may be landed confidently, with more risky changes in the future. Review URL: https://codereview.chromium.org/1561683002
* Simplify D1G so that it can inline DrawOneGlyph, and fix a bug in codegenGravatar herb2015-12-07
| | | | | | that only happens on ARM64 using GCC 4.9. Review URL: https://codereview.chromium.org/1507633004
* Move glyph choosing to the find and place glyph code.Gravatar herb2015-11-20
| | | | | | | | | | This duplicates the functionality of the (private) SkPaint::getDrawCacheProc method into SkFindAndPlaceGlyph::LookupGlyph. Eventually LookupGlyph should replace getDrawCacheProc, at which point it should be removed. The remaining users are gpu and pdf. Review URL: https://codereview.chromium.org/1458193003
* Convert drawText to using the find and place code.Gravatar herb2015-11-18
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1448453002
* Increment text pointer when the width is zero in the subpixel with center ↵Gravatar herb2015-11-12
| | | | | | | | and right alignment. BUG=skia: Review URL: https://codereview.chromium.org/1438893002
* Replace glyph find and position with common code for the gpu bitmap case.Gravatar herb2015-11-11
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1424173005
* Extract glyph find and position code in preparation to use it in XPS and GPU ↵Gravatar herb2015-11-09
code. BUG=skia: Review URL: https://codereview.chromium.org/1409123010