aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontHost_fontconfig.cpp
Commit message (Collapse)AuthorAge
* SkTypeface to use SkStreamAsset.Gravatar bungeman2015-01-27
| | | | | | | SkTypeface already requires typeface streams to support SkStreamAsset in practice, and in practice all users are already supplying them. Review URL: https://codereview.chromium.org/869763002
* Make SkStream *not* ref counted.Gravatar scroggo2015-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkStream is a stateful object, so it does not make sense for it to have multiple owners. Make SkStream inherit directly from SkNoncopyable. Update methods which previously called SkStream::ref() (e.g. SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(), which required the existing owners to call SkStream::unref()) to take ownership of their SkStream parameters and delete when done (including on failure). Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some cases this means heap allocating streams that were previously stack allocated. Respect ownership rules of SkTypeface::CreateFromStream() and SkImageDecoder::buildTileIndex(). Update the comments for exceptional methods which do not affect the ownership of their SkStream parameters (e.g. SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be explicit about ownership. Remove test_stream_life, which tested that buildTileIndex() behaved correctly when SkStream was a ref counted object. The test does not make sense now that it is not. In SkPDFStream, remove the SkMemoryStream member. Instead of using it, create a new SkMemoryStream to pass to fDataStream (which is now an SkAutoTDelete). Make other pdf rasterizers behave like SkPDFDocumentToBitmap. SkPDFDocumentToBitmap delete the SkStream, so do the same in the following pdf rasterizers: SkPopplerRasterizePDF SkNativeRasterizePDF SkNoRasterizePDF Requires a change to Android, which currently treats SkStreams as ref counted objects. Review URL: https://codereview.chromium.org/849103004
* Replace SkTypeface::Style with SkFontStyle.Gravatar bungeman2014-10-20
| | | | | | Committed: https://skia.googlesource.com/skia/+/43b8b36b20ae00e2d78421c4cda1f3f922983a20 Review URL: https://codereview.chromium.org/488143002
* Revert of Replace SkTypeface::Style with SkFontStyle. (patchset #9 id:160001 ↵Gravatar mtklein2014-10-20
| | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.org/488143002/) Reason for revert: CrOS GM failures: [*] 2 ExpectationsMismatch: fontmgr_iter_565.png fontmgr_iter_8888.png Original issue's description: > Replace SkTypeface::Style with SkFontStyle. > > Committed: https://skia.googlesource.com/skia/+/43b8b36b20ae00e2d78421c4cda1f3f922983a20 TBR=reed@google.com,bungeman@google.com NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/667023002
* Replace SkTypeface::Style with SkFontStyle.Gravatar bungeman2014-10-20
| | | | Review URL: https://codereview.chromium.org/488143002
* 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
* Add onGetFamilyName to SkTypeface.Gravatar bungeman2014-09-17
| | | | | | | | | | | This speeds up and documents this particular feature of SkTypeface and also frees up SkFontDescriptor to be used only in serialization. R=reed@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/574873002
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002
* Remove SK_FONT_HOST_DOES_NOT_USE_FONTMGR and guarded code.Gravatar bungeman2014-08-20
| | | | | | | | | | This define is no longer needed or set, so remove it from the code. R=tomhudson@google.com, djsollen@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/488083004
* Update find_name_and_attributes to take ttc index and rename to ↵Gravatar bungeman2014-07-11
| | | | | | | | | | | | SkTypeface_FreeType::ScanFont. The name 'ScanFont' is to mirror the naming convention of similar functions in FontConfig. R=tomhudson@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/382053003
* Uses optional mutex to guard construction of the singleton, whichGravatar tomhudson2014-07-01
| | | | | | | | | | | | | | | | | initializes the non-threadsafe libfontconfig. Without this change, Skia's parallel path ops test runner crashes 6/10 and hangs 2/10 on startup; with this change, 0/10 problems. BUG=skia:2693 R=mtklein@google.com, bungeman@google.com, reed@google.com Committed: https://skia.googlesource.com/skia/+/df022f5972ae6a2a1d96d15c50eca52cade3abd8 Committed: https://skia.googlesource.com/skia/+/60b08a0adfe73f593af62c8d3f55958438360e1b Author: tomhudson@chromium.org Review URL: https://codereview.chromium.org/355573006
* Revert of Fix race condition in parallel font initialization. ↵Gravatar mtklein2014-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/355573006/) Reason for revert: canaries still slightly broken Original issue's description: > Fix race condition in parallel font initialization. > > Uses a mutex to guard construction of the singleton, which initialies > the non-threadsafe libfontconfig. Without this change, the parallel > path ops test runner crashes 6/10 and hangs 2/10 on startup; with this > change, 0/10 problems. > > BUG=skia:2693 > R=mtklein@google.com,bungeman@google.com > > Committed: https://skia.googlesource.com/skia/+/df022f5972ae6a2a1d96d15c50eca52cade3abd8 > > Committed: https://skia.googlesource.com/skia/+/60b08a0adfe73f593af62c8d3f55958438360e1b R=bungeman@google.com, reed@google.com, tomhudson@google.com, tomhudson@chromium.org TBR=bungeman@google.com, reed@google.com, tomhudson@chromium.org, tomhudson@google.com NOTREECHECKS=true NOTRY=true BUG=skia:2693 Author: mtklein@google.com Review URL: https://codereview.chromium.org/354133004
* Fix race condition in parallel font initialization.Gravatar tomhudson2014-07-01
| | | | | | | | | | | | | | | | Uses a mutex to guard construction of the singleton, which initialies the non-threadsafe libfontconfig. Without this change, the parallel path ops test runner crashes 6/10 and hangs 2/10 on startup; with this change, 0/10 problems. BUG=skia:2693 R=mtklein@google.com, bungeman@google.com, reed@google.com, tomhudson@google.com Committed: https://skia.googlesource.com/skia/+/df022f5972ae6a2a1d96d15c50eca52cade3abd8 Author: tomhudson@chromium.org Review URL: https://codereview.chromium.org/355573006
* Revert of Fix race condition in parallel font initialization. ↵Gravatar reed2014-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/355573006/) Reason for revert: breaks chrome builds Original issue's description: > Fix race condition in parallel font initialization. > > Uses a mutex to guard construction of the singleton, which initialies > the non-threadsafe libfontconfig. Without this change, the parallel > path ops test runner crashes 6/10 and hangs 2/10 on startup; with this > change, 0/10 problems. > > BUG=skia:2693 > R=mtklein@google.com,bungeman@google.com > > Committed: https://skia.googlesource.com/skia/+/df022f5972ae6a2a1d96d15c50eca52cade3abd8 R=mtklein@google.com, bungeman@google.com, reed@google.com, tomhudson@google.com, tomhudson@chromium.org TBR=bungeman@google.com, mtklein@google.com, reed@google.com, tomhudson@chromium.org, tomhudson@google.com NOTREECHECKS=true NOTRY=true BUG=skia:2693 Author: reed@chromium.org Review URL: https://codereview.chromium.org/365503003
* Fix race condition in parallel font initialization.Gravatar tomhudson2014-06-30
| | | | | | | | | | | | | | Uses a mutex to guard construction of the singleton, which initialies the non-threadsafe libfontconfig. Without this change, the parallel path ops test runner crashes 6/10 and hangs 2/10 on startup; with this change, 0/10 problems. BUG=skia:2693 R=mtklein@google.com, bungeman@google.com, reed@google.com, tomhudson@google.com Author: tomhudson@chromium.org Review URL: https://codereview.chromium.org/355573006
* Factory methods for heap-allocated SkTypeface objects.Gravatar commit-bot@chromium.org2014-04-07
| | | | | | | | | | | | | | | | | 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 SkTypeface and its subclasses non-public and instead provides factory methods for creating these objects on the heap. BUG=skia:2187 R=scroggo@google.com, bungeman@google.com Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/227693003 git-svn-id: http://skia.googlecode.com/svn/trunk@14080 2bbb7eff-a529-9590-31e7-b0007b416f81
* Android FontHost cannot use FontMgr yet.Gravatar bungeman@google.com2013-11-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12221 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SK_FONTHOST_USES_FONTMGR.Gravatar bungeman@google.com2013-11-11
| | | | | | Review URL: https://codereview.chromium.org/66783003 git-svn-id: http://skia.googlecode.com/svn/trunk@12217 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix fontconfig backend to only cache new fonts if their outName was uniqueGravatar reed@google.com2013-09-18
| | | | | | | | | BUG= R=bungeman@google.com Review URL: https://codereview.chromium.org/23710072 git-svn-id: http://skia.googlecode.com/svn/trunk@11364 2bbb7eff-a529-9590-31e7-b0007b416f81
* Update the freetype backed fonthost to keep the style and fixed width ↵Gravatar djsollen@google.com2013-09-06
| | | | | | | | | | | | attributes for a font stream. This fixes a regression in Android when switching from FontHost_android R=reed@google.com Review URL: https://codereview.chromium.org/23966003 git-svn-id: http://skia.googlecode.com/svn/trunk@11134 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement onGetTableTags and onGetTableData on Windows.Gravatar bungeman@google.com2013-08-01
| | | | | | | | | Implements these and removes default implementation, making the declaration in SkTypeface pure virtual. Review URL: https://codereview.chromium.org/20672004 git-svn-id: http://skia.googlecode.com/svn/trunk@10500 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-08-01
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@10477 2bbb7eff-a529-9590-31e7-b0007b416f81
* adapt FontConfig to use SK_FONTHOST_USES_FONTMGRGravatar reed@google.com2013-07-31
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/21331003 git-svn-id: http://skia.googlecode.com/svn/trunk@10463 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix leak in SkFontHost_fontconfig temporary code.Gravatar bungeman@google.com2013-06-06
| | | | | | | https://codereview.chromium.org/16525003 git-svn-id: http://skia.googlecode.com/svn/trunk@9460 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix issues related to resolving fonts based on name.Gravatar djsollen@google.com2013-06-05
| | | | | | | | | 1) non-system font files are not added to the cache. 2) We cache the default fonts for quick lookup. Review URL: https://codereview.chromium.org/16439004 git-svn-id: http://skia.googlecode.com/svn/trunk@9441 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change SkStream.Gravatar bungeman@google.com2013-05-29
| | | | | | | https://codereview.chromium.org/15298009/ git-svn-id: http://skia.googlecode.com/svn/trunk@9312 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move the FontConfigTypeface class into private header.Gravatar djsollen@google.com2013-05-15
| | | | | | | | R=reed@google.com Review URL: https://codereview.chromium.org/15111004 git-svn-id: http://skia.googlecode.com/svn/trunk@9154 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-05-14
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@9117 2bbb7eff-a529-9590-31e7-b0007b416f81
* add separate impl file for SkFontMgr_fontconfig, so we don't poluteGravatar reed@google.com2013-05-13
| | | | | | | | | | | SkFontHost_fontconfig, which should be sharable w/ android. Eventaully we will remove that FontHost file completely, and just use the SkFontMgr. R=djsollen@google.com Review URL: https://codereview.chromium.org/15077008 git-svn-id: http://skia.googlecode.com/svn/trunk@9114 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add missing unistd.h include after r8765.Gravatar commit-bot@chromium.org2013-04-22
| | | | | | | | | | | TEST=Build with GCC 4.8.0 and glibc 2.17. R=reed@google.com, jvanverth@google.com, bsalomon@google.com Author: raphael.kubo.da.costa@intel.com Review URL: https://chromiumcodereview.appspot.com/14401007 git-svn-id: http://skia.googlecode.com/svn/trunk@8809 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix refcnts for singleton fontconfig-directGravatar reed@google.com2013-04-22
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8807 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-04-20
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8785 2bbb7eff-a529-9590-31e7-b0007b416f81
* use SkDataTable to return familyNames for fontmgrGravatar reed@google.com2013-04-19
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8781 2bbb7eff-a529-9590-31e7-b0007b416f81
* check-point for new fontmgr on linuxGravatar reed@google.com2013-04-19
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8765 2bbb7eff-a529-9590-31e7-b0007b416f81
* add dummpy SkFontMgr::Factory() impl to font backends, so we can start ↵Gravatar reed@google.com2013-03-27
| | | | | | | | testing it Review URL: https://codereview.chromium.org/13119021 git-svn-id: http://skia.googlecode.com/svn/trunk@8415 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkFontHost::NextLogicalFont, and add android-specific functionGravatar reed@google.com2013-03-26
| | | | | | | | SkAndroidNextLogicalTypeface git-svn-id: http://skia.googlecode.com/svn/trunk@8386 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-03-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8383 2bbb7eff-a529-9590-31e7-b0007b416f81
* land https://codereview.chromium.org/12676024Gravatar reed@google.com2013-03-25
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8359 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkFontHost::OpenStream(), now subsumed by SkTypeface::openStream()Gravatar reed@google.com2013-03-22
| | | | | | | remove obsolete/abandoned SkFontHost_freetype_mac.cpp Review URL: https://codereview.chromium.org/13008019 git-svn-id: http://skia.googlecode.com/svn/trunk@8342 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-03-22
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8324 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkFontHost::GetFileNameGravatar mike@reedtribe.org2013-03-22
| | | | | | | | | All remaining impls were either empty, or always return 0 for ttcIndex (its only value). This functionality is now totally subsumed by SkTypeface::openStream() git-svn-id: http://skia.googlecode.com/svn/trunk@8321 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove GetTable* APIs from SkFontHost, and rely on SkTypeface::onGetTable*Gravatar reed@google.com2013-03-21
| | | | | | | default impls call SkFontStream, and rely on SkTypeface::onOpenStream Review URL: https://codereview.chromium.org/13001002 git-svn-id: http://skia.googlecode.com/svn/trunk@8310 2bbb7eff-a529-9590-31e7-b0007b416f81
* add virtual SkTypeface::onOpenStream and override that for fontconfigGravatar reed@google.com2013-03-21
| | | | | | | | | | | (other ports to follow) When this is complete, we will be able to remove from SkFontHost - OpenStream - GetFileName Review URL: https://codereview.chromium.org/12988002 git-svn-id: http://skia.googlecode.com/svn/trunk@8299 2bbb7eff-a529-9590-31e7-b0007b416f81
* When we read from a RemoteFontStream (might happen maybe with other ↵Gravatar edisonn@google.com2013-03-21
| | | | | | | | streams), stream's data might be partially consumed. If so, when we try to read the whole content of the font, we fail, because we read only part of the content. Review URL: https://codereview.chromium.org/12926004 git-svn-id: http://skia.googlecode.com/svn/trunk@8291 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkFontHost::CreateScalerContextGravatar reed@google.com2013-03-19
| | | | | | Review URL: https://codereview.chromium.org/12593013 git-svn-id: http://skia.googlecode.com/svn/trunk@8228 2bbb7eff-a529-9590-31e7-b0007b416f81
* use SkStream::NewFromFile()Gravatar mike@reedtribe.org2013-03-19
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8210 2bbb7eff-a529-9590-31e7-b0007b416f81
* comment out debugging printfsGravatar reed@google.com2013-03-13
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8127 2bbb7eff-a529-9590-31e7-b0007b416f81
* add (temp) SkFontLCDConfig class to hold LCD getters/setters. This will allowGravatar reed@google.com2013-03-12
| | | | | | | | | | us to make SkFontHost.h private (once webkit switches to the SkFontLCDConfig api) Stage 2 is to either move this code into chrome/webkit, or change the callers to perform their own globals management. Review URL: https://codereview.chromium.org/12623011 git-svn-id: http://skia.googlecode.com/svn/trunk@8107 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixing some warnings on LinuxGravatar sugoi@google.com2013-03-07
| | | | | | | There were only a few warnings left, so I fixed them and enabled the unused variable warning by removing the "-Wno-unused" flag. Only the -Wno-unused-parameter remains for now (could be removed later). Review URL: https://codereview.chromium.org/12480002 git-svn-id: http://skia.googlecode.com/svn/trunk@8030 2bbb7eff-a529-9590-31e7-b0007b416f81
* change FontIdentity to explicitly hold ttcIndex and ID, so we can use both ↵Gravatar reed@google.com2013-03-06
| | | | | | | | | | in the IPC version in chrome. git-svn-id: http://skia.googlecode.com/svn/trunk@8005 2bbb7eff-a529-9590-31e7-b0007b416f81