Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2340b842 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge changes If2f987fe,Iedf42cbc

* changes:
  Fix layer rendering glitch.
  Don't draw TextView's alpha layers when not needed.
parents 184498ce 93d2361c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -37,6 +37,10 @@ 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
+5 −0
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -455,7 +455,7 @@ bool OpenGLRenderer::createLayer(sp<Snapshot> snapshot, float left, float top,
#endif

        // Clear the FBO
        glScissor(0.0f, 0.0f, bounds.getWidth(), bounds.getHeight());
        glScissor(0.0f, 0.0f, bounds.getWidth() + 1.0f, bounds.getHeight() + 1.0f);
        glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
        glClear(GL_COLOR_BUFFER_BIT);

+4 −4
Original line number Diff line number Diff line
@@ -149,10 +149,10 @@ struct Rect {
    }

    void snapToPixelBoundaries() {
        left = floor(left);
        top = floor(top);
        right = ceil(right);
        bottom = ceil(bottom);
        left = floorf(left);
        top = floorf(top);
        right = ceilf(right);
        bottom = ceilf(bottom);
    }

    void dump() const {