From 39b01293e262ed3b5fda41be6f33ae1124ffecbe Mon Sep 17 00:00:00 2001 From: Yuichi Araki Date: Fri, 8 Jul 2016 13:54:27 +0900 Subject: RenderScriptIntrinsic: Several fixes - Materialize - Lower the minSdkVersion to 14 Change-Id: I08b7b1bea42f8dba200aea04ab14a4f709ce5976 --- .../Application/src/main/AndroidManifest.xml | 26 ++-- .../renderscriptintrinsic/MainActivity.java | 141 +++++++++------------ .../ThumbnailRadioButton.java | 30 +++-- .../src/main/res/drawable-hdpi/ic_launcher.png | Bin 4440 -> 0 bytes .../src/main/res/drawable-mdpi/ic_launcher.png | Bin 2742 -> 0 bytes .../src/main/res/drawable-xhdpi/ic_launcher.png | Bin 6245 -> 0 bytes .../src/main/res/drawable-xxhdpi/ic_launcher.png | Bin 11130 -> 0 bytes .../src/main/res/layout/main_layout.xml | 45 +++++-- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3305 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2077 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4199 bytes .../src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 6772 bytes .../src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9955 bytes .../Application/src/main/res/values-v11/styles.xml | 24 ---- .../Application/src/main/res/values-v14/styles.xml | 12 -- .../Application/src/main/res/values/colors.xml | 21 ++- .../Application/src/main/res/values/strings.xml | 21 +++ .../Application/src/main/res/values/styles.xml | 46 +++---- renderScript/RenderScriptIntrinsic/README.md | 19 +-- .../RenderScriptIntrinsic/screenshots/icon-web.png | Bin 68679 -> 37457 bytes .../RenderScriptIntrinsic/template-params.xml | 28 ++-- 21 files changed, 207 insertions(+), 206 deletions(-) delete mode 100755 renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-hdpi/ic_launcher.png delete mode 100755 renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-mdpi/ic_launcher.png delete mode 100755 renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-xhdpi/ic_launcher.png delete mode 100755 renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-xxhdpi/ic_launcher.png create mode 100644 renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 renderScript/RenderScriptIntrinsic/Application/src/main/res/values-v11/styles.xml delete mode 100644 renderScript/RenderScriptIntrinsic/Application/src/main/res/values-v14/styles.xml create mode 100644 renderScript/RenderScriptIntrinsic/Application/src/main/res/values/strings.xml (limited to 'renderScript') diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/AndroidManifest.xml b/renderScript/RenderScriptIntrinsic/Application/src/main/AndroidManifest.xml index e108aff2..f34e2bcf 100644 --- a/renderScript/RenderScriptIntrinsic/Application/src/main/AndroidManifest.xml +++ b/renderScript/RenderScriptIntrinsic/Application/src/main/AndroidManifest.xml @@ -1,4 +1,5 @@ - - - - - - + - + android:theme="@style/Theme.RenderScriptIntrinsic"> + android:label="RenderScriptIntrinsic"> - - + + - diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/java/com/example/android/renderscriptintrinsic/MainActivity.java b/renderScript/RenderScriptIntrinsic/Application/src/main/java/com/example/android/renderscriptintrinsic/MainActivity.java index 4b6f5ce1..fa1e6f5b 100644 --- a/renderScript/RenderScriptIntrinsic/Application/src/main/java/com/example/android/renderscriptintrinsic/MainActivity.java +++ b/renderScript/RenderScriptIntrinsic/Application/src/main/java/com/example/android/renderscriptintrinsic/MainActivity.java @@ -16,25 +16,32 @@ package com.example.android.renderscriptintrinsic; -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.v7.widget.Toolbar; +import android.support.v8.renderscript.Allocation; +import android.support.v8.renderscript.Element; +import android.support.v8.renderscript.Matrix3f; +import android.support.v8.renderscript.RenderScript; +import android.support.v8.renderscript.ScriptIntrinsicBlur; +import android.support.v8.renderscript.ScriptIntrinsicColorMatrix; +import android.support.v8.renderscript.ScriptIntrinsicConvolve5x5; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.ImageView; import android.widget.RadioButton; 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; @@ -59,14 +66,10 @@ public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.main_layout); + setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); - /* - * Initialize UI - */ - - //Set up main image view + // Set up main image view mBitmapIn = loadBitmap(R.drawable.data); mBitmapsOut = new Bitmap[NUM_BITMAPS]; for (int i = 0; i < NUM_BITMAPS; ++i) { @@ -131,20 +134,13 @@ public class MainActivity extends Activity { } }); - /* - * Create renderScript - */ + // Create renderScript createScript(); - /* - * Create thumbnails - */ + // Create thumbnails createThumbnail(); - - /* - * Invoke renderScript kernel and update imageView - */ + // Invoke renderScript kernel and update imageView mFilterMode = MODE_BLUR; updateImage(50); } @@ -159,12 +155,10 @@ public class MainActivity extends Activity { mOutAllocations[i] = Allocation.createFromBitmap(mRS, mBitmapsOut[i]); } - /* - Create intrinsics. - RenderScript has built-in features such as blur, convolve filter etc. - These intrinsics are handy for specific operations without writing RenderScript kernel. - In the sample, it's creating blur, convolve and matrix intrinsics. - */ + // Create intrinsics. + // RenderScript has built-in features such as blur, convolve filter etc. + // These intrinsics are handy for specific operations without writing RenderScript kernel. + // In the sample, it's creating blur, convolve and matrix intrinsics. mScriptBlur = ScriptIntrinsicBlur.create(mRS, Element.U8_4(mRS)); mScriptConvolve = ScriptIntrinsicConvolve5x5.create(mRS, @@ -177,18 +171,15 @@ public class MainActivity extends Activity { Allocation outAllocation, Bitmap bitmapOut, float value) { switch (mFilterMode) { case MODE_BLUR: - /* - * Set blur kernel size - */ + // Set blur kernel size mScriptBlur.setRadius(value); - /* - * Invoke filter kernel - */ + // Invoke filter kernel mScriptBlur.setInput(inAllocation); mScriptBlur.forEach(outAllocation); break; case MODE_CONVOLVE: { + @SuppressWarnings("UnnecessaryLocalVariable") float f1 = value; float f2 = 1.0f - f1; @@ -196,24 +187,18 @@ public class MainActivity extends Activity { float coefficients[] = {-f1 * 2, 0, -f1, 0, 0, 0, -f2 * 2, -f2, 0, 0, -f1, -f2, 1, f2, f1, 0, 0, f2, f2 * 2, 0, 0, 0, f1, 0, f1 * 2,}; - /* - * Set kernel parameter - */ + // Set kernel parameter mScriptConvolve.setCoefficients(coefficients); - /* - * Invoke filter kernel - */ + // Invoke filter kernel mScriptConvolve.setInput(inAllocation); mScriptConvolve.forEach(outAllocation); break; } case MODE_COLORMATRIX: { - /* - * Set HUE rotation matrix - * The matrix below performs a combined operation of, - * RGB->HSV transform * HUE rotation * HSV->RGB transform - */ + // Set HUE rotation matrix + // The matrix below performs a combined operation of, + // RGB->HSV transform * HUE rotation * HSV->RGB transform float cos = (float) Math.cos((double) value); float sin = (float) Math.sin((double) value); Matrix3f mat = new Matrix3f(); @@ -228,23 +213,19 @@ public class MainActivity extends Activity { mat.set(2, 2, (float) (.114 + .886 * cos - .203 * sin)); mScriptMatrix.setColorMatrix(mat); - /* - * Invoke filter kernel - */ + // Invoke filter kernel mScriptMatrix.forEach(inAllocation, outAllocation); } break; } - /* - * Copy to bitmap and invalidate image view - */ + // Copy to bitmap and invalidate image view outAllocation.copyTo(bitmapOut); } - /* - Convert seekBar progress parameter (0-100 in range) to parameter for each intrinsic filter. - (e.g. 1.0-25.0 in Blur filter) + /** + * Convert seekBar progress parameter (0-100 in range) to parameter for each intrinsic filter. + * (e.g. 1.0-25.0 in Blur filter) */ private float getFilterParameter(int i) { float f = 0.f; @@ -269,21 +250,24 @@ public class MainActivity extends Activity { break; } return f; - } - /* + /** * 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 { - Boolean issued = false; + + private boolean mIssued; protected Integer doInBackground(Float... values) { int index = -1; - if (isCancelled() == false) { - issued = true; + if (!isCancelled()) { + mIssued = true; index = mCurrentBitmap; performFilter(mInAllocation, mOutAllocations[index], mBitmapsOut[index], values[0]); @@ -305,16 +289,17 @@ public class MainActivity extends Activity { } protected void onCancelled(Integer result) { - if (issued) { + if (mIssued) { updateView(result); } } } - /* - 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(int progress) { float f = getFilterParameter(progress); @@ -326,8 +311,8 @@ public class MainActivity extends Activity { mLatestTask.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(); @@ -335,9 +320,9 @@ public class MainActivity extends Activity { return BitmapFactory.decodeResource(getResources(), resource, options); } - /* - Create thumbNail for UI. It invokes RenderScript kernel synchronously in UI-thread, - which is OK for small thumbnail (but not ideal). + /** + * Create thumbNail for UI. It invokes RenderScript kernel synchronously in UI-thread, + * which is OK for small thumbnail (but not ideal). */ private void createThumbnail() { int width = 72; @@ -346,11 +331,11 @@ public class MainActivity extends Activity { int pixelsWidth = (int) (width * scale + 0.5f); int pixelsHeight = (int) (height * scale + 0.5f); - //Temporary image + // Temporary image Bitmap tempBitmap = Bitmap.createScaledBitmap(mBitmapIn, pixelsWidth, pixelsHeight, false); Allocation inAllocation = Allocation.createFromBitmap(mRS, tempBitmap); - //Create thumbnail with each RS intrinsic and set it to radio buttons + // Create thumbnail with each RS intrinsic and set it to radio buttons int[] modes = {MODE_BLUR, MODE_CONVOLVE, MODE_COLORMATRIX}; int[] ids = {R.id.radio0, R.id.radio1, R.id.radio2}; int[] parameter = {50, 100, 25}; @@ -358,13 +343,13 @@ public class MainActivity extends Activity { mFilterMode = mode; float f = getFilterParameter(parameter[mode]); - Bitmap destBitpmap = Bitmap.createBitmap(tempBitmap.getWidth(), + Bitmap destBitmap = Bitmap.createBitmap(tempBitmap.getWidth(), tempBitmap.getHeight(), tempBitmap.getConfig()); - Allocation outAllocation = Allocation.createFromBitmap(mRS, destBitpmap); - performFilter(inAllocation, outAllocation, destBitpmap, f); + Allocation outAllocation = Allocation.createFromBitmap(mRS, destBitmap); + performFilter(inAllocation, outAllocation, destBitmap, f); ThumbnailRadioButton button = (ThumbnailRadioButton) findViewById(ids[mode]); - button.setThumbnail(destBitpmap); + button.setThumbnail(destBitmap); } } } diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/java/com/example/android/renderscriptintrinsic/ThumbnailRadioButton.java b/renderScript/RenderScriptIntrinsic/Application/src/main/java/com/example/android/renderscriptintrinsic/ThumbnailRadioButton.java index 160e970b..0a42fbe4 100644 --- a/renderScript/RenderScriptIntrinsic/Application/src/main/java/com/example/android/renderscriptintrinsic/ThumbnailRadioButton.java +++ b/renderScript/RenderScriptIntrinsic/Application/src/main/java/com/example/android/renderscriptintrinsic/ThumbnailRadioButton.java @@ -16,6 +16,7 @@ package com.example.android.renderscriptintrinsic; +import android.content.Context; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Paint; @@ -26,16 +27,17 @@ import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.StateListDrawable; import android.graphics.drawable.shapes.RectShape; import android.os.Build; +import android.util.AttributeSet; import android.view.Gravity; import android.widget.RadioButton; -import android.content.Context; -import android.util.AttributeSet; -/* - A button with Thumbnail which extends Radio Button. - The widget override a background drawable of Radio Button with a StateList Drawable. - Each state has a LayerDrawable with a Thumbnail image and a Focus rectangle. - It's using original Radio Buttons text as a label, because LayerDrawable showed some issues with Canvas.drawText(). +/** + * A button with Thumbnail which extends Radio Button. + * + *

The widget override a background drawable of Radio Button with a StateList Drawable. Each + * state has a LayerDrawable with a Thumbnail image and a Focus rectangle. It's using original + * Radio Buttons text as a label, because LayerDrawable showed some issues with + * Canvas.drawText().

*/ public class ThumbnailRadioButton extends RadioButton { public ThumbnailRadioButton(Context context) { @@ -58,12 +60,12 @@ public class ThumbnailRadioButton extends RadioButton { } public void setThumbnail(Bitmap bitmap) { - //Bitmap drawable + // Bitmap drawable BitmapDrawable bmp = new BitmapDrawable(getResources(), bitmap); bmp.setGravity(Gravity.CENTER); int strokeWidth = 24; - //Checked state + // Checked state ShapeDrawable rectChecked = new ShapeDrawable(new RectShape()); rectChecked.getPaint().setColor(0xFFFFFFFF); rectChecked.getPaint().setStyle(Paint.Style.STROKE); @@ -73,7 +75,7 @@ public class ThumbnailRadioButton extends RadioButton { Drawable drawableArray[] = new Drawable[]{bmp, rectChecked}; LayerDrawable layerChecked = new LayerDrawable(drawableArray); - //Unchecked state + // Unchecked state ShapeDrawable rectUnchecked = new ShapeDrawable(new RectShape()); rectUnchecked.getPaint().setColor(0x0); rectUnchecked.getPaint().setStyle(Paint.Style.STROKE); @@ -83,17 +85,19 @@ public class ThumbnailRadioButton extends RadioButton { Drawable drawableArray2[] = new Drawable[]{bmp, rectUnchecked}; LayerDrawable layerUnchecked = new LayerDrawable(drawableArray2); - //Statelist drawable + // StateList drawable StateListDrawable states = new StateListDrawable(); states.addState(new int[]{android.R.attr.state_checked}, layerChecked); states.addState(new int[]{}, layerUnchecked); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { setBackground(states); - else + } else { + //noinspection deprecation setBackgroundDrawable(states); + } //Offset text to center/bottom of the checkbox Paint paint = new Paint(); diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-hdpi/ic_launcher.png b/renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-hdpi/ic_launcher.png deleted file mode 100755 index 75b3c978..00000000 Binary files a/renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-mdpi/ic_launcher.png b/renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-mdpi/ic_launcher.png deleted file mode 100755 index 4ccd98e0..00000000 Binary files a/renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-xhdpi/ic_launcher.png deleted file mode 100755 index 7c5aeed0..00000000 Binary files a/renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-xxhdpi/ic_launcher.png deleted file mode 100755 index 3c45f511..00000000 Binary files a/renderScript/RenderScriptIntrinsic/Application/src/main/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/layout/main_layout.xml b/renderScript/RenderScriptIntrinsic/Application/src/main/res/layout/main_layout.xml index 13516d8c..714be844 100644 --- a/renderScript/RenderScriptIntrinsic/Application/src/main/res/layout/main_layout.xml +++ b/renderScript/RenderScriptIntrinsic/Application/src/main/res/layout/main_layout.xml @@ -1,44 +1,69 @@ - + + + android:src="@drawable/data"/> + + + android:layout_centerHorizontal="true" + android:layout_marginBottom="8dp" + android:orientation="horizontal"> + android:text="@string/blur"/> + android:text="@string/emboss"/> + android:text="@string/hue"/> + + android:layout_margin="16dp"/> diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-hdpi/ic_launcher.png b/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..933f5634 Binary files /dev/null and b/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-mdpi/ic_launcher.png b/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..f0404d61 Binary files /dev/null and b/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-xhdpi/ic_launcher.png b/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..4afeeb58 Binary files /dev/null and b/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-xxhdpi/ic_launcher.png b/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..2dde891f Binary files /dev/null and b/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..adca6170 Binary files /dev/null and b/renderScript/RenderScriptIntrinsic/Application/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/values-v11/styles.xml b/renderScript/RenderScriptIntrinsic/Application/src/main/res/values-v11/styles.xml deleted file mode 100644 index f3a90c68..00000000 --- a/renderScript/RenderScriptIntrinsic/Application/src/main/res/values-v11/styles.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/values-v14/styles.xml b/renderScript/RenderScriptIntrinsic/Application/src/main/res/values-v14/styles.xml deleted file mode 100644 index a91fd037..00000000 --- a/renderScript/RenderScriptIntrinsic/Application/src/main/res/values-v14/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/values/colors.xml b/renderScript/RenderScriptIntrinsic/Application/src/main/res/values/colors.xml index 327c0604..24618bb9 100644 --- a/renderScript/RenderScriptIntrinsic/Application/src/main/res/values/colors.xml +++ b/renderScript/RenderScriptIntrinsic/Application/src/main/res/values/colors.xml @@ -1,5 +1,24 @@ + + - #66000000 + #FF5722 + #99FF5722 + #E64A19 + #00BCD4 diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/values/strings.xml b/renderScript/RenderScriptIntrinsic/Application/src/main/res/values/strings.xml new file mode 100644 index 00000000..837523f2 --- /dev/null +++ b/renderScript/RenderScriptIntrinsic/Application/src/main/res/values/strings.xml @@ -0,0 +1,21 @@ + + + + Blur + Emboss + Hue + diff --git a/renderScript/RenderScriptIntrinsic/Application/src/main/res/values/styles.xml b/renderScript/RenderScriptIntrinsic/Application/src/main/res/values/styles.xml index 12eb9302..3ecc30ea 100644 --- a/renderScript/RenderScriptIntrinsic/Application/src/main/res/values/styles.xml +++ b/renderScript/RenderScriptIntrinsic/Application/src/main/res/values/styles.xml @@ -1,33 +1,25 @@ - - + + - + 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. +--> + - diff --git a/renderScript/RenderScriptIntrinsic/README.md b/renderScript/RenderScriptIntrinsic/README.md index 06dc559c..05e1207a 100644 --- a/renderScript/RenderScriptIntrinsic/README.md +++ b/renderScript/RenderScriptIntrinsic/README.md @@ -9,9 +9,9 @@ Also shows how to extends RedioButton with StateListDrawable. Introduction ------------ -[RenderScript][1] is a framework for running computationally intensive tasks at high performance on Android. RenderScript is -primarily oriented for use with data-parallel computation, although serial computationally intensive workloads can -benefit as well. +[RenderScript][1] is a framework for running computationally intensive tasks at high performance on +Android. RenderScript is primarily oriented for use with data-parallel computation, although serial +computationally intensive workloads can benefit as well. RenderScript **intrinsics** are built-in functions that perform well-defined operations often seen in image processing. Intrinsics provide extremely high-performance implementations of standard @@ -27,17 +27,18 @@ mScriptMatrix = ScriptIntrinsicColorMatrix.create(mRS, Element.U8_4(mRS)); ``` -RenderScript intrinsics will usually be the fastest possible way for a developer to perform these operations. The -Android team works closely with our partners to ensure that the intrinsics perform as fast as possible on their -architectures — often far beyond anything that can be achieved in a general-purpose language. +RenderScript intrinsics will usually be the fastest possible way for a developer to perform these +operations. The Android team works closely with our partners to ensure that the intrinsics perform +as fast as possible on their architectures — often far beyond anything that can be achieved in a +general-purpose language. [1]: http://developer.android.com/guide/topics/renderscript/compute.html Pre-requisites -------------- -- Android SDK v23 -- Android Build Tools v23.0.0 +- Android SDK 24 +- Android Build Tools v24.0.0 - Android Support Repository Screenshots @@ -66,7 +67,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/RenderScriptIntrinsic/screenshots/icon-web.png b/renderScript/RenderScriptIntrinsic/screenshots/icon-web.png index 87f9dac0..20c9776d 100644 Binary files a/renderScript/RenderScriptIntrinsic/screenshots/icon-web.png and b/renderScript/RenderScriptIntrinsic/screenshots/icon-web.png differ diff --git a/renderScript/RenderScriptIntrinsic/template-params.xml b/renderScript/RenderScriptIntrinsic/template-params.xml index a2a93700..0a63cdb2 100644 --- a/renderScript/RenderScriptIntrinsic/template-params.xml +++ b/renderScript/RenderScriptIntrinsic/template-params.xml @@ -20,28 +20,26 @@ RenderScript com.example.android.renderscriptintrinsic - - 13 + 14 'renderscript-v8.jar' - renderscriptTargetApi 18 + renderscriptTargetApi 24 renderscriptSupportModeEnabled true