summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2014-07-11 14:35:05 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-10 21:35:02 +0000
commitd66a8719b019e948d1dfbda2dace8762189e298f (patch)
treeeebc49784b515232020950942d55e8a170c80051 /tests
parent219cca781b1e76c01a538e3eefedfb9c96305a19 (diff)
parentab87983a11e0bd2e08d752d86d5e945ea7d39a04 (diff)
downloadframeworks_base-d66a8719b019e948d1dfbda2dace8762189e298f.zip
frameworks_base-d66a8719b019e948d1dfbda2dace8762189e298f.tar.gz
frameworks_base-d66a8719b019e948d1dfbda2dace8762189e298f.tar.bz2
Merge "Simplify Shader.setLocalMatrix."
Diffstat (limited to 'tests')
-rw-r--r--tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java
index 90db818..fbe7856 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java
@@ -223,12 +223,11 @@ public class GradientsActivity extends Activity {
float left = 40.0f;
float bottom = 40.0f + mDrawHeight;
- mPaint.setShader(mGradient);
-
mMatrix.setScale(1, mDrawWidth);
mMatrix.postRotate(90);
mMatrix.postTranslate(right, top);
mGradient.setLocalMatrix(mMatrix);
+ mPaint.setShader(mGradient);
canvas.drawRect(right - mDrawWidth, top, right, top + mDrawHeight, mPaint);
top += 40.0f + mDrawHeight;
@@ -237,6 +236,7 @@ public class GradientsActivity extends Activity {
mMatrix.setScale(1, mDrawHeight);
mMatrix.postTranslate(left, top);
mGradient.setLocalMatrix(mMatrix);
+ mPaint.setShader(mGradient);
canvas.drawRect(left, top, right, top + mDrawHeight, mPaint);
left += 40.0f + mDrawWidth;
@@ -248,6 +248,7 @@ public class GradientsActivity extends Activity {
mMatrix.postRotate(180);
mMatrix.postTranslate(left, bottom);
mGradient.setLocalMatrix(mMatrix);
+ mPaint.setShader(mGradient);
canvas.drawRect(left, bottom - mDrawHeight, right, bottom, mPaint);
top += 40.0f + mDrawHeight;
@@ -257,6 +258,7 @@ public class GradientsActivity extends Activity {
mMatrix.postRotate(-90);
mMatrix.postTranslate(left, top);
mGradient.setLocalMatrix(mMatrix);
+ mPaint.setShader(mGradient);
canvas.drawRect(left, top, left + mDrawWidth, bottom, mPaint);
right = left + mDrawWidth;
@@ -264,12 +266,11 @@ public class GradientsActivity extends Activity {
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);
+ mPaint.setShader(mGradientStops);
canvas.drawRect(left, top, right, bottom, mPaint);
canvas.restore();