summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-08-03 11:09:49 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-03 11:09:49 -0700
commita70cd04985eec51d95355cc7b822bc65f4ebce05 (patch)
treef6f9149058914eff13bfd35b8eea8d213fa08311 /tests
parent5345c310af8363948cee6a91d11add3ec51e8a9c (diff)
parent211efea7376371ee755edd2ad03e83ef6eea464e (diff)
downloadframeworks_base-a70cd04985eec51d95355cc7b822bc65f4ebce05.zip
frameworks_base-a70cd04985eec51d95355cc7b822bc65f4ebce05.tar.gz
frameworks_base-a70cd04985eec51d95355cc7b822bc65f4ebce05.tar.bz2
Merge "Add dithering to gradients" into jb-mr1-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/HwAccelerationTest/src/com/android/test/hwui/GradientStopsActivity.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GradientStopsActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/GradientStopsActivity.java
index ed00ecd..a73eab5 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/GradientStopsActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/GradientStopsActivity.java
@@ -19,6 +19,7 @@ package com.android.test.hwui;
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Shader;
@@ -111,6 +112,14 @@ public class GradientStopsActivity extends Activity {
canvas.translate(0.0f, 75.0f);
canvas.drawRect(0.0f, 0.0f, 768.0f, 50.0f, paint);
+
+ gradient = new LinearGradient(0.0f, 0.0f, 512.0f, 0.0f,
+ colors, null, Shader.TileMode.CLAMP);
+
+ paint.setShader(gradient);
+
+ canvas.translate(0.0f, 75.0f);
+ canvas.drawRect(0.0f, 0.0f, 512.0f, 50.0f, paint);
}
}
}