summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/view/ViewConfiguration.java6
-rw-r--r--core/java/android/widget/TextView.java5
-rw-r--r--libs/hwui/OpenGLRenderer.cpp1
3 files changed, 11 insertions, 1 deletions
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index f413475..85981d2 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -37,7 +37,11 @@ public class ViewConfiguration {
* @hide
*/
public static final float ALPHA_THRESHOLD = 0.5f / PANEL_BIT_DEPTH;
-
+ /**
+ * @hide
+ */
+ public static final float ALPHA_THRESHOLD_INT = 0x7f / PANEL_BIT_DEPTH;
+
/**
* Defines the width of the horizontal scrollbar and the height of the vertical scrollbar in
* pixels
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 9c80ef8..fccf155 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -16,6 +16,7 @@
package android.widget;
+import android.view.ViewConfiguration;
import com.android.internal.util.FastMath;
import com.android.internal.widget.EditableInputConnection;
@@ -3954,6 +3955,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
@Override
protected void onDraw(Canvas canvas) {
+ if (mCurrentAlpha <= ViewConfiguration.ALPHA_THRESHOLD_INT) return;
+
restartMarqueeIfNeeded();
// Draw the background for this view
@@ -7047,6 +7050,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
@Override
protected float getLeftFadingEdgeStrength() {
+ if (mCurrentAlpha <= ViewConfiguration.ALPHA_THRESHOLD_INT) return 0.0f;
if (mEllipsize == TextUtils.TruncateAt.MARQUEE) {
if (mMarquee != null && !mMarquee.isStopped()) {
final Marquee marquee = mMarquee;
@@ -7073,6 +7077,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
@Override
protected float getRightFadingEdgeStrength() {
+ if (mCurrentAlpha <= ViewConfiguration.ALPHA_THRESHOLD_INT) return 0.0f;
if (mEllipsize == TextUtils.TruncateAt.MARQUEE) {
if (mMarquee != null && !mMarquee.isStopped()) {
final Marquee marquee = mMarquee;
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index d81760d..ac3bc9c 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -455,6 +455,7 @@ bool OpenGLRenderer::createLayer(sp<Snapshot> snapshot, float left, float top,
#endif
// Clear the FBO
+ bounds.snapToPixelBoundaries();
glScissor(0.0f, 0.0f, bounds.getWidth(), bounds.getHeight());
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);