diff options
author | Romain Guy <romainguy@google.com> | 2012-07-31 21:16:07 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2012-08-01 19:18:35 -0700 |
commit | 211efea7376371ee755edd2ad03e83ef6eea464e (patch) | |
tree | b79530b9f807f24571ce0e9ca143747e8c418725 /tests/HwAccelerationTest/src | |
parent | 42e1e0d482d774cf18a55773e434f02edb9e4462 (diff) | |
download | frameworks_base-211efea7376371ee755edd2ad03e83ef6eea464e.zip frameworks_base-211efea7376371ee755edd2ad03e83ef6eea464e.tar.gz frameworks_base-211efea7376371ee755edd2ad03e83ef6eea464e.tar.bz2 |
Add dithering to gradients
Change-Id: Ic1208855bde3a254eca2fd7cef43e0f1318ce419
Diffstat (limited to 'tests/HwAccelerationTest/src')
-rw-r--r-- | tests/HwAccelerationTest/src/com/android/test/hwui/GradientStopsActivity.java | 9 |
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); } } } |