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

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

Merge "Correctly mark layers dirty when drawing WebView."

parents 5a6f9faf d643bb56
Loading
Loading
Loading
Loading
+15 −10
Original line number Original line Diff line number Diff line
@@ -2447,21 +2447,26 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                }
                }
                cache = child.getDrawingCache(true);
                cache = child.getDrawingCache(true);
            } else {
            } else {
                if (layerType == LAYER_TYPE_SOFTWARE) {
                switch (layerType) {
                    case LAYER_TYPE_SOFTWARE:
                        child.buildDrawingCache(true);
                        child.buildDrawingCache(true);
                        cache = child.getDrawingCache(true);
                        cache = child.getDrawingCache(true);
                } else if (layerType == LAYER_TYPE_NONE) {
                        break;
                    case LAYER_TYPE_NONE:
                        // Delay getting the display list until animation-driven alpha values are
                        // Delay getting the display list until animation-driven alpha values are
                        // set up and possibly passed on to the view
                        // set up and possibly passed on to the view
                        hasDisplayList = child.canHaveDisplayList();
                        hasDisplayList = child.canHaveDisplayList();
                        break;
                }
                }
            }
            }
        }
        }


        final boolean hasNoCache = cache == null || hasDisplayList;
        final boolean hasNoCache = cache == null || hasDisplayList;
        final boolean offsetForScroll = cache == null && !hasDisplayList &&
                layerType != LAYER_TYPE_HARDWARE;


        final int restoreTo = canvas.save();
        final int restoreTo = canvas.save();
        if (cache == null && !hasDisplayList) {
        if (offsetForScroll) {
            canvas.translate(cl - sx, ct - sy);
            canvas.translate(cl - sx, ct - sy);
        } else {
        } else {
            canvas.translate(cl, ct);
            canvas.translate(cl, ct);
@@ -2477,7 +2482,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                int transX = 0;
                int transX = 0;
                int transY = 0;
                int transY = 0;


                if (cache == null && !hasDisplayList) {
                if (offsetForScroll) {
                    transX = -sx;
                    transX = -sx;
                    transY = -sy;
                    transY = -sy;
                }
                }
@@ -2532,7 +2537,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        }
        }


        if ((flags & FLAG_CLIP_CHILDREN) == FLAG_CLIP_CHILDREN) {
        if ((flags & FLAG_CLIP_CHILDREN) == FLAG_CLIP_CHILDREN) {
            if (cache == null && !hasDisplayList) {
            if (offsetForScroll) {
                canvas.clipRect(sx, sy, sx + (cr - cl), sy + (cb - ct));
                canvas.clipRect(sx, sy, sx + (cr - cl), sy + (cb - ct));
            } else {
            } else {
                if (!scalingRequired || cache == null) {
                if (!scalingRequired || cache == null) {
+11 −0
Original line number Original line Diff line number Diff line
@@ -213,6 +213,17 @@ bool OpenGLRenderer::callDrawGLFunction(Functor *functor) {
    if (mDirtyClip) {
    if (mDirtyClip) {
        setScissorFromClip();
        setScissorFromClip();
    }
    }

#if RENDER_LAYERS_AS_REGIONS
    // Since we don't know what the functor will draw, let's dirty
    // tne entire clip region
    if (hasLayer()) {
        Rect clip(*mSnapshot->clipRect);
        clip.snapToPixelBoundaries();
        dirtyLayerUnchecked(clip, getRegion());
    }
#endif

    status_t result = (*functor)();
    status_t result = (*functor)();
    resume();
    resume();
    return (result == 0) ? false : true;
    return (result == 0) ? false : true;