aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkTextBlob.cpp
Commit message (Collapse)AuthorAge
* remove dead code around SK_SUPPORT_LEGACY_TEXTBLOB_SERIAL_APIGravatar Mike Reed2017-07-22
| | | | | | | | Bug: skia: Change-Id: Ifcf6054871d907efeb2fcf2815bc4c25671525b6 Reviewed-on: https://skia-review.googlesource.com/25944 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* switch away from std::function in public apiGravatar Mike Reed2017-07-21
| | | | | | | | Bug: skia: Change-Id: I181382dc1f9d8671b814134c1a787185745b90a8 Reviewed-on: https://skia-review.googlesource.com/25643 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Add serialize + catalog api to SkTextBlobGravatar Mike Reed2017-07-11
| | | | | | | | Bug: skia:6836 Change-Id: I858cf936b015c14f12a41a4912e19bb15de8abaa Reviewed-on: https://skia-review.googlesource.com/21730 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Purge GrTextBlobCache entries on SkTextBlob deletionGravatar Florin Malita2017-03-14
| | | | | | | | | Similar to the SkImage purge mechanism. Change-Id: I0b7fb1bad507a3c7f30a4f7514bedd894d1748ac Reviewed-on: https://skia-review.googlesource.com/9631 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Remove run count field from SkTextBlob.Gravatar Florin Malita2017-03-13
| | | | | | | | | | | | | We can flag the last run record instead. Run iteration is always sequential, so no penalty. As a side effect, we can no longer allow instantiation of zero-run text blobs - but that seems like a good idea anyway. Change-Id: I7ca80c4780623d5a188f92dfe6d6fe152f20f666 Reviewed-on: https://skia-review.googlesource.com/9149 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Revert "Revert "Revert[2] "hide deprecated underline and strikethru"""Gravatar Mike Reed2017-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cfd3d9ff8f370e3a4a53e2aba84dc4d682501f4c. Reason for revert: derek is fixing caller Original change's description: > Revert "Revert[2] "hide deprecated underline and strikethru"" > > This reverts commit aab68c56ef8fc88b0d1536f99aa1cc9ae7a0573a. > > Reason for revert: android still broken RecordingCanvasTests.cpp > > Original change's description: > > Revert[2] "hide deprecated underline and strikethru" > > > > android now updated. > > > > This reverts commit e005edd3a5deb602beec59f59cdc8b14d3764d58. > > > > BUG=skia:6250 > > > > Change-Id: If08d344cdd863fde1d9955dc3fab671a83be0f73 > > Reviewed-on: https://skia-review.googlesource.com/8815 > > Commit-Queue: Mike Reed <reed@google.com> > > Reviewed-by: Mike Reed <reed@google.com> > > > > TBR=reed@google.com,reviews@skia.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia:6250 > > Change-Id: I954575a0e4b9aca8414e10901a7be03a2d7e6396 > Reviewed-on: https://skia-review.googlesource.com/8900 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> > TBR=reviews@skia.org,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:6250 Change-Id: Ie518b64219a0262cd343644754940774bf42faec Reviewed-on: https://skia-review.googlesource.com/8901 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Revert[2] "hide deprecated underline and strikethru""Gravatar Mike Reed2017-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit aab68c56ef8fc88b0d1536f99aa1cc9ae7a0573a. Reason for revert: android still broken RecordingCanvasTests.cpp Original change's description: > Revert[2] "hide deprecated underline and strikethru" > > android now updated. > > This reverts commit e005edd3a5deb602beec59f59cdc8b14d3764d58. > > BUG=skia:6250 > > Change-Id: If08d344cdd863fde1d9955dc3fab671a83be0f73 > Reviewed-on: https://skia-review.googlesource.com/8815 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Mike Reed <reed@google.com> > TBR=reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:6250 Change-Id: I954575a0e4b9aca8414e10901a7be03a2d7e6396 Reviewed-on: https://skia-review.googlesource.com/8900 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert[2] "hide deprecated underline and strikethru"Gravatar Mike Reed2017-02-22
| | | | | | | | | | | | | android now updated. This reverts commit e005edd3a5deb602beec59f59cdc8b14d3764d58. BUG=skia:6250 Change-Id: If08d344cdd863fde1d9955dc3fab671a83be0f73 Reviewed-on: https://skia-review.googlesource.com/8815 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Revert "hide deprecated underline and strikethru"Gravatar Leon Scroggins2017-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a01bf9ab748836fc4bf271bd5024151bf1ce2e88. Reason for revert: Breaking Android merge. They access setUnderlineText on their <shudder> subclass of SkPaint. Original change's description: > hide deprecated underline and strikethru > > BUG=skia:6250 > > Change-Id: I85395e4960b16ab91237a74ff35e5b7588965512 > Reviewed-on: https://skia-review.googlesource.com/8600 > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Mike Reed <reed@google.com> > TBR=bungeman@google.com,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:6250 Change-Id: If55f69f061dc4439ca2faa62807a9c5694ebbeb4 Reviewed-on: https://skia-review.googlesource.com/8687 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* hide deprecated underline and strikethruGravatar Mike Reed2017-02-17
| | | | | | | | | BUG=skia:6250 Change-Id: I85395e4960b16ab91237a74ff35e5b7588965512 Reviewed-on: https://skia-review.googlesource.com/8600 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Reed <reed@google.com>
* src/core: s/SkAutoTUnref/sk_sp/gGravatar Hal Canary2016-11-07
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4492 Change-Id: I753ad01b03e891221965252e3befe280d09cdb9f Reviewed-on: https://skia-review.googlesource.com/4492 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Use sk_sp text blob APIsGravatar fmalita2016-09-13
| | | | | | | | | | | SkTextBlobBuilder::build() -> make() SkAutoTUnref<const SkTextBlob> -> sk_sp<SkTextBlob> drawTextBlob(const SkTextBlob*) -> drawTextBlob(const sk_sp<SkTextBlob>&) BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2335493005 Review-Url: https://codereview.chromium.org/2335493005
* SkTextBlob: Begin implementing Extended TextBlob APIGravatar halcanary2016-08-30
| | | | | | | BUG=skia:5434 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2084533004 Review-Url: https://codereview.chromium.org/2084533004
* update textblob api to use sk_spGravatar reed2016-08-10
| | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2236013002 NOTREECHECKS=True Review-Url: https://codereview.chromium.org/2236013002
* Move SkTypeface to sk_sp.Gravatar bungeman2016-05-12
| | | | | | | Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1933393002 Review-Url: https://codereview.chromium.org/1933393002
* Revert of Move SkTypeface to sk_sp. (patchset #5 id:80001 of ↵Gravatar scroggo2016-05-12
| | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1933393002/ ) Reason for revert: fontmgr_iterAndroid failing to draw emoji. E.g. https://gold.skia.org/search2?blame=6296da736fbf40aae881650c239420f64e576c3f&unt=true&head=true&query=source_type%3Dgm Original issue's description: > Move SkTypeface to sk_sp. > > Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f TBR=reed@google.com,fmalita@chromium.org,tomhudson@google.com,bungeman@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/1974783002
* Move SkTypeface to sk_sp.Gravatar bungeman2016-05-11
| | | | Review-Url: https://codereview.chromium.org/1933393002
* 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
* detach -> releaseGravatar mtklein2016-03-16
| | | | | | | | | | | | | The C++ standard library uses the name "release" for the operation we call "detach". Rewriting each "detach(" to "release(" brings us a step closer to using standard library types directly (e.g. std::unique_ptr instead of SkAutoTDelete). This was a fairly blind transformation. There may have been unintentional conversions in here, but it's probably for the best to have everything uniformly say "release". BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1809733002 Review URL: https://codereview.chromium.org/1809733002
* SkTextBlob should store per-run text alignmentGravatar fmalita2015-11-17
| | | | | | | | | | SkPaint::Align is only observed for kDefault_Positioning AFAICT, but part of the run logical font nevertheless. BUG=skia:4567 R=mtklein@google.com,halcanary@google.com Review URL: https://codereview.chromium.org/1447403003
* Make SkTextBlob::RunIterator public.Gravatar halcanary2015-10-27
| | | | | | | | | Motivation: This will be easier than adding a friend every time I want to create a one-off SkCanvas subclass or SkRemote::Encoder subclass. See also: SkPath::Iter. Review URL: https://codereview.chromium.org/1411723005
* [SkTextBlob] Remove incorrect builder assertGravatar fmalita2015-10-13
| | | | | | | | | | | | | | At the end of TightRunBounds, glyphPosX cannot exceed the start of the next run. But glyphPosY is running ahead of glyphPosX (for kFull_Positioning) => the glyphPosY assert is incorrect. Since the two pointers advance in lock-step, there isn't much value in the glyphPosY assert anyway - we might as well remove it. BUG=chromium:542643 R=reed@google.com,bungeman@google.com Review URL: https://codereview.chromium.org/1405463004
* [TextBlob] Fall back to TightRunBounds when the font bounds are emptyGravatar fmalita2015-10-09
| | | | | | | | | | | | | | Empty font bounds are likely an indication of a font bug. As a best effort, we can use TightRunBounds in this easily detectable case. Since TightRunBounds only supports kDefault_Positioning currently, the CL also reinstates handling of kFull_Positioning and kHorizontal_Positioning (removed in http://crrev.com/858153007). BUG=507022 R=reed@google.com,bungeman@google.com Review URL: https://codereview.chromium.org/1399123002
* Validate text blob runs after SkTextBlob construction.Gravatar fmalita2015-10-05
| | | | | | | | | This avoids tripping CFI when casting uninitialized SkTextBlob ptrs. BUG=chromium:538754 R=bungeman@google.com,reed@google.com,krasin@google.com Review URL: https://codereview.chromium.org/1388543005
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* Use static_assert instead of SK_COMPILE_ASSERT.Gravatar bungeman2015-08-20
| | | | | | | Now that static_assert is allowed, there is no need to use a non- standard compile time assertion Review URL: https://codereview.chromium.org/1306443004
* Revert of [TextBlob] Fall back to TightRunBounds when the font bounds are ↵Gravatar egdaniel2015-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | empty (patchset #1 id:1 of https://codereview.chromium.org/1284693002/ ) Reason for revert: Breaking DEPS roll on Assert in SkTextBlobBuilder::TightRunBounds. Original issue's description: > [TextBlob] Fall back to TightRunBounds when the font bounds are empty > > Empty font bounds are likely an indication of a font bug. As a best > effort, we can use TightRunBounds in this easily detectable case. > > BUG=507022 > R=reed@google.com,bungeman@google.com > > Committed: https://skia.googlesource.com/skia/+/d6b99cc6b84b3ec864221cbe9945d203bd9eb072 TBR=bungeman@google.com,reed@google.com,fmalita@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=507022 Review URL: https://codereview.chromium.org/1283853002
* [TextBlob] Fall back to TightRunBounds when the font bounds are emptyGravatar fmalita2015-08-10
| | | | | | | | | | Empty font bounds are likely an indication of a font bug. As a best effort, we can use TightRunBounds in this easily detectable case. BUG=507022 R=reed@google.com,bungeman@google.com Review URL: https://codereview.chromium.org/1284693002
* Remove distance field flag from SkPaintGravatar jvanverth2015-06-22
| | | | Review URL: https://codereview.chromium.org/1192413005
* Start canonicalizing color for all A8 textblobsGravatar joshualitt2015-04-14
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1076593002
* [SkTextBlob] Custom run font recordGravatar fmalita2015-04-09
| | | | | | | | | | | Instead of using a full-blown SkPaint to store run font info, use a custom structure. This saves 96 bytes / run on 64bit platforms. R=reed@google.com,mtklein@google.com,joshualitt@google.com Review URL: https://codereview.chromium.org/1070943002
* simple patch to always init SkTextBlob uniqueIDGravatar joshualitt2015-03-25
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1036613002
* Conservative blob bounds cleanupGravatar fmalita2015-01-29
| | | | | | | | | | | | * drop SK_SUPPORT_LEGACY_BLOB_BOUNDS * remove horizontal & fully position tight bounds support (always using conservative bounds now) * special-case horizontal run bounds logic to avoid unnecessary vertical min-maxing R=reed@google.com,mtklein@google.com Review URL: https://codereview.chromium.org/858153007
* Conservative SkTextBlob bounds.Gravatar fmalita2015-01-28
| | | | | | | | | | Compute cheaper/more conservative text blob bounds based on the typeface maximum glyph bbox. BUG=chromium:451401 R=reed@google.com,bungeman@google.com Review URL: https://codereview.chromium.org/886473002
* Stop overloading internal_dispose in SkTextBlob and SkDataGravatar bsalomon2014-11-20
| | | | Review URL: https://codereview.chromium.org/737093002
* Implicit SkTextBlob boundsGravatar fmalita2014-10-16
| | | | | | | | | Compute blob bounds when the client doesn't pass explicit run rects to the builder. This allows us to remove a couple of internal workarounds. R=reed@google.com,mtklein@google.com,bungeman@google.com Review URL: https://codereview.chromium.org/654873003
* Souped-up SkTextBlob.Gravatar fmalita2014-09-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored text blob backend for improved performance: instead of using separate buffers for runs/positions/glyphs, everything is now packed in a consolidated slab (including the SkTextBlob object itself!). Benefits: * number of allocations per blob construction reduced from ~4 to 1 (also minimizes internal fragmentation) * run record size reduced by 8 bytes This takes the blob construction overhead down to negligible levels (for the current Blink uncached textblob implementation). Unfortunately, the code is much more finicky (run merging in particular) -- hence the assert spree. Multi-run blobs are vulnerable to realloc storms but this is not a problem at the moment because Blink is using one-run blobs 99% of the time. Will be addressed in the future. R=mtklein@google.com, reed@google.com, robertphillips@google.com Committed: https://skia.googlesource.com/skia/+/13645ea0ea87038ebd71be3bd6d53b313069a9e4 Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/581173003
* Revert of Souped-up SkTextBlob. (patchset #3 id:40001 of ↵Gravatar fmalita2014-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/581173003/) Reason for revert: Broke the new blobshader gm. Original issue's description: > Souped-up SkTextBlob. > > Refactored text blob backend for improved performance: instead of using > separate buffers for runs/positions/glyphs, everything is now packed in > a consolidated slab (including the SkTextBlob object itself!). > > Benefits: > > * number of allocations per blob construction reduced from ~4 to 1 > (also minimizes internal fragmentation) > * run record size reduced by 8 bytes > > This takes the blob construction overhead down to negligible levels > (for the current Blink uncached textblob implementation). > > Unfortunately, the code is much more finicky (run merging in > particular) -- hence the assert spree. > > Multi-run blobs are vulnerable to realloc storms but this is not a > problem at the moment because Blink is using one-run blobs 99% of the > time. Will be addressed in the future. > > > R=reed@google.com,mtklein@google.com,robertphillips@google.com > > Committed: https://skia.googlesource.com/skia/+/13645ea0ea87038ebd71be3bd6d53b313069a9e4 R=mtklein@google.com, reed@google.com, robertphillips@google.com TBR=mtklein@google.com, reed@google.com, robertphillips@google.com NOTREECHECKS=true NOTRY=true Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/588853002
* Souped-up SkTextBlob.Gravatar fmalita2014-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored text blob backend for improved performance: instead of using separate buffers for runs/positions/glyphs, everything is now packed in a consolidated slab (including the SkTextBlob object itself!). Benefits: * number of allocations per blob construction reduced from ~4 to 1 (also minimizes internal fragmentation) * run record size reduced by 8 bytes This takes the blob construction overhead down to negligible levels (for the current Blink uncached textblob implementation). Unfortunately, the code is much more finicky (run merging in particular) -- hence the assert spree. Multi-run blobs are vulnerable to realloc storms but this is not a problem at the moment because Blink is using one-run blobs 99% of the time. Will be addressed in the future. R=mtklein@google.com, reed@google.com, robertphillips@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/581173003
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002
* SkTextBlob plumbingGravatar fmalita2014-08-26
| | | | | | | | | | | Add SkTextBlob serialization + drawTextBlob() overrides. R=mtklein@google.com, reed@google.com, robertphillips@google.com BUG=269080 Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/499413002
* [SkTextBlob] Merge run font data at draw time.Gravatar fmalita2014-08-22
| | | | | | | | R=bungeman@google.com, reed@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/496773002
* SkTextBlobGravatar fmalita2014-08-21
Initial implementation. R=bungeman@google.com, jbroman@chromium.org, mtklein@google.com, reed@google.com, robertphillips@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/473633002