[Webkit-unassigned] [Bug 157132] [FreeType] ASSERTION FAILED: !lookupForWriting(Extractor::extract(entry)).second in FontCache::getVerticalData()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 28 08:26:48 PDT 2016


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
 Attachment #277613|review?                     |review+
              Flags|                            |

--- Comment #2 from Darin Adler <darin at apple.com> ---
Comment on attachment 277613
  --> https://bugs.webkit.org/attachment.cgi?id=277613

View in context: https://bugs.webkit.org/attachment.cgi?id=277613&action=review

> Source/WebCore/platform/graphics/FontCache.cpp:326
> +        if (!data->isOpenType()) {
> +            fontVerticalDataCache().remove(addResult.iterator);
> +            return nullptr;
> +        }

This isn’t good, because it will not cache the negative result and so if OpenTypeVerticalData::create returns something that is not OpenType then it will call OpenTypeVerticalData::create again and again every time this function is called. And it will also add/remove an element to/from the hash map every time.

I think what we want instead is:

    if (!data->isOpenType())
        data = nullptr;

We will cache a nullptr and not call OpenTypeVerticalData::create again next time.

Separately, I also think it’s peculiar that OpenTypeVerticalData::create can create something that returns false to isOpenType. There’s some kind of naming mistake there. I would think, given its name, that function would return nullptr if the data is "not OpenType".

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160428/10d85005/attachment-0001.html>

More information about the webkit-unassigned mailing list