diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-22 19:53:33 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-22 19:53:33 +0000 |
commit | 3c22b1893efad9bbe786bd5c25a7fbf499ac8e48 (patch) | |
tree | fde84179b3c1889e0a729ed4a83c2f57696acc64 /chrome/renderer/renderer_sandbox_support_linux.cc | |
parent | 5951b5c1c74422be6793df444364f2f5436685ff (diff) | |
download | chromium_src-3c22b1893efad9bbe786bd5c25a7fbf499ac8e48.zip chromium_src-3c22b1893efad9bbe786bd5c25a7fbf499ac8e48.tar.gz chromium_src-3c22b1893efad9bbe786bd5c25a7fbf499ac8e48.tar.bz2 |
WebKit roll 55080:55089
Also merging in this Chromium side patch to match:
Linux: add plumbing for fontconfig on per-strike basis
fontconfig on Linux can change the render preferences on a per strike
basis (a strike a combination of face and size). Because of this, we
need to query fontconfig each time a new FontPlatformData is created
for a new size.
This is the Chromium side of https://bugs.webkit.org/show_bug.cgi?id=33065
BUG=18159
TEST=A new renderer should respect settings in ~/.fonts.conf
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/renderer_sandbox_support_linux.cc')
-rw-r--r-- | chrome/renderer/renderer_sandbox_support_linux.cc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/chrome/renderer/renderer_sandbox_support_linux.cc b/chrome/renderer/renderer_sandbox_support_linux.cc index a08fff1..1c4a60d 100644 --- a/chrome/renderer/renderer_sandbox_support_linux.cc +++ b/chrome/renderer/renderer_sandbox_support_linux.cc @@ -10,6 +10,8 @@ #include "chrome/common/chrome_descriptors.h" #include "chrome/common/sandbox_methods_linux.h" +#include "third_party/WebKit/WebKit/chromium/public/linux/WebFontRenderStyle.h" + namespace renderer_sandbox_support { std::string getFontFamilyForCharacters(const uint16_t* utf16, size_t num_utf16) { @@ -35,4 +37,40 @@ std::string getFontFamilyForCharacters(const uint16_t* utf16, size_t num_utf16) return family_name; } +void getRenderStyleForStrike(const char* family, int sizeAndStyle, + WebKit::WebFontRenderStyle* out) { + Pickle request; + request.WriteInt(LinuxSandbox::METHOD_GET_STYLE_FOR_STRIKE); + request.WriteString(family); + request.WriteInt(sizeAndStyle); + + uint8_t buf[512]; + const int sandbox_fd = + kSandboxIPCChannel + base::GlobalDescriptors::kBaseDescriptor; + const ssize_t n = base::SendRecvMsg(sandbox_fd, buf, sizeof(buf), NULL, + request); + + out->setDefaults(); + if (n == -1) { + return; + } + + Pickle reply(reinterpret_cast<char*>(buf), n); + void* pickle_iter = NULL; + int useBitmaps, useAutoHint, useHinting, hintStyle, useAntiAlias, useSubpixel; + if (reply.ReadInt(&pickle_iter, &useBitmaps) && + reply.ReadInt(&pickle_iter, &useAutoHint) && + reply.ReadInt(&pickle_iter, &useHinting) && + reply.ReadInt(&pickle_iter, &hintStyle) && + reply.ReadInt(&pickle_iter, &useAntiAlias) && + reply.ReadInt(&pickle_iter, &useSubpixel)) { + out->useBitmaps = useBitmaps; + out->useAutoHint = useAutoHint; + out->useHinting = useHinting; + out->hintStyle = hintStyle; + out->useAntiAlias = useAntiAlias; + out->useSubpixel = useSubpixel; + } +} + } // namespace render_sandbox_support |