diff options
author | djsollen <djsollen@google.com> | 2016-04-21 07:59:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-21 07:59:44 -0700 |
commit | 12d62a7d51a1826e221ffd34224d01c9bec49bab (patch) | |
tree | e3906a4d96e03158ea6e20e66bfe8d09df4fb84e /platform_tools/android/apps | |
parent | d37fe76b5101dfe6c29668f5c29e5b46e697a68d (diff) |
VulkanViewer on Android
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1903253003
Review URL: https://codereview.chromium.org/1903253003
Diffstat (limited to 'platform_tools/android/apps')
4 files changed, 92 insertions, 0 deletions
diff --git a/platform_tools/android/apps/settings.gradle b/platform_tools/android/apps/settings.gradle index f8872ca309..9d103b49be 100644 --- a/platform_tools/android/apps/settings.gradle +++ b/platform_tools/android/apps/settings.gradle @@ -2,3 +2,4 @@ include ':sample_app' include ':visualbench' include ':visualbenchsdl' include ':canvasproof' +include ':vulkanviewer' diff --git a/platform_tools/android/apps/vulkanviewer/build.gradle b/platform_tools/android/apps/vulkanviewer/build.gradle new file mode 100644 index 0000000000..acb6740248 --- /dev/null +++ b/platform_tools/android/apps/vulkanviewer/build.gradle @@ -0,0 +1,37 @@ +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ +apply plugin: 'com.android.application' +android { + compileSdkVersion 19 + buildToolsVersion "22.0.1" + defaultConfig { + applicationId "org.skia.vulkanviewer" + minSdkVersion 9 + targetSdkVersion 19 + versionCode 1 + versionName "1.0" + signingConfig signingConfigs.debug + } + sourceSets.main.jni.srcDirs = [] //disable automatic ndk-build call + sourceSets.main.jniLibs.srcDir "src/main/libs" + productFlavors { arm {}; arm64 {}; x86 {}; x86_64 {}; mips {}; mips64 {}; } + applicationVariants.all{ variant -> + def buildNativeLib = task("${variant.name}_NativeLib", type:Exec) { + workingDir '../../../..' // top-level skia directory + commandLine constructBuildCommand(variant, "CopyVulkanViewerDeps").split() + environment PATH: getPathWithDepotTools() + environment ANDROID_SDK_ROOT: getSDKPath() + } + buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") } + TaskCollection<Task> assembleTask + assembleTask = project.tasks.matching { + it.name.contains("assemble") && + it.name.toLowerCase().endsWith(variant.name.toLowerCase()) + } + assembleTask.getAt(0).dependsOn buildNativeLib + } +} diff --git a/platform_tools/android/apps/vulkanviewer/src/main/AndroidManifest.xml b/platform_tools/android/apps/vulkanviewer/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..3220c31bd1 --- /dev/null +++ b/platform_tools/android/apps/vulkanviewer/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- BEGIN_INCLUDE(manifest) --> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.skia.vulkanviewer" + android:versionCode="1" + android:versionName="1.0"> + + <application + android:allowBackup="false" + android:label="VulkanViewer"> + + <activity android:name=".VulkanViewerActivity" + android:label="VulkanViewer" + android:screenOrientation="portrait" + android:configChanges="orientation|keyboardHidden"> + <meta-data android:name="android.app.lib_name" + android:value="vulkanviewer" /> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> +<!-- END_INCLUDE(manifest) --> diff --git a/platform_tools/android/apps/vulkanviewer/src/main/java/com/skia/vulkanviewer/VulkanViewerActivity.java b/platform_tools/android/apps/vulkanviewer/src/main/java/com/skia/vulkanviewer/VulkanViewerActivity.java new file mode 100644 index 0000000000..dcb00858e5 --- /dev/null +++ b/platform_tools/android/apps/vulkanviewer/src/main/java/com/skia/vulkanviewer/VulkanViewerActivity.java @@ -0,0 +1,28 @@ +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +package com.skia.vulkanviewer; + +import android.app.ActionBar; +import android.os.Bundle; +import android.provider.Settings; +import android.view.View; +import android.view.WindowManager; + +public class VulkanViewerActivity extends android.app.NativeActivity { + static { + System.loadLibrary("skia_android"); + } + + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + ActionBar ab = this.getActionBar(); + ab.hide(); + } +} |