summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2014-03-31 13:52:39 -0400
committerDerek Sollenberger <djsollen@google.com>2014-05-07 09:36:04 -0400
commitc29a0a4664a4b9871fadd668b632469a0db240b9 (patch)
tree33e324bd3698bf9c100f998389694e4baeefaa57 /core/java/android
parentae84e20b2a0cb77223d40f55c71011d3ae8c71c7 (diff)
downloadframeworks_base-c29a0a4664a4b9871fadd668b632469a0db240b9.zip
frameworks_base-c29a0a4664a4b9871fadd668b632469a0db240b9.tar.gz
frameworks_base-c29a0a4664a4b9871fadd668b632469a0db240b9.tar.bz2
Avoid caching shadow properties in Java & HWUI.
bug: 10650594 Change-Id: I6f57df002710bb0567ed7e53fc0bfe96cfd504b8
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/GLES20Canvas.java15
-rw-r--r--core/java/android/widget/TextView.java5
2 files changed, 4 insertions, 16 deletions
diff --git a/core/java/android/view/GLES20Canvas.java b/core/java/android/view/GLES20Canvas.java
index 34b85d9..5b2ce60 100644
--- a/core/java/android/view/GLES20Canvas.java
+++ b/core/java/android/view/GLES20Canvas.java
@@ -42,7 +42,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;
@@ -1307,12 +1306,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);
@@ -1325,12 +1318,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);
@@ -1341,8 +1328,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;
}
/**