pathops_unittest \
SampleApp \
SkiaAndroidApp \
- skia_base_libs \
+ skia_lib \
tests \
tools
'../src/utils/mac/SkOSWindow_Mac.cpp',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
+ 'skia_lib.gyp:skia_lib',
'views.gyp:views',
'xml.gyp:xml',
],
'../samplecode/SampleFontCache.cpp',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
- 'images.gyp:images',
+ 'skia_lib.gyp:skia_lib',
'views.gyp:views',
'animator.gyp:animator',
'xml.gyp:xml',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
+ 'skia_lib.gyp:skia_lib',
'views.gyp:views',
'xml.gyp:xml',
],
'../experimental/SimpleiOSApp/SimpleiOSApp-Info.plist',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
- 'images.gyp:images',
+ 'skia_lib.gyp:skia_lib',
'views.gyp:views',
'xml.gyp:xml',
],
'bench.gypi'
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
- 'images.gyp:images',
+ 'skia_lib.gyp:skia_lib',
'bench_timer',
],
'conditions': [
'../src/gpu',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
+ 'skia_lib.gyp:skia_lib',
],
'conditions': [
[ 'skia_os not in ["mac", "ios"]', {
}],
],
},
+ # Validate the 'skia_os' setting against 'skia_shared_lib', because shared
+ # library build is only supported on Android.
+ 'variables': {
+ 'conditions': [
+ [ 'skia_os != "android" and skia_shared_lib', {
+ 'error': '<!(Skia shared lib build only currently supported on Android.)',
+ }],
+ ],
+ },
'includes': [
'common_conditions.gypi',
],
[ 'skia_profile_enabled == 1', {
'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
}],
+ [ 'skia_shared_lib', {
+ 'cflags': [
+ '-fPIC',
+ ],
+ 'defines': [
+ 'GR_DLL=1',
+ 'GR_IMPLEMENTATION=1',
+ 'SKIA_DLL',
+ 'SKIA_IMPLEMENTATION=1',
+ ],
+ }],
[ 'skia_arch_type == "arm" and arm_thumb == 1', {
'cflags': [
'-mthumb',
'skia_osx_sdkroot%': '',
'skia_profile_enabled%': 0,
'skia_win_debuggers_path%': '',
+ 'skia_shared_lib%': 0,
},
'conditions': [
'skia_gpu%': '<(skia_gpu)',
'skia_osx_sdkroot%': '<(skia_osx_sdkroot)',
'skia_profile_enabled%': '<(skia_profile_enabled)',
+ 'skia_shared_lib%': '<(skia_shared_lib)',
'skia_static_initializers%': '<(skia_static_initializers)',
'ios_sdk_version%': '6.0',
'skia_win_debuggers_path%': '<(skia_win_debuggers_path)',
'config/win',
],
}],
+ [ 'skia_os == "android"', {
+ 'sources': [
+ '../src/core/SkPaintOptionsAndroid.cpp',
+ ],
+ }],
[ 'skia_os == "android" and skia_arch_type == "arm" and armv7 == 1', {
# The code in SkUtilsArm.cpp can be used on an ARM-based Linux system, not only Android.
'sources': [
}],
],
},
- 'dependencies': [
- 'opts.gyp:opts'
- ],
},
],
}
'../debugger/SkObjectParser.cpp',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'images.gyp:images',
- 'effects.gyp:effects',
+ 'skia_lib.gyp:skia_lib',
'bench.gyp:bench_timer',
'tools.gyp:picture_renderer',
],
'conditions': [
[ 'skia_os == "nacl"', {
- 'dependencies': [
- 'utils.gyp:utils', # For SkBase64.h
- ],
'include_dirs': [
'../src/utils',
],
'effects.gypi',
],
'include_dirs': [
+ '../include/config',
+ '../include/core',
'../include/effects',
+ '../include/utils',
'../src/core',
],
'direct_dependent_settings': {
'../include/effects',
],
},
- 'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- ],
'sources': [
'effects.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
],
'conditions': [
['skia_gpu == 1', {
'include_dirs': [
+ '../include/gpu',
'../src/gpu',
],
}],
'../tools/flags/SkCommandLineFlags.cpp',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'core.gyp:core',
+ 'skia_lib.gyp:skia_lib',
],
'direct_dependent_settings': {
'include_dirs': [
'../gm/gm_expectations.cpp',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
+ 'skia_lib.gyp:skia_lib',
'core.gyp:core',
'images.gyp:images',
'jsoncpp.gyp:jsoncpp',
'../src/pipe/utils/SamplePipeControllers.cpp',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
+ 'skia_lib.gyp:skia_lib',
'flags.gyp:flags',
'gm.gyp:gm_expectations',
- 'images.gyp:images',
'jsoncpp.gyp:jsoncpp',
'pdf.gyp:pdf',
- 'utils.gyp:utils',
],
'conditions': [
['skia_os == "mac"', {
'type': 'none',
'dependencies': [
# The minimal set of static libraries for basic Skia functionality.
- 'skia_base_libs.gyp:skia_base_libs',
+ 'skia_lib.gyp:skia_lib',
'bench.gyp:bench',
'gm.gyp:gm',
'target_name': 'nacl_interface',
'type': 'static_library',
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
+ 'skia_lib.gyp:skia_lib',
],
'include_dirs': [
# For SkThreadUtils.h
'../tests/Test.h',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
+ 'skia_lib.gyp:skia_lib',
'flags.gyp:flags',
- 'images.gyp:images',
- 'utils.gyp:utils',
],
'conditions': [
[ 'skia_gpu == 1', {
'type': 'static_library',
'standalone_static_library': 1,
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
+ 'skia_lib.gyp:skia_lib',
'zlib.gyp:zlib',
],
'include_dirs': [
'../../../pixman/pixman/pixman.h',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
+ 'skia_lib.gyp:skia_lib',
'experimental.gyp:experimental',
- 'images.gyp:images',
'pdf.gyp:pdf',
'views.gyp:views',
'xml.gyp:xml',
'product_name': 'skia_ports',
'type': 'static_library',
'standalone_static_library': 1,
- 'dependencies': [
- 'core.gyp:core',
- 'sfnt.gyp:sfnt',
- 'utils.gyp:utils',
- ],
'include_dirs': [
+ '../include/config',
+ '../include/core',
'../include/effects',
'../include/images',
'../include/ports',
+ '../include/utils',
'../include/xml',
'../src/core',
'../src/lazy',
+ '../src/sfnt',
'../src/utils',
],
'sources': [
'product_name': 'skia_sfnt',
'type': 'static_library',
'standalone_static_library': 1,
- 'dependencies': [
- 'core.gyp:core',
- ],
'include_dirs': [
+ '../include/config',
+ '../include/core',
'../src/sfnt',
],
'sources': [
'../experimental/Intersection/TriangleUtilities.h',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
- 'images.gyp:images',
+ 'skia_lib.gyp:skia_lib',
'views.gyp:views',
'xml.gyp:xml',
],
'../experimental/Intersection/thingsToDo.txt',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
- 'images.gyp:images',
+ 'skia_lib.gyp:skia_lib',
],
'conditions': [
[ 'skia_gpu == 1', {
'../experimental/Intersection/AddTestOutput/main.cpp',
],
'dependencies': [
- 'core.gyp:core',
- 'effects.gyp:effects',
+ 'skia_lib.gyp:skia_lib',
'experimental.gyp:experimental',
- 'images.gyp:images',
- 'ports.gyp:ports',
'pdf.gyp:pdf',
- 'utils.gyp:utils',
],
'conditions': [
[ 'skia_gpu == 1', {
'include_dirs': [
'../src/gpu',
],
- 'dependencies': [
- 'gpu.gyp:gr',
- 'gpu.gyp:skgr',
- ],
}],
],
},
+++ /dev/null
-# The minimal set of static libraries for basic Skia functionality.
-{
- 'variables': {
- 'component_libs': [
- 'core.gyp:core',
- 'opts.gyp:opts',
- 'ports.gyp:ports',
- 'utils.gyp:utils',
- ],
- 'conditions': [
- [ 'skia_arch_type == "x86" and skia_os != "android"', {
- 'component_libs': [
- 'opts.gyp:opts_ssse3',
- ],
- }],
- [ 'arm_neon == 1', {
- 'component_libs': [
- 'opts.gyp:opts_neon',
- ],
- }],
- [ 'skia_gpu', {
- 'component_libs': [
- 'gpu.gyp:gr',
- 'gpu.gyp:skgr',
- ],
- }],
- [ 'skia_os == "nacl"', {
- 'component_libs': [
- 'freetype.gyp:freetype',
- ],
- }],
- ],
- },
- 'targets': [
- {
- 'target_name': 'skia_base_libs',
- 'type': 'none',
- 'dependencies': [
- '<@(component_libs)',
- ],
- 'export_dependent_settings': [
- '<@(component_libs)',
- ],
- },
- ],
-}
-
-# Local Variables:
-# tab-width:2
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=2 shiftwidth=2:
--- /dev/null
+# The minimal set of static libraries for basic Skia functionality.
+
+{
+ 'variables': {
+ 'component_libs': [
+ 'core.gyp:core',
+ 'effects.gyp:effects',
+ 'images.gyp:images',
+ 'opts.gyp:opts',
+ 'ports.gyp:ports',
+ 'sfnt.gyp:sfnt',
+ 'utils.gyp:utils',
+ ],
+ 'conditions': [
+ [ 'skia_arch_type == "x86" and skia_os != "android"', {
+ 'component_libs': [
+ 'opts.gyp:opts_ssse3',
+ ],
+ }],
+ [ 'arm_neon == 1', {
+ 'component_libs': [
+ 'opts.gyp:opts_neon',
+ ],
+ }],
+ [ 'skia_gpu', {
+ 'component_libs': [
+ 'gpu.gyp:gr',
+ 'gpu.gyp:skgr',
+ ],
+ }],
+ [ 'skia_os == "nacl"', {
+ 'component_libs': [
+ 'freetype.gyp:freetype',
+ ],
+ }],
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'skia_lib',
+ 'conditions': [
+ [ 'skia_shared_lib', {
+ 'conditions': [
+ [ 'skia_os == "android"', {
+ # The name skia will confuse the linker on android into using the system's libskia.so
+ # instead of the one packaged with the apk. We simply choose a different name to fix
+ # this.
+ 'product_name': 'skia_android',
+ }, {
+ 'product_name': 'skia',
+ }],
+ ],
+ 'type': 'shared_library',
+ }, {
+ 'type': 'none',
+ }],
+ ],
+ 'dependencies': [
+ '<@(component_libs)',
+ ],
+ 'export_dependent_settings': [
+ '<@(component_libs)',
+ ],
+ },
+ ],
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2:
'../src/pipe/utils/SamplePipeControllers.cpp',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
+ 'skia_lib.gyp:skia_lib',
'flags.gyp:flags',
'experimental.gyp:experimental',
- 'images.gyp:images',
'pdf.gyp:pdf',
'tools.gyp:picture_utils',
- 'utils.gyp:utils',
- 'sfnt.gyp:sfnt',
],
'conditions': [
[ 'skia_gpu == 1', {
'../tools/skdiff_utils.h',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
- 'images.gyp:images',
+ 'skia_lib.gyp:skia_lib',
],
},
{
'../tools/skdiff_utils.h',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
- 'images.gyp:images',
+ 'skia_lib.gyp:skia_lib',
],
},
{
'../tools/skhello.cpp',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
+ 'skia_lib.gyp:skia_lib',
'flags.gyp:flags',
- 'images.gyp:images',
],
},
{
'../src/utils/',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
+ 'skia_lib.gyp:skia_lib',
'flags.gyp:flags',
'gm.gyp:gm_expectations',
- 'images.gyp:images',
'jsoncpp.gyp:jsoncpp',
'utils.gyp:utils',
],
'../src/utils/SkLua.cpp',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
+ 'skia_lib.gyp:skia_lib',
'effects.gyp:effects',
'utils.gyp:utils',
'images.gyp:images',
'../src/pipe/utils/',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
+ 'skia_lib.gyp:skia_lib',
'tools.gyp:picture_renderer',
'tools.gyp:picture_utils',
- 'ports.gyp:ports',
'flags.gyp:flags',
],
},
'../src/lazy/',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
+ 'skia_lib.gyp:skia_lib',
'tools.gyp:picture_utils',
'tools.gyp:picture_renderer',
'bench.gyp:bench_timer',
- 'ports.gyp:ports',
'flags.gyp:flags',
],
},
'../src/utils/',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
- 'images.gyp:images',
+ 'skia_lib.gyp:skia_lib',
'tools.gyp:picture_utils',
'flags.gyp:flags',
],
},
],
],
- 'export_dependent_settings': [
- 'images.gyp:images',
- ],
},
{
'target_name': 'render_pdfs',
'../src/utils/',
],
'dependencies': [
- 'core.gyp:core',
- 'effects.gyp:effects',
- 'images.gyp:images',
+ 'skia_lib.gyp:skia_lib',
'pdf.gyp:pdf',
- 'ports.gyp:ports',
'tools.gyp:picture_utils',
],
'conditions': [
'../tools/picture_utils.h',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
+ 'skia_lib.gyp:skia_lib',
],
'direct_dependent_settings': {
'include_dirs': [
'../tools/pinspect.cpp',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
- 'images.gyp:images',
+ 'skia_lib.gyp:skia_lib',
],
},
{
'../debugger/SkObjectParser.cpp',
],
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'effects.gyp:effects',
- 'images.gyp:images',
+ 'skia_lib.gyp:skia_lib',
'tools.gyp:picture_utils',
],
},
'type': 'static_library',
'standalone_static_library': 1,
'dependencies': [
- 'skia_base_libs.gyp:skia_base_libs',
- 'images.gyp:images',
+ 'skia_lib.gyp:skia_lib',
'sfnt.gyp:sfnt',
],
'include_dirs': [
public SkiaIntentService() {
super("SkiaIntentService");
}
-
+
@Override
public IBinder onBind(Intent arg0) {
return null;
public void onCreate() {
super.onCreate();
}
-
+
@Override
public void onDestroy() {
super.onDestroy();
}
-
+
@Override
public void onHandleIntent(Intent intent) {
String cmd = bundle.getString("args").trim();
String[] args = cmd.split("\\s+");
Log.d("skia", "Executing Command: " + cmd);
-
+
// Load the requested library
String lib = args[0];
try {
+ System.loadLibrary("skia_android");
System.loadLibrary(lib);
} catch (UnsatisfiedLinkError e) {
Log.e("skia", "Library " + lib +
SkiaReturn(-1, returnRepeats);
throw e;
}
-
+
// JNI call to run the program
int retval = run(args);
SkiaReturn(retval, returnRepeats);
mSlideList = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1);
try {
+ System.loadLibrary("skia_android");
System.loadLibrary("SampleApp");
LinearLayout holder = (LinearLayout) findViewById(R.id.holder);
DEFINES="${DEFINES} skia_os=android"
DEFINES="${DEFINES} android_base=${SCRIPT_DIR}/.."
DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}"
+ DEFINES="${DEFINES} skia_shared_lib=1"
# Setup the build variation depending on the target device
TARGET_DEVICE="$1"
'target_name': 'CopySkiaAppDeps',
'type': 'none',
'dependencies': [
+ 'skia_lib.gyp:skia_lib',
'SampleApp.gyp:SampleApp',
'bench.gyp:bench',
'gm.gyp:gm',
'<(PRODUCT_DIR)/lib.target/libtests.so',
'<(PRODUCT_DIR)/lib.target/libpathops_unittest.so',
'<(PRODUCT_DIR)/lib.target/gdbserver',
+ '<(PRODUCT_DIR)/lib.target/libskia_android.so',
],
},
],
return (*app_main)(argc, argv);
}
+void* load_library(const char** argv, const char* libraryName)
+{
+ // attempt to lookup the location of the shared libraries
+ char libraryLocation[100];
+ sprintf(libraryLocation, "%s/lib/lib%s.so", argv[0], libraryName);
+ if (!file_exists(libraryLocation)) {
+ printf("ERROR: Unable to find the appropriate library in the Skia App.\n");
+ printf("ERROR: Did you provide the correct program_name?\n");
+ usage(argv[0]);
+ return NULL;
+ }
+
+ // load the appropriate library
+ void* appLibrary = dlopen(libraryLocation, RTLD_LOCAL | RTLD_LAZY);
+ if (!appLibrary) {
+ printf("ERROR: Unable to open the shared library.\n");
+ printf("ERROR: %s", dlerror());
+ return NULL;
+ }
+
+ return appLibrary;
+}
+
int main(int argc, const char** argv) {
// check that the program name was specified
return -1;
}
- // attempt to lookup the location of the shared libraries
- char libraryLocation[100];
- sprintf(libraryLocation, "%s/lib/lib%s.so", appLocation, argv[1]);
- if (!file_exists(libraryLocation)) {
- printf("ERROR: Unable to find the appropriate library in the Skia App.\n");
- printf("ERROR: Did you provide the correct program_name?\n");
- usage(argv[0]);
+ // load the local skia shared library
+ void* skiaLibrary = load_library(argv, "libskia_android.so");
+ if (NULL == skiaLibrary)
+ {
return -1;
}
// load the appropriate library
- void* appLibrary = dlopen(libraryLocation, RTLD_LOCAL | RTLD_LAZY);
- if (!appLibrary) {
- printf("ERROR: Unable to open the shared library.\n");
- printf("ERROR: %s", dlerror());
+ void* appLibrary = load_library(argv, argv[1]);
+ if (NULL == appLibrary) {
return -1;
}