Add UWP support
Bug: skia:11102 Change-Id: I4ed9e44099cd780c5cdede3eb179c0e6a92d3ce5 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345219 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Chris Bracken <cbracken@google.com>
This commit is contained in:
parent
a0e407d4b7
commit
b8c0dab90b
3
AUTHORS
3
AUTHORS
@ -30,6 +30,7 @@ Igalia <*@igalia.com>
|
|||||||
Intel <*@intel.com>
|
Intel <*@intel.com>
|
||||||
Ion Rosca <rosca@adobe.com>
|
Ion Rosca <rosca@adobe.com>
|
||||||
Jacek Caban <cjacek@gmail.com>
|
Jacek Caban <cjacek@gmail.com>
|
||||||
|
James Clarke <james@clarkezone.io>
|
||||||
Jeff Muizelaar <jmuizelaar@mozilla.com>
|
Jeff Muizelaar <jmuizelaar@mozilla.com>
|
||||||
Jongdeok Kim <jongdeok.kim@navercorp.com>
|
Jongdeok Kim <jongdeok.kim@navercorp.com>
|
||||||
Lee Salzman <lsalzman@mozilla.com>
|
Lee Salzman <lsalzman@mozilla.com>
|
||||||
@ -69,4 +70,4 @@ Zhuo Qingliang <zhuo.dev@gmail.com>
|
|||||||
Mainframe North <*@mainframe.co.uk>
|
Mainframe North <*@mainframe.co.uk>
|
||||||
JetBrains <*@jetbrains.com>
|
JetBrains <*@jetbrains.com>
|
||||||
Vibe Inc <*@vibe.us>
|
Vibe Inc <*@vibe.us>
|
||||||
Scene Group Ltd. <*@scenegroup.co>
|
Scene Group Ltd. <*@scenegroup.co>
|
24
BUILD.gn
24
BUILD.gn
@ -94,6 +94,12 @@ config("skia_private") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config("skia_winuwp") {
|
||||||
|
if (skia_enable_winuwp) {
|
||||||
|
defines = [ "WINUWP" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
|
# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
|
||||||
config("skia_library") {
|
config("skia_library") {
|
||||||
visibility = [ "./*" ]
|
visibility = [ "./*" ]
|
||||||
@ -248,6 +254,7 @@ template("optional") {
|
|||||||
if (defined(invoker.public_include_dirs)) {
|
if (defined(invoker.public_include_dirs)) {
|
||||||
include_dirs = invoker.public_include_dirs
|
include_dirs = invoker.public_include_dirs
|
||||||
}
|
}
|
||||||
|
configs = [ ":skia_winuwp" ]
|
||||||
}
|
}
|
||||||
source_set(target_name) {
|
source_set(target_name) {
|
||||||
check_includes = false
|
check_includes = false
|
||||||
@ -263,6 +270,7 @@ template("optional") {
|
|||||||
if (defined(invoker.configs_to_remove)) {
|
if (defined(invoker.configs_to_remove)) {
|
||||||
configs -= invoker.configs_to_remove
|
configs -= invoker.configs_to_remove
|
||||||
}
|
}
|
||||||
|
configs += [ ":skia_winuwp" ]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
source_set(target_name) {
|
source_set(target_name) {
|
||||||
@ -283,6 +291,7 @@ template("optional") {
|
|||||||
sources = invoker.sources_when_disabled
|
sources = invoker.sources_when_disabled
|
||||||
}
|
}
|
||||||
configs += skia_library_configs
|
configs += skia_library_configs
|
||||||
|
configs += [ ":skia_winuwp" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -864,7 +873,7 @@ optional("gpu") {
|
|||||||
sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
|
sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
|
||||||
} else if (is_ios) {
|
} else if (is_ios) {
|
||||||
sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
|
sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
|
||||||
} else if (is_win) {
|
} else if (is_win && !skia_enable_winuwp) {
|
||||||
sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
|
sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
|
||||||
if (target_cpu != "arm64") {
|
if (target_cpu != "arm64") {
|
||||||
libs += [ "OpenGL32.lib" ]
|
libs += [ "OpenGL32.lib" ]
|
||||||
@ -1284,12 +1293,17 @@ component("skia") {
|
|||||||
"src/ports/SkOSLibrary_win.cpp",
|
"src/ports/SkOSLibrary_win.cpp",
|
||||||
]
|
]
|
||||||
libs += [
|
libs += [
|
||||||
"FontSub.lib",
|
|
||||||
"Ole32.lib",
|
"Ole32.lib",
|
||||||
"OleAut32.lib",
|
"OleAut32.lib",
|
||||||
"User32.lib",
|
|
||||||
"Usp10.lib",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (!skia_enable_winuwp) {
|
||||||
|
libs += [
|
||||||
|
"FontSub.lib",
|
||||||
|
"User32.lib",
|
||||||
|
"Usp10.lib",
|
||||||
|
]
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sources += [
|
sources += [
|
||||||
"src/ports/SkOSFile_posix.cpp",
|
"src/ports/SkOSFile_posix.cpp",
|
||||||
@ -1842,7 +1856,7 @@ if (skia_enable_tools) {
|
|||||||
sources += [ "tools/AutoreleasePool.mm" ]
|
sources += [ "tools/AutoreleasePool.mm" ]
|
||||||
frameworks += [ "Foundation.framework" ]
|
frameworks += [ "Foundation.framework" ]
|
||||||
}
|
}
|
||||||
} else if (is_win) {
|
} else if (is_win && !skia_enable_winuwp) {
|
||||||
libs += [ "DbgHelp.lib" ]
|
libs += [ "DbgHelp.lib" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ declare_args() {
|
|||||||
skia_enable_fontmgr_empty = false
|
skia_enable_fontmgr_empty = false
|
||||||
skia_enable_fontmgr_fuchsia = is_fuchsia
|
skia_enable_fontmgr_fuchsia = is_fuchsia
|
||||||
skia_enable_fontmgr_win = is_win
|
skia_enable_fontmgr_win = is_win
|
||||||
skia_enable_fontmgr_win_gdi = is_win
|
|
||||||
skia_enable_gpu = true
|
skia_enable_gpu = true
|
||||||
skia_enable_icu_ubrk_safeclone = false
|
skia_enable_icu_ubrk_safeclone = false
|
||||||
skia_enable_pdf = true
|
skia_enable_pdf = true
|
||||||
@ -29,6 +28,7 @@ declare_args() {
|
|||||||
skia_enable_svg = true
|
skia_enable_svg = true
|
||||||
skia_enable_tools = is_skia_dev_build
|
skia_enable_tools = is_skia_dev_build
|
||||||
skia_enable_gpu_debug_layers = is_skia_dev_build && is_debug
|
skia_enable_gpu_debug_layers = is_skia_dev_build && is_debug
|
||||||
|
skia_enable_winuwp = false
|
||||||
skia_generate_workarounds = false
|
skia_generate_workarounds = false
|
||||||
skia_include_multiframe_procs = false
|
skia_include_multiframe_procs = false
|
||||||
skia_lex = false
|
skia_lex = false
|
||||||
@ -106,6 +106,7 @@ declare_args() {
|
|||||||
skia_enable_fontmgr_custom_embedded = skia_use_freetype && !is_fuchsia
|
skia_enable_fontmgr_custom_embedded = skia_use_freetype && !is_fuchsia
|
||||||
skia_enable_fontmgr_custom_empty = skia_use_freetype
|
skia_enable_fontmgr_custom_empty = skia_use_freetype
|
||||||
skia_enable_fontmgr_fontconfig = skia_use_freetype && skia_use_fontconfig
|
skia_enable_fontmgr_fontconfig = skia_use_freetype && skia_use_fontconfig
|
||||||
|
skia_enable_fontmgr_win_gdi = is_win && !skia_enable_winuwp
|
||||||
skia_enable_fontmgr_FontConfigInterface =
|
skia_enable_fontmgr_FontConfigInterface =
|
||||||
skia_use_freetype && skia_use_fontconfig
|
skia_use_freetype && skia_use_fontconfig
|
||||||
skia_enable_nvpr = !skia_enable_flutter_defines
|
skia_enable_nvpr = !skia_enable_flutter_defines
|
||||||
|
@ -1288,12 +1288,15 @@ SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWrite(IDWriteFactory* factory,
|
|||||||
int defaultFamilyNameLen = 1;
|
int defaultFamilyNameLen = 1;
|
||||||
NONCLIENTMETRICSW metrics;
|
NONCLIENTMETRICSW metrics;
|
||||||
metrics.cbSize = sizeof(metrics);
|
metrics.cbSize = sizeof(metrics);
|
||||||
|
|
||||||
|
#ifndef SK_WINUWP
|
||||||
if (nullptr == fallback) {
|
if (nullptr == fallback) {
|
||||||
if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(metrics), &metrics, 0)) {
|
if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(metrics), &metrics, 0)) {
|
||||||
defaultFamilyName = metrics.lfMessageFont.lfFaceName;
|
defaultFamilyName = metrics.lfMessageFont.lfFaceName;
|
||||||
defaultFamilyNameLen = LF_FACESIZE;
|
defaultFamilyNameLen = LF_FACESIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif //SK_WINUWP
|
||||||
|
|
||||||
WCHAR localeNameStorage[LOCALE_NAME_MAX_LENGTH];
|
WCHAR localeNameStorage[LOCALE_NAME_MAX_LENGTH];
|
||||||
const WCHAR* localeName = L"";
|
const WCHAR* localeName = L"";
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "include/core/SkTypes.h"
|
#include "include/core/SkTypes.h"
|
||||||
#if defined(SK_BUILD_FOR_WIN) && !defined(_M_ARM64)
|
#if defined(SK_BUILD_FOR_WIN) && !defined(_M_ARM64) && !defined(WINUWP)
|
||||||
|
|
||||||
#include "src/utils/win/SkWGL.h"
|
#include "src/utils/win/SkWGL.h"
|
||||||
|
|
||||||
|
@ -318,6 +318,10 @@ bool SkXPSDevice::endSheet() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT subset_typeface(const SkXPSDevice::TypefaceUse& current) {
|
static HRESULT subset_typeface(const SkXPSDevice::TypefaceUse& current) {
|
||||||
|
//The CreateFontPackage API is only supported on desktop, not in UWP
|
||||||
|
#ifdef SK_WINUWP
|
||||||
|
return E_NOTIMPL;
|
||||||
|
#else
|
||||||
//CreateFontPackage wants unsigned short.
|
//CreateFontPackage wants unsigned short.
|
||||||
//Microsoft, Y U NO stdint.h?
|
//Microsoft, Y U NO stdint.h?
|
||||||
std::vector<unsigned short> keepList;
|
std::vector<unsigned short> keepList;
|
||||||
@ -410,6 +414,7 @@ static HRESULT subset_typeface(const SkXPSDevice::TypefaceUse& current) {
|
|||||||
"Could not set new stream for subsetted font.");
|
"Could not set new stream for subsetted font.");
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
#endif //SK_WINUWP
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SkXPSDevice::endPortfolio() {
|
bool SkXPSDevice::endPortfolio() {
|
||||||
|
@ -205,6 +205,7 @@
|
|||||||
const DWORD machineType = IMAGE_FILE_MACHINE_ARM64;
|
const DWORD machineType = IMAGE_FILE_MACHINE_ARM64;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(SK_WINUWP)
|
||||||
while (StackWalk64(machineType,
|
while (StackWalk64(machineType,
|
||||||
GetCurrentProcess(),
|
GetCurrentProcess(),
|
||||||
GetCurrentThread(),
|
GetCurrentThread(),
|
||||||
@ -231,6 +232,7 @@
|
|||||||
|
|
||||||
SkDebugf("%s +%x\n", symbol->Name, offset);
|
SkDebugf("%s +%x\n", symbol->Name, offset);
|
||||||
}
|
}
|
||||||
|
#endif //SK_WINUWP
|
||||||
|
|
||||||
// Exit NOW. Don't notify other threads, don't call anything registered with atexit().
|
// Exit NOW. Don't notify other threads, don't call anything registered with atexit().
|
||||||
_exit(1);
|
_exit(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user