diff options
author | arthurhsu@chromium.org <arthurhsu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-23 20:09:06 +0000 |
---|---|---|
committer | arthurhsu@chromium.org <arthurhsu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-23 20:09:06 +0000 |
commit | 74e8dc38735eabd488c05f663a5f641c1103d249 (patch) | |
tree | 1cfd3404c3dd94875777fe5ac404359afc1d1847 /skia | |
parent | cb1b585553851c906543ccb3a8e7b5d4781cae74 (diff) | |
download | chromium_src-74e8dc38735eabd488c05f663a5f641c1103d249.zip chromium_src-74e8dc38735eabd488c05f663a5f641c1103d249.tar.gz chromium_src-74e8dc38735eabd488c05f663a5f641c1103d249.tar.bz2 |
Implement skia sandbox callback
BUG=103032
TEST=none
Review URL: http://codereview.chromium.org/8566026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111400 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r-- | skia/ext/skia_sandbox_support_win.cc | 24 | ||||
-rw-r--r-- | skia/ext/skia_sandbox_support_win.h | 17 | ||||
-rw-r--r-- | skia/skia.gyp | 3 |
3 files changed, 44 insertions, 0 deletions
diff --git a/skia/ext/skia_sandbox_support_win.cc b/skia/ext/skia_sandbox_support_win.cc new file mode 100644 index 0000000..13efb80 --- /dev/null +++ b/skia/ext/skia_sandbox_support_win.cc @@ -0,0 +1,24 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "skia_sandbox_support_win.h" +#include "SkFontHost.h" +#include "SkTypeface_win.h" + +static SkiaEnsureTypefaceAccessible g_skia_ensure_typeface_accessible = NULL; + +SK_API void SetSkiaEnsureTypefaceAccessible(SkiaEnsureTypefaceAccessible func) { + // This function is supposed to be called once in process life time. + SkASSERT(g_skia_ensure_typeface_accessible == NULL); + g_skia_ensure_typeface_accessible = func; +} + +// static +void SkFontHost::EnsureTypefaceAccessible(const SkTypeface& typeface) { + if (g_skia_ensure_typeface_accessible) { + LOGFONT lf; + SkLOGFONTFromTypeface(&typeface, &lf); + g_skia_ensure_typeface_accessible(lf); + } +} diff --git a/skia/ext/skia_sandbox_support_win.h b/skia/ext/skia_sandbox_support_win.h new file mode 100644 index 0000000..62c35cc --- /dev/null +++ b/skia/ext/skia_sandbox_support_win.h @@ -0,0 +1,17 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SKIA_EXT_SKIA_SANDBOX_SUPPORT_WIN_H_ +#define SKIA_EXT_SKIA_SANDBOX_SUPPORT_WIN_H_ +#pragma once + +#include <windows.h> + +#include "SkPreConfig.h" + +typedef void (*SkiaEnsureTypefaceAccessible)(LOGFONT font); + +SK_API void SetSkiaEnsureTypefaceAccessible(SkiaEnsureTypefaceAccessible func); + +#endif // SKIA_EXT_SKIA_SANDBOX_SUPPORT_WIN_H_ diff --git a/skia/skia.gyp b/skia/skia.gyp index 653d2b1..2cc417c 100644 --- a/skia/skia.gyp +++ b/skia/skia.gyp @@ -692,6 +692,8 @@ 'ext/platform_device_mac.cc', 'ext/platform_device_win.cc', 'ext/SkMemory_new_handler.cpp', + 'ext/skia_sandbox_support_win.h', + 'ext/skia_sandbox_support_win.cc', 'ext/skia_utils_mac.mm', 'ext/skia_utils_mac.h', 'ext/skia_utils_win.cc', @@ -876,6 +878,7 @@ 'sources!': [ '../third_party/skia/src/core/SkMMapStream.cpp', '../third_party/skia/src/ports/SkTime_Unix.cpp', + '../third_party/skia/src/ports/SkFontHost_sandbox_none.cpp', 'ext/SkThread_chrome.cc', ], 'include_dirs': [ |