aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGlyphCache.h
Commit message (Collapse)AuthorAge
* Change the GlyphCache to use a hash table instead of doing its own ad-hocGravatar herb2015-07-21
| | | | | | | hashing. This change appears to be performance neutral. BUG=skia: Review URL: https://codereview.chromium.org/1216983003
* Cleanup: Comment and ordering changes.Gravatar herb2015-06-24
| | | | | | | This should be a whitespace only change. BUG=skia: Review URL: https://codereview.chromium.org/1194423004
* remove SkDevicePropertiesGravatar robertphillips2015-06-19
| | | | | | There is a lot more clean up to do here but this is probably a big enough bite. Review URL: https://codereview.chromium.org/1196683003
* Fix uninitialized memory bug in the SkGlyphCache.Gravatar herb2015-03-05
| | | | | | | | | | | | | | | | | | | The core of the problem is that the system is asked to lookup the metrics for a character with id == 0. This causes a hit in the fCharToGlyphHash matching the sentinel glyph. This happens because fCharToGlpyhHash is initialized with all zeros, therefore, the fID is zero matching the char with id == 0. The fAdvanceX field of the sentinel glyph is in fact not initialized. The bigger question is now did a zero character get passed to getUnicharMetrics? The breaking code is basically as follows: wchar_t glyph = L'S'; paint.measureText(&glyph, 2); This get mischaracterized as a utf8 string instead of a utf16(?) string. Because of the little endian ordering, this is the character string 'L' '\0'. Since the size of the original string is two bytes (but a single character) the '\0' is treated as its own character and past to getUnicharMetrics. TEST: On windows failed using DrMemory. With this change does not fail. BUG=463204 Review URL: https://codereview.chromium.org/977063002
* Make the glyph array entries inline.Gravatar herb2015-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Perf Reports bin/c --match nytimes --config 8888 desk_nytimes.skp_1_mpd 1.41ms -> 1.38ms 0.98x desk_nytimes.skp_1 1.94ms -> 1.87ms 0.97x bin/c --match nytimes --config gpu desk_nytimes.skp_1_mpd 1.63ms -> 1.59ms 0.97x desk_nytimes.skp_1 1.56ms -> 1.5ms 0.97x Here are results from mac instruments: --match nytimes --config gpu --samples 10000 --skps /Users/herb/src/skia/skps Inline: Total Samples Running Time Self Symbol Name 94335 94335.0ms 98.3% 0.0 start 2365 2365.0ms 2.4% 2365.0 SkGlyphCache::getGlyphIDMetrics(unsigned short, int, int) 975 975.0ms 1.0% 975.0 SkGlyphCache::lookupMetrics(unsigned int, SkGlyphCache::MetricsType) Clean: Total Samples Running Time Self Symbol Name 96833 96833.0ms 97.3% 0.0 start 3418 3418.0ms 3.4% 3418.0 SkGlyphCache::getGlyphIDMetrics(unsigned short, int, int) 1961 1961.0ms 1.9% 1961.0 SkGlyphCache::lookupMetrics(unsigned int, SkGlyphCache::MetricsType) BUG=skia: Committed: https://skia.googlesource.com/skia/+/4c08f16b252a55e438a61f26e5581394ed177da1 Committed: https://skia.googlesource.com/skia/+/b4c29ac173e6f8844327338687248b98bc94132d Review URL: https://codereview.chromium.org/885903002
* Revert of Make the glyph array entries inline. (patchset #11 id:190001 of ↵Gravatar mtklein2015-02-09
| | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/885903002/) Reason for revert: Still broken. Original issue's description: > Make the glyph array entries inline. > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/4c08f16b252a55e438a61f26e5581394ed177da1 > > Committed: https://skia.googlesource.com/skia/+/b4c29ac173e6f8844327338687248b98bc94132d TBR=reed@google.com,herb@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/911513003
* Make the glyph array entries inline.Gravatar herb2015-02-09
| | | | | | | | BUG=skia: Committed: https://skia.googlesource.com/skia/+/4c08f16b252a55e438a61f26e5581394ed177da1 Review URL: https://codereview.chromium.org/885903002
* Revert of Make the glyph array entries inline. (patchset #10 id:170001 of ↵Gravatar bsalomon2015-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/885903002/) Reason for revert: I suspect this is causing the off-by-one character issues that show up in gold.skia.org as of now. All the errors I've seen are on a Win7 bot. Example: good: https://gold.skia.org/img/images/35396bb0d299b81c0031dc0632a019d4.png bad: https://gold.skia.org/img/images/484e511f9e696d95031cd25aeae59da0.png Original issue's description: > Make the glyph array entries inline. > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/4c08f16b252a55e438a61f26e5581394ed177da1 TBR=mtklein@google.com,reed@google.com,herb@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/897463004
* Make the glyph array entries inline.Gravatar herb2015-02-02
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/885903002
* Make char hash dynamic when needed.Gravatar herb2015-01-28
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/880383002
* Use murmur3 finisher to improve font hash efficiency.Gravatar reed2015-01-28
| | | | | | | | | | Add dump() method to inspect glyphcache strikes. Murmur addition improves hash efficient roughly 50% BUG=skia: Review URL: https://codereview.chromium.org/877113002
* Revert of patch from issue 885453002 at patchset 20001 ↵Gravatar mtklein2015-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (http://crrev.com/885453002#ps20001) (patchset #1 id:1 of https://codereview.chromium.org/881953002/) Reason for revert: ==32435==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x621000d8cd00 Lots of info here: http://build.chromium.org/p/client.skia/builders/Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-ASAN/builds/1198/steps/dm/logs/stdio Original issue's description: > patch from issue 885453002 at patchset 20001 (http://crrev.com/885453002#ps20001) > > Make the char cache dynamic in SkGlyphCache > because it is rarely used. > > Landing on behalf of Herb. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/95faa61d63a6f62916f6f7be58c4624da8357e3b TBR=mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/881023003
* patch from issue 885453002 at patchset 20001 ↵Gravatar mtklein2015-01-27
| | | | | | | | | | | | | (http://crrev.com/885453002#ps20001) Make the char cache dynamic in SkGlyphCache because it is rarely used. Landing on behalf of Herb. BUG=skia: Review URL: https://codereview.chromium.org/881953002
* Remove distance field generation and storage from SkGlyphCache.Gravatar jvanverth2015-01-07
| | | | | | BUG=skia:3103 Review URL: https://codereview.chromium.org/834103004
* Comment out unused names in src/core/SkGlyphCache.hGravatar tomhudson2015-01-06
| | | | | | | | | | | | Android violates our encapsulation and depends on this file; to keep their compiles clean they want us to hide the names of unused parameters. Follow-up to https://codereview.chromium.org/726923002/. R=djsollen@google.com Review URL: https://codereview.chromium.org/839583005
* Remove unused SkGlyphCache::VisitAllCaches.Gravatar bungeman2014-08-18
| | | | | | | | R=reed@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/472153002
* 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
* 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
* Move distance field generation to the glyph cache.Gravatar commit-bot@chromium.org2014-04-14
| | | | | | | | | | | | | | Distance fields are currently created in GrTextStrike, which is the wrong place. This moves that to the glyph cache where it belongs. As part of my testing, I found that when we fall back to paths in the GrDistanceFieldTextContext it was not scaling them properly, so that's fixed in here too. R=robertphillips@google.com, reed@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/227593010 git-svn-id: http://skia.googlecode.com/svn/trunk@14193 2bbb7eff-a529-9590-31e7-b0007b416f81
* Minor changes to GrFontCache system.Gravatar commit-bot@chromium.org2014-04-01
| | | | | | | | | | | | The main change is parameterizing the GrAtlasMgr so it can have a different sized backing texture and a different number of plots. This is in support of the saveLayer cache which has a smaller backing texture and only one plot. R=jvanverth@google.com, bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/217423014 git-svn-id: http://skia.googlecode.com/svn/trunk@14011 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverting r12427Gravatar rmistry@google.com2013-12-02
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12428 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-12-02
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12427 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove unused fields from SkGlyphCache.Gravatar bungeman@google.com2013-11-26
| | | | | | Review URL: https://codereview.chromium.org/89423003 git-svn-id: http://skia.googlecode.com/svn/trunk@12407 2bbb7eff-a529-9590-31e7-b0007b416f81
* Guard against most unintentionally ephemeral SkAutoFoo instantiations.Gravatar commit-bot@chromium.org2013-11-18
| | | | | | | | | | | | | | | | | | | I think I applied the trick everywhere possible. Limitations: - can't be used with templated classes - all constructors and destructors must be defined inline A couple of the SkAutoFoo were unused in Skia, Chromium, and Android, so I deleted them. This change caught the same bugs Cary found in SkPath, plus one more in SampleApp. BUG= R=reed@google.com, caryclark@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/72603005 git-svn-id: http://skia.googlecode.com/svn/trunk@12301 2bbb7eff-a529-9590-31e7-b0007b416f81
* add counting to Globals, and refactor some for clarityGravatar reed@google.com2013-09-26
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/24447003 git-svn-id: http://skia.googlecode.com/svn/trunk@11484 2bbb7eff-a529-9590-31e7-b0007b416f81
* restore hash size to 8 bits, following windows fix in ↵Gravatar reed@google.com2013-07-10
| | | | | | 3591f7a4a56153349240dfc542cc61a11fab2487 git-svn-id: http://skia.googlecode.com/svn/trunk@9959 2bbb7eff-a529-9590-31e7-b0007b416f81
* move failable work outside of constructors for SkGlyphCache and ↵Gravatar reed@google.com2013-07-09
| | | | | | | | | | SkScalerContextGDI. If we fail, try to purge everything and try again, in case the failure was from memory/os-resource exhaustion (e.g. out of HDC handles in windows) BUG= Review URL: https://codereview.chromium.org/18132009 git-svn-id: http://skia.googlecode.com/svn/trunk@9930 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of r9581 (oops, fix missing change in 9532, setting hashbits to 8) ↵Gravatar robertphillips@google.com2013-07-03
| | | | | | due to Chromium assert failure (https://code.google.com/p/chromium/issues/detail?id=256476) git-svn-id: http://skia.googlecode.com/svn/trunk@9886 2bbb7eff-a529-9590-31e7-b0007b416f81
* combine glyph and image bulk alloc, and adjust initial alloc size, to reduce ↵Gravatar reed@google.com2013-06-19
| | | | | | | | | | | | total waste from 50% to 30% add diagnostics to measure cache efficiency BUG= Review URL: https://codereview.chromium.org/17449012 git-svn-id: http://skia.googlecode.com/svn/trunk@9691 2bbb7eff-a529-9590-31e7-b0007b416f81
* oops, fix missing change in 9532, setting hashbits to 8Gravatar reed@google.com2013-06-13
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@9581 2bbb7eff-a529-9590-31e7-b0007b416f81
* use 8 bits for fontcache hashGravatar reed@google.com2013-06-12
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@9532 2bbb7eff-a529-9590-31e7-b0007b416f81
* we only need one fontmetrics, since the paint (and fontcache) now know ↵Gravatar reed@google.com2013-05-08
| | | | | | | | | | explicitly if they are horizontal or vertical. Review URL: https://codereview.chromium.org/14940018 git-svn-id: http://skia.googlecode.com/svn/trunk@9058 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkTypeface* parameter to SkScalerContext (and its callers)Gravatar reed@google.com2013-03-19
| | | | | | | Use SkTypeface to create scalercontext instead of SkFontHost Review URL: https://codereview.chromium.org/12706010 git-svn-id: http://skia.googlecode.com/svn/trunk@8223 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7406 2bbb7eff-a529-9590-31e7-b0007b416f81
* Expose geometry and gamma on device.Gravatar bungeman@google.com2013-01-22
| | | | | | | https://codereview.appspot.com/6499101/ git-svn-id: http://skia.googlecode.com/svn/trunk@7317 2bbb7eff-a529-9590-31e7-b0007b416f81
* refactor some subclasses in SkFlattenable.h into SkPtrRecorder.h, in ↵Gravatar mike@reedtribe.org2012-08-12
| | | | | | | | | | preparation for privatizing SkPtrRecorder.h git-svn-id: http://skia.googlecode.com/svn/trunk@5046 2bbb7eff-a529-9590-31e7-b0007b416f81
* Split SkGlyph into its own header.Gravatar bungeman@google.com2012-07-24
| | | | | | | https://codereview.appspot.com/6434049/ git-svn-id: http://skia.googlecode.com/svn/trunk@4741 2bbb7eff-a529-9590-31e7-b0007b416f81
* add explicit purgeAll() so we don't get foiled by the min cache-limitGravatar reed@google.com2012-06-27
| | | | | | | call unref instead of delete on the GrFontScaler Review URL: https://codereview.appspot.com/6353045 git-svn-id: http://skia.googlecode.com/svn/trunk@4366 2bbb7eff-a529-9590-31e7-b0007b416f81
* Update the implementation of SkTypeface_android.h functions.Gravatar djsollen@google.com2012-06-01
| | | | | | | | | | | This CL removes the hardcoded mappings of FallbackScripts to a particular font file and replaces it with a dynamic mechanism that takes a style and representative character code for a given FallbackScript class and returns the most appropriate SkTypeface that contains that character code. Review URL: https://codereview.appspot.com/6197074 git-svn-id: http://skia.googlecode.com/svn/trunk@4111 2bbb7eff-a529-9590-31e7-b0007b416f81
* move FontCacheLimit implementations into SkGlyphCache.cpp, in prep for TLSGravatar reed@google.com2012-04-23
| | | | | | Review URL: https://codereview.appspot.com/6110043 git-svn-id: http://skia.googlecode.com/svn/trunk@3751 2bbb7eff-a529-9590-31e7-b0007b416f81
* cleanups in prep for tls cacheGravatar reed@google.com2012-04-23
| | | | | | Review URL: https://codereview.appspot.com/6109045 git-svn-id: http://skia.googlecode.com/svn/trunk@3749 2bbb7eff-a529-9590-31e7-b0007b416f81
* Merge changes from the android repo upstream to SkiaGravatar djsollen@google.com2012-02-15
| | | | | | Review URL: https://codereview.appspot.com/5545070 git-svn-id: http://skia.googlecode.com/svn/trunk@3199 2bbb7eff-a529-9590-31e7-b0007b416f81
* expose isSubpixel() on the cache, so SkDraw can know if it should expectGravatar reed@google.com2012-01-03
| | | | | | | | subpixel text (it may be that the paint requested it, but the scaler ignored it) git-svn-id: http://skia.googlecode.com/svn/trunk@2946 2bbb7eff-a529-9590-31e7-b0007b416f81
* up glyphcache hash table to 12bits (from 8bits).Gravatar reed@google.com2011-11-02
| | | | | | | | Experimenting shows that is the sweetspot when drawing lots of CJK git-svn-id: http://skia.googlecode.com/svn/trunk@2582 2bbb7eff-a529-9590-31e7-b0007b416f81
* Automatic update of all copyright notices to reflect new license terms.Gravatar epoger@google.com2011-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have manually examined all of these diffs and restored a few files that seem to require manual adjustment. The following files still need to be modified manually, in a separate CL: android_sample/SampleApp/AndroidManifest.xml android_sample/SampleApp/res/layout/layout.xml android_sample/SampleApp/res/menu/sample.xml android_sample/SampleApp/res/values/strings.xml android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java experimental/CiCarbonSampleMain.c experimental/CocoaDebugger/main.m experimental/FileReaderApp/main.m experimental/SimpleCocoaApp/main.m experimental/iOSSampleApp/Shared/SkAlertPrompt.h experimental/iOSSampleApp/Shared/SkAlertPrompt.m experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig gpu/src/android/GrGLDefaultInterface_android.cpp gyp/common.gypi gyp_skia include/ports/SkHarfBuzzFont.h include/views/SkOSWindow_wxwidgets.h make.bat make.py src/opts/memset.arm.S src/opts/memset16_neon.S src/opts/memset32_neon.S src/opts/opts_check_arm.cpp src/ports/SkDebug_brew.cpp src/ports/SkMemory_brew.cpp src/ports/SkOSFile_brew.cpp src/ports/SkXMLParser_empty.cpp src/utils/ios/SkImageDecoder_iOS.mm src/utils/ios/SkOSFile_iOS.mm src/utils/ios/SkStream_NSData.mm tests/FillPathTest.cpp Review URL: http://codereview.appspot.com/4816058 git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
* coding styleGravatar mike@reedtribe.org2011-04-09
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1092 2bbb7eff-a529-9590-31e7-b0007b416f81
* support lcd16 in text atlas (sans shader support)Gravatar reed@google.com2011-03-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@939 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement SkScalerContext_Windows::generateGlyphCount() and provide access ↵Gravatar ctguil@chromium.org2011-03-04
| | | | | | | | | | via SkGlyphCache interface. * This will be used by PDF font code. Review URL: http://codereview.appspot.com/4261042 git-svn-id: http://skia.googlecode.com/svn/trunk@888 2bbb7eff-a529-9590-31e7-b0007b416f81