aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPaint.cpp
Commit message (Collapse)AuthorAge
* fix prev change to tooBigForLCD, and add testGravatar reed2014-10-01
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/617353003
* avoid extra math work in MackRecGravatar reed2014-10-01
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/615053005
* Remove SkPaint dirty bits.Gravatar mtklein2014-09-25
| | | | | | | | | | | | | | | | | | | | | | | fDirtyBits is only used by SkPaint::FlatteningTraits, which in turn was only used as a smaller, faster format to flatten paints in-memory to dedup them in the old picture backend. SkRecord obsoleted all this. Neither flatten()/unflatten() (disk format) nor FlatteningTraits is used anywhere performance or size matters. Here I revert the deduping code back to using the disk format for flattened paints. We stil do have to flatten and unflatten paints while coverting from SkRecord backend to the old backend, so we can't just delete this all yet, but any faithful round trip flatten()/unflatten() pair will be fine, however slow. NOTRY=true BUG=skia: R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/604813003
* Make a flipped fDirtyBit always mean "this field is not the default".Gravatar mtklein2014-09-22
| | | | | | | | | | | Haven't been able to measure any perf effect, so I figure I'll let the bots have at it. BUG=skia: R=mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/595583003
* Introduce Props to surface (patchset #27 id:520001 of ↵Gravatar reed2014-09-22
| | | | | | | | | | | | https://codereview.chromium.org/551463004/)" This reverts commit 29c857d0f3a1cb837f73406eeb6ba9771879b5e7. TBR= Author: reed@google.com Review URL: https://codereview.chromium.org/588143004
* Revert of introduce Props to surface (patchset #27 id:520001 of ↵Gravatar reed2014-09-21
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/551463004/) Reason for revert: Broke call site in WebKit Original issue's description: > introduce Props to surface (work in progress) > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/3716fd067a5621bb94a6cb08d72afec8bf3aceda R=robertphillips@google.com, bsalomon@google.com, jvanverth@google.com, bungeman@google.com, fmalita@google.com, vangelis@chromium.org, reed@google.com TBR=bsalomon@google.com, bungeman@google.com, fmalita@google.com, jvanverth@google.com, reed@google.com, robertphillips@google.com, vangelis@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Author: reed@chromium.org Review URL: https://codereview.chromium.org/583773004
* introduce Props to surface (work in progress)Gravatar reed2014-09-21
| | | | | | | | | BUG=skia: R=robertphillips@google.com, bsalomon@google.com, jvanverth@google.com, bungeman@google.com, fmalita@google.com, vangelis@chromium.org, reed@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/551463004
* Serialize the font index.Gravatar bungeman2014-09-18
| | | | | | | | | BUG=skia:1186 R=reed@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/567013002
* remove confusing/unused stream methodsGravatar reed2014-09-12
| | | | | | | | | BUG=skia: R=bungeman@google.com, djsollen@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/563273003
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002
* remove (unused) scale parameter from measureTextGravatar reed2014-08-26
| | | | | | | | | BUG=skia: R=bungeman@google.com, djsollen@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/510433002
* extend SkShader to report a luminance-color to be used for gamma correctionGravatar reed2014-08-22
| | | | | | | | | BUG=skia:590 R=bungeman@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/492963002
* Remove fOrigFontID from SkScalerContextRec.Gravatar bungeman2014-08-18
| | | | | | | | | | With the recent Android changes and removal of chaining, this is no longer used. R=djsollen@google.com, reed@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/476713003
* Remove SkPaintOptionsAndroidGravatar djsollen2014-08-14
| | | | | | | | | | Committed: https://skia.googlesource.com/skia/+/f32331ffdb5de0440bb337aa7cbdd6f33e9ff23b R=reed@google.com, mtklein@google.com, tomhudson@google.com Author: djsollen@google.com Review URL: https://codereview.chromium.org/447873003
* Revert of Remove SkPaintOptionsAndroid (patchset #5 of ↵Gravatar bsalomon2014-08-13
| | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/447873003/) Reason for revert: Breaks the Chromium build: http://108.170.220.120:10117/builders/Canary-Chrome-Ubuntu13.10-Ninja-x86_64-DRT/builds/2469/steps/BuildContentShell_1/logs/stdio Original issue's description: > Remove SkPaintOptionsAndroid > > Committed: https://skia.googlesource.com/skia/+/f32331ffdb5de0440bb337aa7cbdd6f33e9ff23b R=reed@google.com, mtklein@google.com, tomhudson@google.com, djsollen@google.com TBR=djsollen@google.com, mtklein@google.com, reed@google.com, tomhudson@google.com NOTREECHECKS=true NOTRY=true Author: bsalomon@google.com Review URL: https://codereview.chromium.org/473543004
* Remove SkPaintOptionsAndroidGravatar djsollen2014-08-13
| | | | | | | | R=reed@google.com, mtklein@google.com, tomhudson@google.com Author: djsollen@google.com Review URL: https://codereview.chromium.org/447873003
* Revert "Remove SkPaintOptionsAndroid"Gravatar Derek Sollenberger2014-08-06
| | | | | | This reverts commit 27fb94999b8eec448423884e1d071e563c4c95d9. Review URL: https://codereview.chromium.org/450513002
* Remove SkPaintOptionsAndroidGravatar Derek Sollenberger2014-08-06
| | | | Review URL: https://codereview.chromium.org/447873003
* Remove ALL font fallback logic from Skia.Gravatar djsollen2014-08-06
| | | | | | | | R=reed@google.com, bungeman@google.com, caryclark@google.com Author: djsollen@google.com Review URL: https://codereview.chromium.org/434623002
* patch from issue 383923002Gravatar reed2014-07-14
| | | | | | | | TBR= Author: reed@google.com Review URL: https://codereview.chromium.org/394603003
* Use stack allocation for Android data in SkScalerContext::MakeRec().Gravatar jvanverth2014-07-08
| | | | | | | | | | | | | In a perfvis run on the "Boogie" test page, descriptorProc() during detachCache() was taking .721 ms, and 20% of that was the flatten() in MakeRec(). Changing this to a smaller stack allocation reduces the time for descriptorProc() to .556 ms. R=reed@google.com, bsalomon@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/372323003
* Remove SK_IGNORE_FASTER_TEXT_FIX.Gravatar Ben Wagner2014-07-02
| | | | This flag is no longer defined, so remove its use and guarded code.
* Remove A8_LCD luminance hack.Gravatar jvanverth2014-07-01
| | | | | | | | | | | It no longer appears to be necessary, and the powf function is slowing down Android text rendering. R=bungeman@google.com, bsalomon@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/337603008
* Revert of Revert of Fix SkPaint::measureText for stroked hairline text ↵Gravatar rmistry2014-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/354433002/) Reason for revert: Rebaseline CL is ready to be submitted Original issue's description: > Revert of Fix SkPaint::measureText for stroked hairline text (https://codereview.chromium.org/335603003/) > > Reason for revert: > Caused many shadertext GM failures > > Original issue's description: > > Fix SkPaint::measureText for stroked hairline text > > > > SkPaint::measureText and text drawing used different criteria for > > determining whether text should be drawn as paths or not. > > > > Adds tests glyph_pos_(h/n)_(s/f/b) to test the text rendering and the glyph > > positioning in the rendering. Mainly added in order to define what is the > > expected text rendering when hairline stroke is used with various transform > > options. > > > > The testcase also tries to note or highlight the fact that SkPaint::measureText > > is not expected to produce intuitively matching results when compared to a > > rendering, if the rendering is done so that the device ends up having a device > > transform. > > > > This fixes the glyph_pos_h_s (hairline, stroked) test-case. > > > > Ignore shadertext2_pdf-poppler.png gm on > > Test-Ubuntu13.10-ShuttleA-NoGPU-x86_64-Debug temporarily, as that fails. > > > > Committed: https://skia.googlesource.com/skia/+/196af738027c5e18c3eb792dbcaf90ef27821793 > > TBR=jvanverth@google.com,reed@google.com,kkinnunen@nvidia.com > NOTREECHECKS=true > NOTRY=true > > Committed: https://skia.googlesource.com/skia/+/abc9bb55ddfeb4b1a7acc335a34841fddcd22d27 R=jvanverth@google.com, reed@google.com, kkinnunen@nvidia.com TBR=jvanverth@google.com, kkinnunen@nvidia.com, reed@google.com NOTREECHECKS=true NOTRY=true Author: rmistry@google.com Review URL: https://codereview.chromium.org/349153005
* Revert of Fix SkPaint::measureText for stroked hairline text ↵Gravatar rmistry2014-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/335603003/) Reason for revert: Caused many shadertext GM failures Original issue's description: > Fix SkPaint::measureText for stroked hairline text > > SkPaint::measureText and text drawing used different criteria for > determining whether text should be drawn as paths or not. > > Adds tests glyph_pos_(h/n)_(s/f/b) to test the text rendering and the glyph > positioning in the rendering. Mainly added in order to define what is the > expected text rendering when hairline stroke is used with various transform > options. > > The testcase also tries to note or highlight the fact that SkPaint::measureText > is not expected to produce intuitively matching results when compared to a > rendering, if the rendering is done so that the device ends up having a device > transform. > > This fixes the glyph_pos_h_s (hairline, stroked) test-case. > > Ignore shadertext2_pdf-poppler.png gm on > Test-Ubuntu13.10-ShuttleA-NoGPU-x86_64-Debug temporarily, as that fails. > > Committed: https://skia.googlesource.com/skia/+/196af738027c5e18c3eb792dbcaf90ef27821793 R=jvanverth@google.com, reed@google.com, kkinnunen@nvidia.com TBR=jvanverth@google.com, kkinnunen@nvidia.com, reed@google.com NOTREECHECKS=true NOTRY=true Author: rmistry@google.com Review URL: https://codereview.chromium.org/354433002
* Fix SkPaint::measureText for stroked hairline textGravatar kkinnunen2014-06-22
| | | | | | | | | | | | | | | | | | | | | | | | | | SkPaint::measureText and text drawing used different criteria for determining whether text should be drawn as paths or not. Adds tests glyph_pos_(h/n)_(s/f/b) to test the text rendering and the glyph positioning in the rendering. Mainly added in order to define what is the expected text rendering when hairline stroke is used with various transform options. The testcase also tries to note or highlight the fact that SkPaint::measureText is not expected to produce intuitively matching results when compared to a rendering, if the rendering is done so that the device ends up having a device transform. This fixes the glyph_pos_h_s (hairline, stroked) test-case. Ignore shadertext2_pdf-poppler.png gm on Test-Ubuntu13.10-ShuttleA-NoGPU-x86_64-Debug temporarily, as that fails. R=jvanverth@google.com, reed@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/335603003
* 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
* Add assertHeld() to SkMutex.Gravatar mtklein2014-06-09
| | | | | | | | | BUG=skia: R=bungeman@google.com, mtklein@google.com, reed@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/313823004
* 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
* Clean up Skia for Clang's -Wtautological-undefined-compareGravatar Mike Klein2014-06-07
| | | | | | | | This is blocking Chrome from rolling a new Clang, and me too for our TSAN bots. BUG=chromium:381910 Review URL: https://codereview.chromium.org/325603002
* formalize named picture versionsGravatar commit-bot@chromium.org2014-05-20
| | | | | | | | | | | BUG=skia: R=mtklein@google.com, robertphillips@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/291913004 git-svn-id: http://skia.googlecode.com/svn/trunk@14807 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix utf32 text in subpixel modeGravatar commit-bot@chromium.org2014-05-19
| | | | | | | | | | | BUG=skia:2568 R=scroggo@google.com, anders@kilohearts.com Author: reed@google.com Review URL: https://codereview.chromium.org/290893003 git-svn-id: http://skia.googlecode.com/svn/trunk@14789 2bbb7eff-a529-9590-31e7-b0007b416f81
* add release-mode checks for null, at least for a whileGravatar commit-bot@chromium.org2014-05-02
| | | | | | | | | | | BUG=skia: R=bungeman@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/263883006 git-svn-id: http://skia.googlecode.com/svn/trunk@14552 2bbb7eff-a529-9590-31e7-b0007b416f81
* guard against self-assignmentGravatar commit-bot@chromium.org2014-05-02
| | | | | | | | | | | BUG=skia: R=mtklein@google.com, bungeman@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/264793014 git-svn-id: http://skia.googlecode.com/svn/trunk@14545 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix warnings around size_t/intGravatar commit-bot@chromium.org2014-04-19
| | | | | | | | | | | | fix warnings around undeclared (non-static) functions TBR=bsalomon@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/242643008 git-svn-id: http://skia.googlecode.com/svn/trunk@14267 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2014-04-17
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@14234 2bbb7eff-a529-9590-31e7-b0007b416f81
* always store bitfields along with dirty in FlatteningTraitsGravatar commit-bot@chromium.org2014-04-16
| | | | | | | | | | | | This allows us to simplify lots of setters in SkPaint, which in the non-android case, could now be just assignments (and therefore inlineable). R=mtklein@google.com, robertphillips@google.com, tomhudson@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/240273004 git-svn-id: http://skia.googlecode.com/svn/trunk@14229 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove legacy filter-flags, and store FilterLevel directlyGravatar commit-bot@chromium.org2014-04-16
| | | | | | | | | | | BUG=skia: R=robertphillips@google.com, humper@google.com, jvanverth@google.com, mtklein@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/239393002 git-svn-id: http://skia.googlecode.com/svn/trunk@14217 2bbb7eff-a529-9590-31e7-b0007b416f81
* SkPaint: eliminate some dead bytes in 64-bit build.Gravatar commit-bot@chromium.org2014-03-24
| | | | | | | | | | | | | | | | | | | + memcpy-based copy constructor was hiding this gap -> manual copy constructor. + Split tests for finer-grained failures. BUG=skia: Committed: http://code.google.com/p/skia/source/detail?r=13856 Committed: http://code.google.com/p/skia/source/detail?r=13887 R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/203203003 git-svn-id: http://skia.googlecode.com/svn/trunk@13927 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of SkPaint: eliminate some dead bytes in 64-bit build. ↵Gravatar commit-bot@chromium.org2014-03-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/203203003/) Reason for revert: Huh, some Android tests are still failing despite the fix. IntelRhB, Xoom... that's weird. Original issue's description: > SkPaint: eliminate some dead bytes in 64-bit build. > > + memcpy-based copy constructor was hiding this gap -> manual copy constructor. > + Split tests for finer-grained failures. > > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=13856 > > Committed: http://code.google.com/p/skia/source/detail?r=13887 R=reed@google.com, mtklein@chromium.org TBR=mtklein@chromium.org, reed@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: mtklein@google.com Review URL: https://codereview.chromium.org/206623005 git-svn-id: http://skia.googlecode.com/svn/trunk@13888 2bbb7eff-a529-9590-31e7-b0007b416f81
* SkPaint: eliminate some dead bytes in 64-bit build.Gravatar commit-bot@chromium.org2014-03-20
| | | | | | | | | | | | | | | | | + memcpy-based copy constructor was hiding this gap -> manual copy constructor. + Split tests for finer-grained failures. BUG=skia: Committed: http://code.google.com/p/skia/source/detail?r=13856 R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/203203003 git-svn-id: http://skia.googlecode.com/svn/trunk@13887 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of SkPaint: eliminate some dead bytes in 64-bit build. ↵Gravatar commit-bot@chromium.org2014-03-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/203203003/) Reason for revert: Causing RunTest failures on Android. Original issue's description: > SkPaint: eliminate some dead bytes in 64-bit build. > > + memcpy-based copy constructor was hiding this gap -> manual copy constructor. > + Split tests for finer-grained failures. > > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=13856 R=reed@google.com, mtklein@google.com, mtklein@chromium.org TBR=mtklein@chromium.org, mtklein@google.com, reed@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: jcgregorio@google.com Review URL: https://codereview.chromium.org/204543002 git-svn-id: http://skia.googlecode.com/svn/trunk@13858 2bbb7eff-a529-9590-31e7-b0007b416f81
* SkPaint: eliminate some dead bytes in 64-bit build.Gravatar commit-bot@chromium.org2014-03-19
| | | | | | | | | | | | | | + memcpy-based copy constructor was hiding this gap -> manual copy constructor. + Split tests for finer-grained failures. BUG=skia: R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/203203003 git-svn-id: http://skia.googlecode.com/svn/trunk@13856 2bbb7eff-a529-9590-31e7-b0007b416f81
* change tooBitForLCD to compare against linear size of the text, not the areaGravatar commit-bot@chromium.org2014-03-14
| | | | | | | | | | | BUG=skia: R=bungeman@google.com, alokp@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/200643003 git-svn-id: http://skia.googlecode.com/svn/trunk@13817 2bbb7eff-a529-9590-31e7-b0007b416f81
* Allow toString capability to be toggled independent of developer mode.Gravatar commit-bot@chromium.org2014-03-13
| | | | | | | | | | | | This change is motivated by the desire to see the text information in the debugger when not in developer mode. It is structured so user's can disable it if the capability is not wanted. R=bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/197763008 git-svn-id: http://skia.googlecode.com/svn/trunk@13795 2bbb7eff-a529-9590-31e7-b0007b416f81
* Enable use of distance fields via SkPaint flag.Gravatar commit-bot@chromium.org2014-03-11
| | | | | | | | | | | | | Now that distance field generation is fast enough to make it practical, this makes distances field fonts easily available to anyone who wants to try them out (i.e Chromium). BUG=skia:2173 R=reed@google.com, bsalomon@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/193163003 git-svn-id: http://skia.googlecode.com/svn/trunk@13741 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding code to calculate Underline Thickness from Font Metrics, this will be ↵Gravatar commit-bot@chromium.org2014-03-01
| | | | | | | | | | | | | useful when Skia is used with Blink/Chrome. Blink changes are uploaded with code change in patch https://codereview.chromium.org/147703002/ BUG=skia: R=reed@android.com, edisonn@google.com, reed@google.com, mtklein@google.com, mtklein@chromium.org, bungeman@google.com Author: h.joshi@samsung.com Review URL: https://codereview.chromium.org/152073003 git-svn-id: http://skia.googlecode.com/svn/trunk@13635 2bbb7eff-a529-9590-31e7-b0007b416f81
* Factory methods for heap-allocated SkAnnotation objects.Gravatar commit-bot@chromium.org2014-02-27
| | | | | | | | | | | | | | | | | This is part of an effort to ensure that all SkPaint effects can only be allocated on the heap. This patch makes the constructors of SkAnnotation non-public and instead provides factory methods for creating these objects on the heap. BUG=skia:2187 R=reed@google.com, mtklein@google.com, scroggo@google.com Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/181703003 git-svn-id: http://skia.googlecode.com/svn/trunk@13605 2bbb7eff-a529-9590-31e7-b0007b416f81
* Upstream changes from AndroidGravatar commit-bot@chromium.org2014-02-26
| | | | | | | | | | R=scroggo@google.com, reed@google.com Author: djsollen@google.com Review URL: https://codereview.chromium.org/176963003 git-svn-id: http://skia.googlecode.com/svn/trunk@13600 2bbb7eff-a529-9590-31e7-b0007b416f81