summaryrefslogtreecommitdiffstats
path: root/content/ppapi_plugin
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-07 09:23:33 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-07 09:23:33 +0000
commit94851d93dba32d6555cbea703760011c0ad23b84 (patch)
treefb5597dda2837189485573714be752727521f0f1 /content/ppapi_plugin
parent0384c1b7fd4aa1bead47e24fa3a6935167737f98 (diff)
downloadchromium_src-94851d93dba32d6555cbea703760011c0ad23b84.zip
chromium_src-94851d93dba32d6555cbea703760011c0ad23b84.tar.gz
chromium_src-94851d93dba32d6555cbea703760011c0ad23b84.tar.bz2
[Mac] Chromium side of ATS*() -> CGFont Conversion for OOP font loading.
Together with wek.it/66935 this CL converts the OOP font loading code to use CGFonts to load fonts sent over the wire. This is needed due to a bug in ATSFontDeactivate() on 10.7. BUG=93191 TEST=Need WebKit-side patch to active this so can't test this CL in isolation. Review URL: http://codereview.chromium.org/7791023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99934 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/ppapi_plugin')
-rw-r--r--content/ppapi_plugin/ppapi_webkitplatformsupport_impl.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/content/ppapi_plugin/ppapi_webkitplatformsupport_impl.cc b/content/ppapi_plugin/ppapi_webkitplatformsupport_impl.cc
index 7a17787..f5b425c 100644
--- a/content/ppapi_plugin/ppapi_webkitplatformsupport_impl.cc
+++ b/content/ppapi_plugin/ppapi_webkitplatformsupport_impl.cc
@@ -26,6 +26,10 @@ using WebKit::WebSandboxSupport;
using WebKit::WebString;
using WebKit::WebUChar;
+// TODO(jeremy): Remove once http://webk.it/66935 lands.
+typedef uintptr_t ATSFontContainerRef;
+typedef struct CGFont* CGFontRef;
+
class PpapiWebKitPlatformSupportImpl::SandboxSupport : public WebSandboxSupport {
public:
virtual ~SandboxSupport() {}
@@ -34,6 +38,9 @@ class PpapiWebKitPlatformSupportImpl::SandboxSupport : public WebSandboxSupport
virtual bool ensureFontLoaded(HFONT);
#elif defined(OS_MACOSX)
virtual bool loadFont(
+ NSFont* srcFont, CGFontRef* out, uint32_t* fontID);
+ // TODO(jeremy): Remove once http://webk.it/66935 lands.
+ virtual bool loadFont(
NSFont* srcFont, ATSFontContainerRef* out, uint32_t* fontID);
#elif defined(OS_POSIX)
virtual WebString getFontFamilyForCharacters(
@@ -66,8 +73,21 @@ bool PpapiWebKitPlatformSupportImpl::SandboxSupport::ensureFontLoaded(
#elif defined(OS_MACOSX)
-bool PpapiWebKitPlatformSupportImpl::SandboxSupport::loadFont(NSFont* srcFont,
- ATSFontContainerRef* out, uint32_t* fontID) {
+bool PpapiWebKitPlatformSupportImpl::SandboxSupport::loadFont(
+ NSFont* src_font,
+ CGFontRef* out,
+ uint32_t* font_id) {
+ // TODO(brettw) this should do the something similar to what
+ // RendererWebKitClientImpl does and request that the browser load the font.
+ NOTIMPLEMENTED();
+ return false;
+}
+
+// TODO(jeremy): Remove once http://webk.it/66935 lands.
+bool PpapiWebKitPlatformSupportImpl::SandboxSupport::loadFont(
+ NSFont* src_font,
+ ATSFontContainerRef* out,
+ uint32_t* font_id) {
// TODO(brettw) this should do the something similar to what
// RendererWebKitPlatformSupportImpl does and request that the browser load
// the font.