diff options
author | 2013-05-31 20:09:47 +0000 | |
---|---|---|
committer | 2013-05-31 20:09:47 +0000 | |
commit | a96627fd2467b74004f8950eb78ce8888ca97088 (patch) | |
tree | d4361b1b24262c188acae352a0ad0943cd62dfe9 /platform_tools | |
parent | cf5348f5aad19224f1175b8e2577019fb02636fd (diff) |
prepare skia for shared library build on android
R=borenet@google.com, djsollen@google.com
Committed: https://code.google.com/p/skia/source/detail?r=9378
Review URL: https://codereview.chromium.org/15855006
git-svn-id: http://skia.googlecode.com/svn/trunk@9379 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'platform_tools')
5 files changed, 16 insertions, 39 deletions
diff --git a/platform_tools/android/app/src/com/skia/SkiaIntentService.java b/platform_tools/android/app/src/com/skia/SkiaIntentService.java index 68d336e70e..e2707f7964 100644 --- a/platform_tools/android/app/src/com/skia/SkiaIntentService.java +++ b/platform_tools/android/app/src/com/skia/SkiaIntentService.java @@ -16,7 +16,7 @@ public class SkiaIntentService extends IntentService { public SkiaIntentService() { super("SkiaIntentService"); } - + @Override public IBinder onBind(Intent arg0) { return null; @@ -25,12 +25,12 @@ public class SkiaIntentService extends IntentService { public void onCreate() { super.onCreate(); } - + @Override public void onDestroy() { super.onDestroy(); } - + @Override public void onHandleIntent(Intent intent) { @@ -51,11 +51,10 @@ public class SkiaIntentService extends IntentService { 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 + @@ -63,7 +62,7 @@ public class SkiaIntentService extends IntentService { SkiaReturn(-1, returnRepeats); throw e; } - + // JNI call to run the program int retval = run(args); SkiaReturn(retval, returnRepeats); diff --git a/platform_tools/android/app/src/com/skia/SkiaSampleActivity.java b/platform_tools/android/app/src/com/skia/SkiaSampleActivity.java index 62f81a58f5..4b5e7d6b7f 100644 --- a/platform_tools/android/app/src/com/skia/SkiaSampleActivity.java +++ b/platform_tools/android/app/src/com/skia/SkiaSampleActivity.java @@ -42,7 +42,6 @@ public class SkiaSampleActivity extends Activity 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); diff --git a/platform_tools/android/bin/android_setup.sh b/platform_tools/android/bin/android_setup.sh index e5cea6e863..b955bea1cd 100755 --- a/platform_tools/android/bin/android_setup.sh +++ b/platform_tools/android/bin/android_setup.sh @@ -126,7 +126,6 @@ setup_device() { 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" diff --git a/platform_tools/android/gyp/skia_android.gypi b/platform_tools/android/gyp/skia_android.gypi index 72dc942ab9..43c59c1d43 100644 --- a/platform_tools/android/gyp/skia_android.gypi +++ b/platform_tools/android/gyp/skia_android.gypi @@ -4,7 +4,6 @@ 'target_name': 'CopySkiaAppDeps', 'type': 'none', 'dependencies': [ - 'skia_lib.gyp:skia_lib', 'SampleApp.gyp:SampleApp', 'bench.gyp:bench', 'gm.gyp:gm', @@ -57,7 +56,6 @@ '<(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', ], }, ], diff --git a/platform_tools/android/launcher/skia_launcher.cpp b/platform_tools/android/launcher/skia_launcher.cpp index 231289d4e9..972382dc16 100644 --- a/platform_tools/android/launcher/skia_launcher.cpp +++ b/platform_tools/android/launcher/skia_launcher.cpp @@ -28,29 +28,6 @@ int launch_app(int (*app_main)(int, const char**), int argc, 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 @@ -67,16 +44,21 @@ int main(int argc, const char** argv) { return -1; } - // load the local skia shared library - void* skiaLibrary = load_library(argv, "libskia_android.so"); - if (NULL == skiaLibrary) - { + // 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]); return -1; } // load the appropriate library - void* appLibrary = load_library(argv, argv[1]); - if (NULL == appLibrary) { + void* appLibrary = dlopen(libraryLocation, RTLD_LOCAL | RTLD_LAZY); + if (!appLibrary) { + printf("ERROR: Unable to open the shared library.\n"); + printf("ERROR: %s", dlerror()); return -1; } |