summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-03-14 18:16:39 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-03-14 18:16:39 -0700
commitee7ace065f77b53a57cb6273b9f2f5d85caba90c (patch)
treef54744657dcd45c37587b454b3abc307755cb724 /tests
parenta5732aa275273edf9ae91340a440b3f2cd47c682 (diff)
parent7b5b6abf852c039983eded25ebe43a70fef5a4ab (diff)
downloadframeworks_base-ee7ace065f77b53a57cb6273b9f2f5d85caba90c.zip
frameworks_base-ee7ace065f77b53a57cb6273b9f2f5d85caba90c.tar.gz
frameworks_base-ee7ace065f77b53a57cb6273b9f2f5d85caba90c.tar.bz2
Merge "Fix rendering artifact in edge fades. Bug #4092053" into honeycomb-mr1
Diffstat (limited to 'tests')
-rw-r--r--tests/HwAccelerationTest/res/drawable/gradient.xml22
-rw-r--r--tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java17
-rw-r--r--tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java2
3 files changed, 40 insertions, 1 deletions
diff --git a/tests/HwAccelerationTest/res/drawable/gradient.xml b/tests/HwAccelerationTest/res/drawable/gradient.xml
new file mode 100644
index 0000000..756db0b
--- /dev/null
+++ b/tests/HwAccelerationTest/res/drawable/gradient.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+-->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <gradient
+ android:startColor="#FF707070"
+ android:endColor="#FF0C0C0C"
+ android:angle="270" />
+</shape>
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java
index f8422f4..90db818 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java
@@ -193,6 +193,7 @@ public class GradientsActivity extends Activity {
private final float mDrawWidth;
private final float mDrawHeight;
private final LinearGradient mGradient;
+ private final LinearGradient mGradientStops;
private final Matrix mMatrix;
ShadersView(Context c) {
@@ -202,6 +203,9 @@ public class GradientsActivity extends Activity {
mDrawHeight = 200;
mGradient = new LinearGradient(0, 0, 0, 1, 0xFF000000, 0, Shader.TileMode.CLAMP);
+ mGradientStops = new LinearGradient(0, 0, 0, 1,
+ new int[] { 0xFFFF0000, 0xFF00FF00, 0xFF0000FF }, null, Shader.TileMode.CLAMP);
+
mMatrix = new Matrix();
mPaint = new Paint();
@@ -255,6 +259,19 @@ public class GradientsActivity extends Activity {
mGradient.setLocalMatrix(mMatrix);
canvas.drawRect(left, top, left + mDrawWidth, bottom, mPaint);
+ right = left + mDrawWidth;
+ left = 40.0f;
+ top = bottom + 20.0f;
+ bottom = top + 50.0f;
+
+ mPaint.setShader(mGradientStops);
+
+ mMatrix.setScale(1, mDrawWidth);
+ mMatrix.postRotate(90);
+ mMatrix.postTranslate(right, top);
+ mGradientStops.setLocalMatrix(mMatrix);
+ canvas.drawRect(left, top, right, bottom, mPaint);
+
canvas.restore();
}
}
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java
index 763169a..535f865 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java
@@ -79,7 +79,7 @@ public class TransparentListActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getWindow().setBackgroundDrawable(getResources().getDrawable(R.drawable.default_wallpaper));
+ getWindow().setBackgroundDrawable(getResources().getDrawable(R.drawable.gradient));
setContentView(R.layout.list_activity);
ListAdapter adapter = new SimpleListAdapter(this);