diff options
| author | Derek Sollenberger <djsollen@google.com> | 2014-05-08 14:41:46 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-08 14:41:47 +0000 |
| commit | 5b554f010358d8f47e31d92a42aa3edc4a71ec47 (patch) | |
| tree | 3adcf06e0c8b18fe725188888031870e485e6be0 /core/java/android | |
| parent | cf501a60b8817acdea2368eb56225ebc831b1559 (diff) | |
| parent | c29a0a4664a4b9871fadd668b632469a0db240b9 (diff) | |
| download | frameworks_base-5b554f010358d8f47e31d92a42aa3edc4a71ec47.zip frameworks_base-5b554f010358d8f47e31d92a42aa3edc4a71ec47.tar.gz frameworks_base-5b554f010358d8f47e31d92a42aa3edc4a71ec47.tar.bz2 | |
Merge "Avoid caching shadow properties in Java & HWUI."
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/GLES20Canvas.java | 15 | ||||
| -rw-r--r-- | core/java/android/widget/TextView.java | 5 |
2 files changed, 4 insertions, 16 deletions
diff --git a/core/java/android/view/GLES20Canvas.java b/core/java/android/view/GLES20Canvas.java index f234baa..6c451eb 100644 --- a/core/java/android/view/GLES20Canvas.java +++ b/core/java/android/view/GLES20Canvas.java @@ -43,7 +43,6 @@ import android.text.TextUtils; class GLES20Canvas extends HardwareCanvas { // Must match modifiers used in the JNI layer private static final int MODIFIER_NONE = 0; - private static final int MODIFIER_SHADOW = 1; private static final int MODIFIER_SHADER = 2; private final boolean mOpaque; @@ -1297,12 +1296,6 @@ class GLES20Canvas extends HardwareCanvas { private int setupModifiers(Paint paint) { int modifiers = MODIFIER_NONE; - if (paint.hasShadow) { - nSetupShadow(mRenderer, paint.shadowRadius, paint.shadowDx, paint.shadowDy, - paint.shadowColor); - modifiers |= MODIFIER_SHADOW; - } - final Shader shader = paint.getShader(); if (shader != null) { nSetupShader(mRenderer, shader.native_shader); @@ -1315,12 +1308,6 @@ class GLES20Canvas extends HardwareCanvas { private int setupModifiers(Paint paint, int flags) { int modifiers = MODIFIER_NONE; - if (paint.hasShadow && (flags & MODIFIER_SHADOW) != 0) { - nSetupShadow(mRenderer, paint.shadowRadius, paint.shadowDx, paint.shadowDy, - paint.shadowColor); - modifiers |= MODIFIER_SHADOW; - } - final Shader shader = paint.getShader(); if (shader != null && (flags & MODIFIER_SHADER) != 0) { nSetupShader(mRenderer, shader.native_shader); @@ -1331,8 +1318,6 @@ class GLES20Canvas extends HardwareCanvas { } private static native void nSetupShader(long renderer, long shader); - private static native void nSetupShadow(long renderer, float radius, - float dx, float dy, int color); private static native void nResetModifiers(long renderer, int modifiers); } diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index b91111d..8f073de 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -289,6 +289,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private Spannable.Factory mSpannableFactory = Spannable.Factory.getInstance(); private float mShadowRadius, mShadowDx, mShadowDy; + private int mShadowColor; + private boolean mPreDrawRegistered; @@ -2755,6 +2757,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mShadowRadius = radius; mShadowDx = dx; mShadowDy = dy; + mShadowColor = color; // Will change text clip region if (mEditor != null) mEditor.invalidateTextDisplayList(); @@ -2804,7 +2807,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * @attr ref android.R.styleable#TextView_shadowColor */ public int getShadowColor() { - return mTextPaint.shadowColor; + return mShadowColor; } /** |
