aboutsummaryrefslogtreecommitdiff
path: root/renderScript
diff options
context:
space:
mode:
authorYuichi Araki <yaraki@google.com>2016-07-07 16:54:01 +0900
committerYuichi Araki <yaraki@google.com>2016-07-07 17:01:00 +0900
commit1acd4410bd34ee2ab728e664aa9e202c1ed9480c (patch)
treefd765feb6a3554f5fdf4cfc9be3e64fdced3de78 /renderScript
parentb6bfbff48382131c9593d709600f6c994557dafa (diff)
downloadandroid-1acd4410bd34ee2ab728e664aa9e202c1ed9480c.tar.gz
BasicRenderScript: Several fixes
- Materialize - Lower minSdkVersion to 8 Change-Id: Ie3361d4fc76a7a9ead9f2a1ab0ad0b09ad97bc5d
Diffstat (limited to 'renderScript')
-rw-r--r--renderScript/BasicRenderScript/Application/AndroidManifest.xml27
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/AndroidManifest.xml24
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/java/com/example/android/basicrenderscript/MainActivity.java94
-rwxr-xr-xrenderScript/BasicRenderScript/Application/src/main/res/drawable-hdpi/ic_launcher.pngbin4440 -> 0 bytes
-rwxr-xr-xrenderScript/BasicRenderScript/Application/src/main/res/drawable-mdpi/ic_launcher.pngbin2742 -> 0 bytes
-rwxr-xr-xrenderScript/BasicRenderScript/Application/src/main/res/drawable-xhdpi/ic_launcher.pngbin6245 -> 0 bytes
-rwxr-xr-xrenderScript/BasicRenderScript/Application/src/main/res/drawable-xxhdpi/ic_launcher.pngbin11130 -> 0 bytes
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/res/layout/main_layout.xml25
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/res/mipmap-hdpi/ic_launcher.pngbin0 -> 3309 bytes
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/res/mipmap-mdpi/ic_launcher.pngbin0 -> 2058 bytes
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/res/mipmap-xhdpi/ic_launcher.pngbin0 -> 4133 bytes
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/res/mipmap-xxhdpi/ic_launcher.pngbin0 -> 6682 bytes
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/res/mipmap-xxxhdpi/ic_launcher.pngbin0 -> 9697 bytes
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/res/values-v11/styles.xml24
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/res/values-v14/styles.xml12
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/res/values/colors.xml21
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/res/values/styles.xml34
-rw-r--r--renderScript/BasicRenderScript/Application/src/main/rs/saturation.rs6
-rw-r--r--renderScript/BasicRenderScript/README.md6
-rw-r--r--renderScript/BasicRenderScript/packaging.yaml2
-rw-r--r--renderScript/BasicRenderScript/screenshots/icon-web.pngbin69040 -> 36388 bytes
-rw-r--r--renderScript/BasicRenderScript/template-params.xml5
22 files changed, 120 insertions, 160 deletions
diff --git a/renderScript/BasicRenderScript/Application/AndroidManifest.xml b/renderScript/BasicRenderScript/Application/AndroidManifest.xml
deleted file mode 100644
index 21c3a621..00000000
--- a/renderScript/BasicRenderScript/Application/AndroidManifest.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.android.basicrenderscript"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <!-- Min/target SDK versions (<uses-sdk>) managed by build.gradle -->
-
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.example.android.basicrenderscript.MainActivity"
- android:configChanges="orientation|keyboardHidden|screenSize"
- android:label="@string/app_name"
- android:theme="@style/FullscreenTheme" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
diff --git a/renderScript/BasicRenderScript/Application/src/main/AndroidManifest.xml b/renderScript/BasicRenderScript/Application/src/main/AndroidManifest.xml
index 3bc65ffa..1ccd832d 100644
--- a/renderScript/BasicRenderScript/Application/src/main/AndroidManifest.xml
+++ b/renderScript/BasicRenderScript/Application/src/main/AndroidManifest.xml
@@ -1,4 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?><!--
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
Copyright 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,31 +14,24 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.android.basicrenderscript"
- android:versionCode="1"
- android:versionName="1.0">
+<manifest package="com.example.android.basicrenderscript"
+ xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Min/target SDK versions (<uses-sdk>) managed by build.gradle -->
<application
android:allowBackup="true"
+ android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
- android:icon="@drawable/ic_launcher"
- android:theme="@style/AppTheme">
-
+ android:theme="@style/Theme.BasicRenderScript">
<activity
android:name=".MainActivity"
- android:label="@string/app_name"
- android:theme="@style/FullscreenTheme">
+ android:label="@string/app_name">
<intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
-
</manifest>
diff --git a/renderScript/BasicRenderScript/Application/src/main/java/com/example/android/basicrenderscript/MainActivity.java b/renderScript/BasicRenderScript/Application/src/main/java/com/example/android/basicrenderscript/MainActivity.java
index ed6d5ad1..4671985c 100644
--- a/renderScript/BasicRenderScript/Application/src/main/java/com/example/android/basicrenderscript/MainActivity.java
+++ b/renderScript/BasicRenderScript/Application/src/main/java/com/example/android/basicrenderscript/MainActivity.java
@@ -16,31 +16,32 @@
package com.example.android.basicrenderscript;
-import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v8.renderscript.Allocation;
+import android.support.v8.renderscript.RenderScript;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
-import android.support.v8.renderscript.*;
-public class MainActivity extends Activity {
- /* Number of bitmaps that is used for renderScript thread and UI thread synchronization.
- Ideally, this can be reduced to 2, however in some devices, 2 buffers still showing tierings on UI.
- Investigating a root cause.
+public class MainActivity extends AppCompatActivity {
+
+ /**
+ * Number of bitmaps that is used for RenderScript thread and UI thread synchronization.
*/
- private final int NUM_BITMAPS = 3;
+ private final int NUM_BITMAPS = 2;
private int mCurrentBitmap = 0;
private Bitmap mBitmapIn;
private Bitmap[] mBitmapsOut;
private ImageView mImageView;
- private RenderScript mRS;
private Allocation mInAllocation;
private Allocation[] mOutAllocations;
private ScriptC_saturation mScript;
+ private RenderScriptTask mCurrentTask;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -48,9 +49,7 @@ public class MainActivity extends Activity {
setContentView(R.layout.main_layout);
- /*
- * Initialize UI
- */
+ // Initialize UI
mBitmapIn = loadBitmap(R.drawable.data);
mBitmapsOut = new Bitmap[NUM_BITMAPS];
for (int i = 0; i < NUM_BITMAPS; ++i) {
@@ -82,63 +81,55 @@ public class MainActivity extends Activity {
}
});
- /*
- * Create renderScript
- */
+ // Create renderScript
createScript();
- /*
- * Invoke renderScript kernel and update imageView
- */
+ // Invoke renderScript kernel and update imageView
updateImage(1.0f);
}
- /*
- * Initialize RenderScript
- * In the sample, it creates RenderScript kernel that performs saturation manipulation.
+ /**
+ * Initialize RenderScript.
+ *
+ * <p>In the sample, it creates RenderScript kernel that performs saturation manipulation.</p>
*/
private void createScript() {
- //Initialize RS
- mRS = RenderScript.create(this);
+ // Initialize RS
+ RenderScript rs = RenderScript.create(this);
- //Allocate buffers
- mInAllocation = Allocation.createFromBitmap(mRS, mBitmapIn);
+ // Allocate buffers
+ mInAllocation = Allocation.createFromBitmap(rs, mBitmapIn);
mOutAllocations = new Allocation[NUM_BITMAPS];
for (int i = 0; i < NUM_BITMAPS; ++i) {
- mOutAllocations[i] = Allocation.createFromBitmap(mRS, mBitmapsOut[i]);
+ mOutAllocations[i] = Allocation.createFromBitmap(rs, mBitmapsOut[i]);
}
- //Load script
- mScript = new ScriptC_saturation(mRS);
+ // Load script
+ mScript = new ScriptC_saturation(rs);
}
/*
* In the AsyncTask, it invokes RenderScript intrinsics to do a filtering.
- * After the filtering is done, an operation blocks at Allication.copyTo() in AsyncTask thread.
- * Once all operation is finished at onPostExecute() in UI thread, it can invalidate and update ImageView UI.
+ * After the filtering is done, an operation blocks at Allocation.copyTo() in AsyncTask thread.
+ * Once all operation is finished at onPostExecute() in UI thread, it can invalidate and update
+ * ImageView UI.
*/
- private class RenderScriptTask extends AsyncTask<Float, Integer, Integer> {
+ private class RenderScriptTask extends AsyncTask<Float, Void, Integer> {
Boolean issued = false;
protected Integer doInBackground(Float... values) {
int index = -1;
- if (isCancelled() == false) {
+ if (!isCancelled()) {
issued = true;
index = mCurrentBitmap;
- /*
- * Set global variable in RS
- */
+ // Set global variable in RS
mScript.set_saturationValue(values[0]);
- /*
- * Invoke saturation filter kernel
- */
+ // Invoke saturation filter kernel
mScript.forEach_saturation(mInAllocation, mOutAllocations[index]);
- /*
- * Copy to bitmap and invalidate image view
- */
+ // Copy to bitmap and invalidate image view
mOutAllocations[index].copyTo(mBitmapsOut[index]);
mCurrentBitmap = (mCurrentBitmap + 1) % NUM_BITMAPS;
}
@@ -164,22 +155,21 @@ public class MainActivity extends Activity {
}
}
- RenderScriptTask currentTask = null;
-
- /*
- Invoke AsynchTask and cancel previous task.
- When AsyncTasks are piled up (typically in slow device with heavy kernel),
- Only the latest (and already started) task invokes RenderScript operation.
+ /**
+ * Invoke AsyncTask and cancel previous task. When AsyncTasks are piled up (typically in slow
+ * device with heavy kernel), Only the latest (and already started) task invokes RenderScript
+ * operation.
*/
private void updateImage(final float f) {
- if (currentTask != null)
- currentTask.cancel(false);
- currentTask = new RenderScriptTask();
- currentTask.execute(f);
+ if (mCurrentTask != null) {
+ mCurrentTask.cancel(false);
+ }
+ mCurrentTask = new RenderScriptTask();
+ mCurrentTask.execute(f);
}
- /*
- Helper to load Bitmap from resource
+ /**
+ * Helper to load Bitmap from resource
*/
private Bitmap loadBitmap(int resource) {
final BitmapFactory.Options options = new BitmapFactory.Options();
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/drawable-hdpi/ic_launcher.png b/renderScript/BasicRenderScript/Application/src/main/res/drawable-hdpi/ic_launcher.png
deleted file mode 100755
index 75b3c978..00000000
--- a/renderScript/BasicRenderScript/Application/src/main/res/drawable-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/drawable-mdpi/ic_launcher.png b/renderScript/BasicRenderScript/Application/src/main/res/drawable-mdpi/ic_launcher.png
deleted file mode 100755
index 4ccd98e0..00000000
--- a/renderScript/BasicRenderScript/Application/src/main/res/drawable-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/renderScript/BasicRenderScript/Application/src/main/res/drawable-xhdpi/ic_launcher.png
deleted file mode 100755
index 7c5aeed0..00000000
--- a/renderScript/BasicRenderScript/Application/src/main/res/drawable-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/renderScript/BasicRenderScript/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
deleted file mode 100755
index 3c45f511..00000000
--- a/renderScript/BasicRenderScript/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/layout/main_layout.xml b/renderScript/BasicRenderScript/Application/src/main/res/layout/main_layout.xml
index 69695f07..0e0ce7bd 100644
--- a/renderScript/BasicRenderScript/Application/src/main/res/layout/main_layout.xml
+++ b/renderScript/BasicRenderScript/Application/src/main/res/layout/main_layout.xml
@@ -1,22 +1,39 @@
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2016 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="#0099cc"
tools:context=".MainActivity">
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:contentDescription="@null"
android:scaleType="fitCenter"
- android:src="@drawable/data" />
+ android:src="@drawable/data"/>
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
- android:layout_marginBottom="16dp" />
+ android:layout_marginBottom="16dp"/>
</FrameLayout>
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/mipmap-hdpi/ic_launcher.png b/renderScript/BasicRenderScript/Application/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 00000000..f4fe94e2
--- /dev/null
+++ b/renderScript/BasicRenderScript/Application/src/main/res/mipmap-hdpi/ic_launcher.png
Binary files differ
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/mipmap-mdpi/ic_launcher.png b/renderScript/BasicRenderScript/Application/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 00000000..9122d0ea
--- /dev/null
+++ b/renderScript/BasicRenderScript/Application/src/main/res/mipmap-mdpi/ic_launcher.png
Binary files differ
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/mipmap-xhdpi/ic_launcher.png b/renderScript/BasicRenderScript/Application/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..95808a0b
--- /dev/null
+++ b/renderScript/BasicRenderScript/Application/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary files differ
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/mipmap-xxhdpi/ic_launcher.png b/renderScript/BasicRenderScript/Application/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..5418897a
--- /dev/null
+++ b/renderScript/BasicRenderScript/Application/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/renderScript/BasicRenderScript/Application/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..e74c9641
--- /dev/null
+++ b/renderScript/BasicRenderScript/Application/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/values-v11/styles.xml b/renderScript/BasicRenderScript/Application/src/main/res/values-v11/styles.xml
deleted file mode 100644
index f3a90c68..00000000
--- a/renderScript/BasicRenderScript/Application/src/main/res/values-v11/styles.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
- <style name="FullscreenTheme" parent="android:Theme.Holo">
- <item name="android:actionBarStyle">@style/FullscreenActionBarStyle</item>
- <item name="android:windowActionBarOverlay">true</item>
- <item name="android:windowBackground">@null</item>
- <item name="buttonBarStyle">?android:attr/buttonBarStyle</item>
- <item name="buttonBarButtonStyle">?android:attr/buttonBarButtonStyle</item>
- </style>
-
- <style name="FullscreenActionBarStyle" parent="android:Widget.Holo.ActionBar">
- <item name="android:background">@color/black_overlay</item>
- </style>
-
-</resources>
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/values-v14/styles.xml b/renderScript/BasicRenderScript/Application/src/main/res/values-v14/styles.xml
deleted file mode 100644
index a91fd037..00000000
--- a/renderScript/BasicRenderScript/Application/src/main/res/values-v14/styles.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<resources>
-
- <!--
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
-
-</resources>
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/values/colors.xml b/renderScript/BasicRenderScript/Application/src/main/res/values/colors.xml
index 327c0604..c1494e66 100644
--- a/renderScript/BasicRenderScript/Application/src/main/res/values/colors.xml
+++ b/renderScript/BasicRenderScript/Application/src/main/res/values/colors.xml
@@ -1,5 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2016 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<resources>
- <color name="black_overlay">#66000000</color>
+ <color name="primary">#3F51B5</color>
+ <color name="primary_dark">#303F9F</color>
+ <color name="primary_light">#C5CAE9</color>
+ <color name="accent">#8BC34A</color>
</resources>
diff --git a/renderScript/BasicRenderScript/Application/src/main/res/values/styles.xml b/renderScript/BasicRenderScript/Application/src/main/res/values/styles.xml
index 49299b98..25e8dbc3 100644
--- a/renderScript/BasicRenderScript/Application/src/main/res/values/styles.xml
+++ b/renderScript/BasicRenderScript/Application/src/main/res/values/styles.xml
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
-<resources>
+<!--
+ Copyright 2016 The Android Open Source Project
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- <style name="FullscreenTheme" parent="android:Theme.NoTitleBar">
- <item name="android:windowContentOverlay">@null</item>
- <item name="android:windowBackground">@null</item>
- <item name="buttonBarStyle">@style/ButtonBar</item>
- <item name="buttonBarButtonStyle">@style/ButtonBarButton</item>
- </style>
+ http://www.apache.org/licenses/LICENSE-2.0
- <style name="ButtonBar">
- <item name="android:paddingLeft">2dp</item>
- <item name="android:paddingTop">5dp</item>
- <item name="android:paddingRight">2dp</item>
- <item name="android:paddingBottom">0dp</item>
- <item name="android:background">@android:drawable/bottom_bar</item>
- </style>
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
- <style name="ButtonBarButton" />
+ <style name="Theme.BasicRenderScript" parent="Theme.AppCompat.Light.DarkActionBar">
+ <item name="colorPrimary">@color/primary</item>
+ <item name="colorPrimaryDark">@color/primary_dark</item>
+ <item name="colorAccent">@color/accent</item>
+ <item name="android:windowBackground">@color/primary_light</item>
+ </style>
</resources>
diff --git a/renderScript/BasicRenderScript/Application/src/main/rs/saturation.rs b/renderScript/BasicRenderScript/Application/src/main/rs/saturation.rs
index cf043d14..3837dc99 100644
--- a/renderScript/BasicRenderScript/Application/src/main/rs/saturation.rs
+++ b/renderScript/BasicRenderScript/Application/src/main/rs/saturation.rs
@@ -23,13 +23,13 @@ const static float3 gMonoMult = {0.299f, 0.587f, 0.114f};
float saturationValue = 0.f;
/*
-RenderScript kernel that performs saturation manipulation.
-*/
+ * RenderScript kernel that performs saturation manipulation.
+ */
uchar4 __attribute__((kernel)) saturation(uchar4 in)
{
float4 f4 = rsUnpackColor8888(in);
float3 result = dot(f4.rgb, gMonoMult);
- result = mix( result, f4.rgb, saturationValue );
+ result = mix(result, f4.rgb, saturationValue);
return rsPackColorTo8888(result);
}
diff --git a/renderScript/BasicRenderScript/README.md b/renderScript/BasicRenderScript/README.md
index 1712c600..2d440840 100644
--- a/renderScript/BasicRenderScript/README.md
+++ b/renderScript/BasicRenderScript/README.md
@@ -28,8 +28,8 @@ RGB value and it's luminance (black-and-white) value, weighted based on the user
Pre-requisites
--------------
-- Android SDK v23
-- Android Build Tools v23.0.0
+- Android SDK 24
+- Android Build Tools v24.0.0
- Android Support Repository
Screenshots
@@ -58,7 +58,7 @@ submitting a pull request through GitHub. Please see CONTRIBUTING.md for more de
License
-------
-Copyright 2014 The Android Open Source Project, Inc.
+Copyright 2016 The Android Open Source Project, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for
diff --git a/renderScript/BasicRenderScript/packaging.yaml b/renderScript/BasicRenderScript/packaging.yaml
index 5d6c11b5..06f20074 100644
--- a/renderScript/BasicRenderScript/packaging.yaml
+++ b/renderScript/BasicRenderScript/packaging.yaml
@@ -11,5 +11,5 @@ languages: [Java]
solutions: [Mobile]
github: googlesamples/android-BasicRenderScript
level: BEGINNER
-icon: BasicRenderScriptSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+icon: screenshots/icon-web.png
license: apache2-android
diff --git a/renderScript/BasicRenderScript/screenshots/icon-web.png b/renderScript/BasicRenderScript/screenshots/icon-web.png
index eb47ea1e..4f63fc75 100644
--- a/renderScript/BasicRenderScript/screenshots/icon-web.png
+++ b/renderScript/BasicRenderScript/screenshots/icon-web.png
Binary files differ
diff --git a/renderScript/BasicRenderScript/template-params.xml b/renderScript/BasicRenderScript/template-params.xml
index 9f0c5587..728b96a5 100644
--- a/renderScript/BasicRenderScript/template-params.xml
+++ b/renderScript/BasicRenderScript/template-params.xml
@@ -23,12 +23,12 @@
<package>com.example.android.basicrenderscript</package>
<!-- change minSdk if needed-->
- <minSdk>16</minSdk>
+ <minSdk>8</minSdk>
<dependency_external>'renderscript-v8.jar'</dependency_external>
<defaultConfig>
- renderscriptTargetApi 18
+ renderscriptTargetApi 24
renderscriptSupportModeEnabled true
</defaultConfig>
@@ -43,7 +43,6 @@
</strings>
<template src="base"/>
- <common src="media"/>
<metadata>
<status>PUBLISHED</status>