diff options
-rw-r--r-- | BUILD.gn | 89 | ||||
-rw-r--r-- | gn/BUILD.gn | 29 | ||||
-rw-r--r-- | gn/BUILDCONFIG.gn | 2 | ||||
-rw-r--r-- | gn/find_ios_sysroot.py | 10 | ||||
-rw-r--r-- | include/views/SkOSWindow_iOS.h | 2 | ||||
-rwxr-xr-x | src/views/ios/SkOSWindow_iOS.mm | 2 | ||||
-rw-r--r-- | tests/StreamTest.cpp | 2 | ||||
-rw-r--r-- | tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm | 2 |
8 files changed, 99 insertions, 39 deletions
@@ -16,7 +16,7 @@ declare_args() { skia_use_fontconfig = is_linux skia_use_freetype = is_android || is_fuchsia || is_linux skia_use_gdi = false - skia_use_icu = !is_fuchsia && !is_win # TODO: Windows + skia_use_icu = !is_fuchsia && !is_ios && !is_win # TODO: Windows skia_use_libjpeg_turbo = true skia_use_libpng = true skia_use_libwebp = !is_fuchsia @@ -662,6 +662,22 @@ component("skia") { ] } + if (is_ios) { + sources += [ + "src/ports/SkDebug_stdio.cpp", + "src/ports/SkFontHost_mac.cpp", + "src/ports/SkImageEncoder_CG.cpp", + "src/ports/SkImageGeneratorCG.cpp", + ] + libs += [ + "CoreFoundation.framework", + "CoreGraphics.framework", + "CoreText.framework", + "ImageIO.framework", + "MobileCoreServices.framework", + ] + } + if (is_fuchsia) { sources += [ "src/ports/SkDebug_stdio.cpp" ] } @@ -750,6 +766,9 @@ if (skia_enable_tools) { if (is_android) { sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ] + } else if (is_ios) { + sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ] + libs += [ "OpenGLES.framework" ] } else if (is_linux) { sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ] } else if (is_mac) { @@ -1056,8 +1075,8 @@ if (skia_enable_tools) { } } - # We can't yet build ICU on Windows. - if (!is_win) { + # We can't yet build ICU on iOS or Windows. + if (!is_ios && !is_win) { executable("sktexttopdf-hb") { sources = [ "tools/SkShaper_harfbuzz.cpp", @@ -1093,37 +1112,39 @@ if (skia_enable_tools) { testonly = true } - executable("skiaserve") { - sources = [ - "tools/skiaserve/Request.cpp", - "tools/skiaserve/Response.cpp", - "tools/skiaserve/skiaserve.cpp", - "tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp", - "tools/skiaserve/urlhandlers/BatchesHandler.cpp", - "tools/skiaserve/urlhandlers/BreakHandler.cpp", - "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp", - "tools/skiaserve/urlhandlers/CmdHandler.cpp", - "tools/skiaserve/urlhandlers/ColorModeHandler.cpp", - "tools/skiaserve/urlhandlers/DataHandler.cpp", - "tools/skiaserve/urlhandlers/DownloadHandler.cpp", - "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp", - "tools/skiaserve/urlhandlers/ImgHandler.cpp", - "tools/skiaserve/urlhandlers/InfoHandler.cpp", - "tools/skiaserve/urlhandlers/OverdrawHandler.cpp", - "tools/skiaserve/urlhandlers/PostHandler.cpp", - "tools/skiaserve/urlhandlers/QuitHandler.cpp", - "tools/skiaserve/urlhandlers/RootHandler.cpp", - ] - deps = [ - ":flags", - ":gpu_tool_utils", - ":skia", - ":tool_utils", - "//third_party/jsoncpp", - "//third_party/libmicrohttpd", - "//third_party/libpng", - ] - testonly = true + if (!is_ios) { + executable("skiaserve") { + sources = [ + "tools/skiaserve/Request.cpp", + "tools/skiaserve/Response.cpp", + "tools/skiaserve/skiaserve.cpp", + "tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp", + "tools/skiaserve/urlhandlers/BatchesHandler.cpp", + "tools/skiaserve/urlhandlers/BreakHandler.cpp", + "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp", + "tools/skiaserve/urlhandlers/CmdHandler.cpp", + "tools/skiaserve/urlhandlers/ColorModeHandler.cpp", + "tools/skiaserve/urlhandlers/DataHandler.cpp", + "tools/skiaserve/urlhandlers/DownloadHandler.cpp", + "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp", + "tools/skiaserve/urlhandlers/ImgHandler.cpp", + "tools/skiaserve/urlhandlers/InfoHandler.cpp", + "tools/skiaserve/urlhandlers/OverdrawHandler.cpp", + "tools/skiaserve/urlhandlers/PostHandler.cpp", + "tools/skiaserve/urlhandlers/QuitHandler.cpp", + "tools/skiaserve/urlhandlers/RootHandler.cpp", + ] + deps = [ + ":flags", + ":gpu_tool_utils", + ":skia", + ":tool_utils", + "//third_party/jsoncpp", + "//third_party/libmicrohttpd", + "//third_party/libpng", + ] + testonly = true + } } executable("fuzz") { diff --git a/gn/BUILD.gn b/gn/BUILD.gn index 81813a39d2..a39217efb0 100644 --- a/gn/BUILD.gn +++ b/gn/BUILD.gn @@ -46,6 +46,10 @@ if (!is_win) { "value") } +if (is_ios) { + ios_sysroot = exec_script("find_ios_sysroot.py", [], "trim string") +} + config("default") { asmflags = [] cflags = [] @@ -178,6 +182,31 @@ config("default") { } } + if (is_ios) { + cflags += [ + "--sysroot=$ios_sysroot", + "--target=$target_cpu-apple-darwin11", + ] + cflags_cc += [ "-stdlib=libc++" ] + ldflags += [ + "--sysroot=$ios_sysroot", + "--target=$target_cpu-apple-darwin11", + "-stdlib=libc++", + ] + libs = [ "objc" ] + + # We used to link all our iOS tools together, so none actually defines main(). + # Instead they each define their own entry point, which our iOS mega-app called. + # If we can we'd like to not do that anymore. While we're building both ways, here's + # our clever hack to give each tool back its own main(). + cflags += [ + "-Ddm_main=main", + "-Dnanobench_main=main", + "-Dtool_main=main", + "-Dtest_main=main", + ] + } + if (is_linux) { libs = [ "pthread" ] } diff --git a/gn/BUILDCONFIG.gn b/gn/BUILDCONFIG.gn index 9a995bb3d1..4ed566866e 100644 --- a/gn/BUILDCONFIG.gn +++ b/gn/BUILDCONFIG.gn @@ -40,7 +40,7 @@ is_win = current_os == "win" if (target_cpu == "") { target_cpu = host_cpu - if (is_android) { + if (is_android || is_ios) { target_cpu = "arm64" } } diff --git a/gn/find_ios_sysroot.py b/gn/find_ios_sysroot.py new file mode 100644 index 0000000000..2d9f8d61d1 --- /dev/null +++ b/gn/find_ios_sysroot.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +# +# Copyright 2016 Google Inc. +# +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import subprocess + +print subprocess.check_output('xcrun --sdk iphoneos --show-sdk-path'.split()) diff --git a/include/views/SkOSWindow_iOS.h b/include/views/SkOSWindow_iOS.h index c0b2fc3f0a..3b540cff3f 100644 --- a/include/views/SkOSWindow_iOS.h +++ b/include/views/SkOSWindow_iOS.h @@ -37,7 +37,7 @@ protected: virtual void onHandleInval(const SkIRect&); // overrides from SkView virtual void onAddMenu(const SkOSMenu*); - virtual void onUpdateMenu(SkOSMenu*); + virtual void onUpdateMenu(const SkOSMenu*); virtual void onSetTitle(const char[]); private: diff --git a/src/views/ios/SkOSWindow_iOS.mm b/src/views/ios/SkOSWindow_iOS.mm index aa7d3759bd..3e2937181f 100755 --- a/src/views/ios/SkOSWindow_iOS.mm +++ b/src/views/ios/SkOSWindow_iOS.mm @@ -53,7 +53,7 @@ void SkOSWindow::onAddMenu(const SkOSMenu* menu) { [(SkUIView*)fHWND onAddMenu:menu]; } -void SkOSWindow::onUpdateMenu(SkOSMenu* menu) { +void SkOSWindow::onUpdateMenu(const SkOSMenu* menu) { [(SkUIView*)fHWND onUpdateMenu:menu]; } diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp index ca750d1566..b99b001193 100644 --- a/tests/StreamTest.cpp +++ b/tests/StreamTest.cpp @@ -192,6 +192,7 @@ DEF_TEST(Stream, reporter) { TestNullData(); } +#ifndef SK_BUILD_FOR_IOS /** * Tests peeking and then reading the same amount. The two should provide the * same results. @@ -285,7 +286,6 @@ static void test_peeking_front_buffered_stream(skiatest::Reporter* r, // This test uses file system operations that don't work out of the // box on iOS. It's likely that we don't need them on iOS. Ignoring for now. // TODO(stephana): Re-evaluate if we need this in the future. -#ifndef SK_BUILD_FOR_IOS DEF_TEST(StreamPeek, reporter) { // Test a memory stream. const char gAbcs[] = "abcdefghijklmnopqrstuvwxyz"; diff --git a/tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm b/tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm index d31cb86958..f2bcd5d402 100644 --- a/tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm +++ b/tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm @@ -6,7 +6,7 @@ * found in the LICENSE file. */ -#include "GLTestContext.h" +#include "gl/GLTestContext.h" #import <OpenGLES/EAGL.h> #include <dlfcn.h> |