aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/typeface.cpp
Commit message (Collapse)AuthorAge
* Improve SkTestFontMgr.Gravatar Ben Wagner2018-07-13
| | | | | | | | | This moves the portable typefaces into the portable font manager. Change-Id: Id25e8f0b90f99c82d09cfb3ef136bda8c7728ee9 Reviewed-on: https://skia-review.googlesource.com/140351 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Non-normal blur styles to work with non-a8.Gravatar Ben Wagner2018-05-10
| | | | | | | | | BUG=skia:7941 Change-Id: I500561c2fec1bcab324fd9519f1d20d356afdfb5 Reviewed-on: https://skia-review.googlesource.com/127500 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Herb Derby <herb@google.com>
* resources: resource identifiers don't begin with leading slashGravatar Hal Canary2017-12-08
| | | | | | | Change-Id: I52522ffffbf0f5176ac9156cd563b41d6fdde59f Reviewed-on: https://skia-review.googlesource.com/82940 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* remove platform_font_name()Gravatar Mike Klein2017-11-14
| | | | | | | | | | | | It's used rarely and now that we're mostly using portable fonts, it only serves to confuse. Sans-serif doesn't seem to work anyway. Simplify gm/typeface.cpp to just test the default typeface. Change-Id: I091239ea91af9d9e01d3c76280636a6061b5fb5c Reviewed-on: https://skia-review.googlesource.com/71261 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* add platform_font_manager()Gravatar Mike Klein2017-11-13
| | | | | | | | | | | | | This string replaces {major_}platform_os_name() and platform_extra_config() for the font-focused GMs using them. The GDI bots will report "GDI", the NativeFont bots their OS, and other bots "". Change-Id: I8f7bb1ffea3cc91601c98b4ccff7a3a234ac77d3 Reviewed-on: https://skia-review.googlesource.com/70500 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Remove internal use of SkTypeface::Style.Gravatar Ben Wagner2017-07-27
| | | | | | | Change-Id: I71cf04b12be95a54b7fb47d048ba1f8672ed9a8f Reviewed-on: https://skia-review.googlesource.com/27760 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* GM: some header cleanupGravatar Mike Klein2017-03-22
| | | | | | | | | | | | | | gm.h includes sk_tool_utils.h but does not use it. The bulk of this CL makes each gm that uses sk_tool_utils include it. sk_tool_utils.h also provided SkRandom and SkTDArray, so a couple GMs add those headers too. Change-Id: Ieb2a7c542f0ca89c3223f744fc11b0ff37af36c1 Reviewed-on: https://skia-review.googlesource.com/10014 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* GM: add test for type1 fontGravatar halcanary2016-09-20
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2350453002 Review-Url: https://codereview.chromium.org/2350453002
* Replace a lot of 'static const' with 'constexpr' or 'const'.Gravatar mtklein2016-09-01
| | | | | | | | | | | | | | | | | | | | | | | 'static const' means, there must be at most one of these, and initialize it at compile time if possible or runtime if necessary. This leads to unexpected code execution, and TSAN* will complain about races on the guard variables. Generally 'constexpr' or 'const' are better choices. Neither can cause races: they're either intialized at compile time (constexpr) or intialized each time independently (const). This CL prefers constexpr where possible, and uses const where not. It even prefers constexpr over const where they don't make a difference... I want to have lots of examples of constexpr for people to see and mimic. The scoped-to-class static has nothing to do with any of this, and is not changed. * Not yet on the bots, which use an older TSAN. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2300623005 Review-Url: https://codereview.chromium.org/2300623005
* Disable aliased font test on iOS.Gravatar bungeman2016-07-13
| | | | | | | | | | | | See if not requesting aliased text fixes iOS. BUG=skia:5530 TBR=mtklein GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2150483003 Review-Url: https://codereview.chromium.org/2150483003
* Disable embedded bitmap test on iOS.Gravatar bungeman2016-07-13
| | | | | | | | | | | | | | | | | | | | The TypefaceRenderingGM crashes on iOS when drawing an embedded bitmap when requesting aliased rendering. The crash looks like libTrueTypeScaler.dylib`<redacted> + 80 stop reason = EXC_BAD_ACCESS (code=EXC_ARM_DA_ALIGN, address=...) -> 0x330b19d0 <+80>: strd r2, r3, [r5, #36] 0x330b19d4 <+84>: movs r3, #0x0 0x330b19d6 <+86>: add r2, sp, #0x28 0x330b19d8 <+88>: ldr r0, [r4, #0x4] Disable testing embedded bitmaps on iOS for now. BUG=skia:5530 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2140383004 Review-Url: https://codereview.chromium.org/2140383004
* Factor code to rotate a canvas about a point.Gravatar bungeman2016-07-12
| | | | | | | | | | | SkMatrix::scale and ::rotate take a point around which to scale or rotate. Canvas lacks these helpers, so the code to rotate a canvas around a point has been duplicated many times. Factor all of these implementations into SkCanvas::rotate. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2142033002 Review-Url: https://codereview.chromium.org/2142033002
* Use hintgasp font when testing rendering.Gravatar bungeman2016-07-12
| | | | | | | | | | | | | | The hintgasp font was added specifically for the typefacerendering gm. However, this gm didn't actually use the font, so now use it. In addition this adds embedded bitmap strikes to the hintgasp font and the gm is updated to test these as well. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2140863002 NOTREECHECKS=true Test only change, does not affect users. Review-Url: https://codereview.chromium.org/2140863002
* Add gm for various font rendering combinations.Gravatar bungeman2016-07-06
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2080453002 Review-Url: https://codereview.chromium.org/2080453002
* SkTypeface::MakeFromName to take SkFontStyle.Gravatar mboc2016-05-31
| | | | | | | | | | | | | SkTypeface::MakeFromName currently takes SkTypeface::Style, which is quite limited. This starts the transition to this function taking SkFontStyle instead. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1818043002 TBR=reed He said it sounded like a good idea. Review-Url: https://codereview.chromium.org/1818043002
* 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 Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* make fontscalar gammatext lcdtext typeface verttext2 gm portableGravatar caryclark2015-07-24
| | | | | | | | | Pass generic font names to tool util function to generate platform specific fonts and gm test output by unique name. R=bungeman@google.com Review URL: https://codereview.chromium.org/1256903002
* Move font loading in gm tests and benches out of constructorsGravatar kkinnunen2015-05-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Constructing the gm tests and benches causes many calls to font loads. This is visible as profiling samples in fontconfig and freetype on Linux for all profiling runs of nanobench. This complicates analysis of test-cases that are suspected of being slow due to font-related issues. Move the font loading to GM::onOnceBeforeDraw and Benchmark::onPreDraw. This way the code is not executed if the testcase does not match the nanobench --match filter. This way the samples in font-related code are more easy to identify as legitimate occurances caused by the testcase. This should not cause differences in timings, because: * Benchmark::preDraw / onPreDraw is defined to be run outside the timer * GM::runAsBench is not enabled for any of the modified testcases. Also nanobench untimed warmup round should run the onOnceBeforeDraw. (and there are other GM::runAsBench gms already doing loading in onOnceBeforeDraw). Changes the behavior: In TextBench: Before, the test would report two different gms with the same name if the color emoji font was not loaded successfully. After, the test always reports all tests as individual names. Generally: The errors from loading fonts now print inbetween each testcase, as opposed to printing during construction phase. Sample output: ( 143/145 MB 1872) 14.7ms 8888 gm quadclosepathResource /fonts/Funkster.ttf not a valid font. ( 160/160 MB 1831) 575µs 8888 gm surfacenewResource /fonts/Funkster.ttf not a valid font. ( 163/165 MB 1816) 12.5ms 8888 gm linepathResource /fonts/Funkster.ttf not a valid font. ( 263/411 MB 1493) 118ms 8888 gm typefacestyles_kerningResource /fonts/Funkster.ttf not a valid font. ( 374/411 MB 1231) 7.16ms 565 gm getpostextpathResource /fonts/Funkster.ttf not a valid font. ( 323/411 MB 1179) 4.92ms 565 gm stringartResource /fonts/Funkster.ttf not a valid font. ( 347/493 MB 917) 191ms 565 gm patch_gridResource /fonts/Funkster.ttf not a valid font. ( 375/493 MB 857) 23.9ms gpu gm clipdrawdrawCannot render path (0) ( 393/493 MB 706) 2.91ms unit test ParsePath------ png error IEND: CRC error ( 394/493 MB 584) 166ms gpu gm hairmodesResource /fonts/Funkster.ttf not a valid font. Resource /fonts/Funkster.ttf not a valid font. Resource /fonts/Funkster.ttf not a valid font. ... Review URL: https://codereview.chromium.org/1144023002
* 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
* 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
* Add standard fonts to all GMs.Gravatar Cary Clark2014-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow GM results to be compared across machines and platforms by standardizing the fonts used by all tests. This adds runtime flags to DM to use either the system font context (the default), the fonts in the resources directory ( --resourceFonts ) or a set of canonical paths generated from the fonts ( --portableFonts ). This CL should leave the current DM results unchanged by default. If the portable font data or resource font is missing when DM is run, it falls back to using the system font context. The create_test_font tool generates the paths and metrics read by DM with the --portableFonts flag set, and generates the font substitution tables read by DM with the --resourceFonts flag set. If DM is run in SkDebug mode with the --reportUsedChars flag set, it generates the corresponding data compiled into the create_test_font tool. All GM tests set their typeface information by calling either sk_tool_utils::set_portable_typeface or sk_tool_utils::portable_typeface . (The former takes the paint, the latter returns a SkTypeface.) These calls can be removed in the future when the Font Manager can be superceded. BUG=skia:2687 R=mtklein@google.com Review URL: https://codereview.chromium.org/407183003
* fix more 64bit warningsGravatar reed@google.com2014-01-27
| | | | | | | | BUG=skia: Review URL: https://codereview.chromium.org/147683003 git-svn-id: http://skia.googlecode.com/svn/trunk@13190 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-10-31
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12043 2bbb7eff-a529-9590-31e7-b0007b416f81
* prototype for kerning apiGravatar reed@google.com2013-10-30
| | | | | | | | | BUG= R=bungeman@google.com Review URL: https://codereview.chromium.org/29363009 git-svn-id: http://skia.googlecode.com/svn/trunk@12018 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-02-27
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7875 2bbb7eff-a529-9590-31e7-b0007b416f81
* git-svn-id: http://skia.googlecode.com/svn/trunk@7868 ↵Gravatar reed@google.com2013-02-26
| | | | 2bbb7eff-a529-9590-31e7-b0007b416f81
* move SampleTypeface into gm/typefacestylesGravatar reed@google.com2013-02-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7867 2bbb7eff-a529-9590-31e7-b0007b416f81
* Result of running tools/sanitize_source_files.py (which was added in ↵Gravatar rmistry@google.com2012-08-23
| | | | | | | | | https://codereview.appspot.com/6465078/) This CL is part III of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6475053 git-svn-id: http://skia.googlecode.com/svn/trunk@5264 2bbb7eff-a529-9590-31e7-b0007b416f81
* Addressed Windows compiler complaintsGravatar robertphillips@google.com2012-08-15
| | | | | | | | | | http://codereview.appspot.com/6462062/ This CL will require re-baselining of the imagemagnifier GM git-svn-id: http://skia.googlecode.com/svn/trunk@5108 2bbb7eff-a529-9590-31e7-b0007b416f81
* In SkGPipe, only serialize SkTypefaces in cross process mode.Gravatar scroggo@google.com2012-07-27
Also make SkGPipeController ref the recording canvas to ensure that objects used by SkGPipeCanvas (e.g. SharedHeap and fTypefaceSet, which hold references to objects to which pointers are written to the stream) survive to be played back even if SkGPipeWriter.endRecording() is called. BUG= TEST=TypefaceGM Review URL: https://codereview.appspot.com/6447055 git-svn-id: http://skia.googlecode.com/svn/trunk@4817 2bbb7eff-a529-9590-31e7-b0007b416f81