diff options
author | Romain Guy <romainguy@google.com> | 2013-03-19 02:37:23 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-03-19 02:37:23 +0000 |
commit | 3c122050903dfb91ed49c2f0fb2affb93b3c4bb2 (patch) | |
tree | 265b4399040b4bc704ae6f35852cc28a7c29c723 /tests | |
parent | af216f7ce714a3e7b93288bdf7a9273d0c301b35 (diff) | |
parent | 595b5bdf08ab315898b4af0c5c7033a912e004f7 (diff) | |
download | frameworks_base-3c122050903dfb91ed49c2f0fb2affb93b3c4bb2.zip frameworks_base-3c122050903dfb91ed49c2f0fb2affb93b3c4bb2.tar.gz frameworks_base-3c122050903dfb91ed49c2f0fb2affb93b3c4bb2.tar.bz2 |
am 595b5bdf: am 603ce559: Merge "Apply ComposeShader\'s local matrix to children" into jb-mr2-dev
* commit '595b5bdf08ab315898b4af0c5c7033a912e004f7':
Apply ComposeShader's local matrix to children
Diffstat (limited to 'tests')
-rw-r--r-- | tests/HwAccelerationTest/src/com/android/test/hwui/MoreShadersActivity.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MoreShadersActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/MoreShadersActivity.java index 02cb4b6..1847f43 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/MoreShadersActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/MoreShadersActivity.java @@ -57,6 +57,7 @@ public class MoreShadersActivity extends Activity { private Paint mLargePaint; private BitmapShader mScaled2Shader; private ColorFilter mColorFilter; + private final Matrix mMtx1; ShadersView(Context c) { super(c); @@ -70,7 +71,7 @@ public class MoreShadersActivity extends Activity { mScaledShader = new BitmapShader(texture, Shader.TileMode.MIRROR, Shader.TileMode.MIRROR); Matrix m2 = new Matrix(); - m2.setScale(0.5f, 0.5f); + m2.setScale(0.1f, 0.1f); mScaledShader.setLocalMatrix(m2); mScaled2Shader = new BitmapShader(texture, Shader.TileMode.MIRROR, @@ -81,12 +82,20 @@ public class MoreShadersActivity extends Activity { mHorGradient = new LinearGradient(0.0f, 0.0f, mDrawWidth, 0.0f, Color.RED, 0x7f00ff00, Shader.TileMode.CLAMP); - + Matrix m4 = new Matrix(); + m4.setScale(0.5f, 0.5f); + mHorGradient.setLocalMatrix(m4); + mVertGradient = new LinearGradient(0.0f, 0.0f, 0.0f, mDrawHeight / 2.0f, Color.YELLOW, Color.MAGENTA, Shader.TileMode.MIRROR); mComposeShader = new ComposeShader(mScaledShader, mHorGradient, PorterDuff.Mode.SRC_OVER); + mMtx1 = new Matrix(); + mMtx1.setTranslate(mTexWidth / 2.0f, mTexHeight / 2.0f); + mMtx1.postRotate(45, 0, 0); + mComposeShader.setLocalMatrix(mMtx1); + mCompose2Shader = new ComposeShader(mHorGradient, mScaledShader, PorterDuff.Mode.SRC_OUT); |