2011-06-03 Cary Clark <caryclark@google.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Jun 2011 00:22:09 +0000 (00:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Jun 2011 00:22:09 +0000 (00:22 +0000)
commit65a30652826f5c358e6fd20f37e6efb8d7fe2123
tree247b19fc73d399fd9fb562b5ac20f8ab92eb8869
parentd3fa683f1c0d39d6e008b3fc185049cd3d3d34b5
2011-06-03  Cary Clark  <caryclark@google.com>

        Reviewed by Eric Seidel.

        Support FontCustomPlatformData on Skia-Mac-Chrome variant
        https://bugs.webkit.org/show_bug.cgi?id=62040

        Canvas text is only recognized by Skia if it is registered
        by creating a new SkTypeface. Skia uses CGFont to measure
        and render the glyphs, then takes care of managing the glyph
        cache.

        Skia on Mac Chrome is not yet enabled, so this change
        does not affect existing code, and requires no new tests.

        * platform/graphics/mac/FontCustomPlatformData.cpp:
        (WebCore::RemoteFontStream::RemoteFontStream):
        (WebCore::RemoteFontStream::~RemoteFontStream):
        (WebCore::RemoteFontStream::rewind):
        (WebCore::RemoteFontStream::read):
        Turn the buffer into a stream. This is identical to
        the implementation in skia/FontCustomPlatformData.cpp.
        While that file could be modified instead of this one,
        it was simpler to add SkTypeface streaming to this instead
        of adding all CGFont support to the skia platform file.

        (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
        Release the SkTypeface reference.

        (WebCore::createFontCustomPlatformData):
        Associate the buffer stream with a SkTypeface so Skia
        can find the custom font data.

        * platform/graphics/mac/FontCustomPlatformData.h:
        (WebCore::FontCustomPlatformData::FontCustomPlatformData):
        Add a slot to hold the SkTypeface.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@88081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h