diff options
author | 2017-07-27 18:09:24 -0400 | |
---|---|---|
committer | 2017-07-27 22:49:16 +0000 | |
commit | ce3f44a866a440a4da75562a038d35fd6584a483 (patch) | |
tree | b0b0c03a04d098be164b6b5b28e9e237d59e823f /gn | |
parent | 16d8ec66cdce2f30ce89b87066d3ac7a244c460d (diff) |
Don't re-enter mutex in SkFontMgr_fontconfig.
The FCLocker lock cannot be held while calling fTFCache::add. The
~SkTypeface_fontconfig method must take the FCLocker lock to destroy its
FcPattern since a typeface may be destroyed by any last owner. However,
fTFCache may be the last owner of some of its cached typefaces, and so a
purge when calling ::add to make space for the new entry may cause a
typeface to be destroyed. As a result, createTypefaceFromFcPattern must
not hold the FCLocker lock when calling fTFCache::add.
Fortunately, the FCLocker lock is only needed to serialize calls into
FontConfig. If acquire and release were free then they would be used
around each individual call to FontConfig. As a result it is fine to
give up the lock at any point in Skia code so long as no FontConfig
calls are made while the FCLocker lock is not held.
Change-Id: I37224d4b38bf88ace482496ce7530c84158d2d2e
Reviewed-on: https://skia-review.googlesource.com/27663
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'gn')
0 files changed, 0 insertions, 0 deletions