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

Commit f0af1d5c authored by Romain Guy's avatar Romain Guy
Browse files

Remove unused View.flushLayer() API

Change-Id: I5d4c7388afb5265964ab6b769cc0abfee9745c84
parent 7d3082a3
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -157,7 +157,6 @@ class GLES20Canvas extends HardwareCanvas {
    static native void nSetTextureLayerTransform(int layerId, int matrix);
    static native void nDestroyLayer(int layerId);
    static native void nDestroyLayerDeferred(int layerId);
    static native void nFlushLayer(int layerId);
    static native void nUpdateRenderLayer(int layerId, int renderer, int displayList,
            int left, int top, int right, int bottom);
    static native boolean nCopyLayer(int layerId, int bitmap);
+0 −7
Original line number Diff line number Diff line
@@ -56,13 +56,6 @@ abstract class GLES20Layer extends HardwareLayer {
        mLayer = 0;
    }

    @Override
    void flush() {
        if (mLayer != 0) {
            GLES20Canvas.nFlushLayer(mLayer);
        }
    }

    static class Finalizer {
        private int mLayerId;

+0 −5
Original line number Diff line number Diff line
@@ -142,11 +142,6 @@ abstract class HardwareLayer {
     */
    abstract void destroy();

    /**
     * Flush the render queue associated with this layer.
     */
    abstract void flush();

    /**
     * This must be invoked before drawing onto this layer.
     * @param currentCanvas
+26 −31
Original line number Diff line number Diff line
@@ -4798,9 +4798,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    }
    /**
     * Computes whether the given portion of this view is visible to the user. Such a view is
     * attached, visible, all its predecessors are visible, has an alpha greater than zero, and
     * the specified portion is not clipped entirely by its predecessors.
     * Computes whether the given portion of this view is visible to the user.
     * Such a view is attached, visible, all its predecessors are visible,
     * has an alpha greater than zero, and the specified portion is not
     * clipped entirely by its predecessors.
     *
     * @param boundInView the portion of the view to test; coordinates should be relative; may be
     *                    <code>null</code>, and the entire view will be tested in this case.
@@ -4814,24 +4815,28 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @hide
     */
    protected boolean isVisibleToUser(Rect boundInView) {
        if (mAttachInfo != null) {
            Rect visibleRect = mAttachInfo.mTmpInvalRect;
            Point offset = mAttachInfo.mPoint;
            // The first two checks are made also made by isShown() which
            // however traverses the tree up to the parent to catch that.
            // Therefore, we do some fail fast check to minimize the up
            // tree traversal.
        boolean isVisible = mAttachInfo != null
            && mAttachInfo.mWindowVisibility == View.VISIBLE
            boolean isVisible = mAttachInfo.mWindowVisibility == View.VISIBLE
                && getAlpha() > 0
                && isShown()
                && getGlobalVisibleRect(visibleRect, offset);
            if (isVisible && boundInView != null) {
                visibleRect.offset(-offset.x, -offset.y);
                isVisible &= boundInView.intersect(visibleRect);
                // isVisible is always true here, use a simple assignment
                isVisible = boundInView.intersect(visibleRect);
            }
            return isVisible;
        }
        return false;
    }
    /**
     * Sets a delegate for implementing accessibility support via compositon as
     * opposed to inheritance. The delegate's primary use is for implementing
@@ -5272,7 +5277,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return Return true if this view applied the insets and it should not
     * continue propagating further down the hierarchy, false otherwise.
     * @see #getFitsSystemWindows()
     * @see #setFitsSystemWindows()
     * @see #setFitsSystemWindows(boolean) 
     * @see #setSystemUiVisibility(int)
     */
    protected boolean fitSystemWindows(Rect insets) {
@@ -6464,10 +6469,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     */
    public boolean includeForAccessibility() {
        if (mAttachInfo != null) {
            if (!mAttachInfo.mIncludeNotImportantViews) {
                return isImportantForAccessibility();
            }
            return true;
            return mAttachInfo.mIncludeNotImportantViews || isImportantForAccessibility();
        }
        return false;
    }
@@ -11899,13 +11901,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        }
    }
    // Make sure the HardwareRenderer.validate() was invoked before calling this method
    void flushLayer() {
        if (mLayerType == LAYER_TYPE_HARDWARE && mHardwareLayer != null) {
            mHardwareLayer.flush();
        }
    }
    /**
     * <p>Returns a hardware layer that can be used to draw this view again
     * without executing its draw method.</p>
@@ -12756,10 +12751,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        if (more) {
            if (!a.willChangeBounds()) {
                if ((flags & (parent.FLAG_OPTIMIZE_INVALIDATE | parent.FLAG_ANIMATION_DONE)) ==
                        parent.FLAG_OPTIMIZE_INVALIDATE) {
                    parent.mGroupFlags |= parent.FLAG_INVALIDATE_REQUIRED;
                } else if ((flags & parent.FLAG_INVALIDATE_REQUIRED) == 0) {
                if ((flags & (ViewGroup.FLAG_OPTIMIZE_INVALIDATE | ViewGroup.FLAG_ANIMATION_DONE)) ==
                        ViewGroup.FLAG_OPTIMIZE_INVALIDATE) {
                    parent.mGroupFlags |= ViewGroup.FLAG_INVALIDATE_REQUIRED;
                } else if ((flags & ViewGroup.FLAG_INVALIDATE_REQUIRED) == 0) {
                    // The child need to draw an animation, potentially offscreen, so
                    // make sure we do not cancel invalidate requests
                    parent.mPrivateFlags |= DRAW_ANIMATION;
+0 −5
Original line number Diff line number Diff line
@@ -810,10 +810,6 @@ static void android_view_GLES20Canvas_destroyLayerDeferred(JNIEnv* env,
    LayerRenderer::destroyLayerDeferred(layer);
}

static void android_view_GLES20Canvas_flushLayer(JNIEnv* env, jobject clazz, Layer* layer) {
    LayerRenderer::flushLayer(layer);
}

static void android_view_GLES20Canvas_drawLayer(JNIEnv* env, jobject clazz,
        OpenGLRenderer* renderer, Layer* layer, jfloat x, jfloat y, SkPaint* paint) {
    renderer->drawLayer(layer, x, y, paint);
@@ -983,7 +979,6 @@ static JNINativeMethod gMethods[] = {
    { "nUpdateRenderLayer",      "(IIIIIII)V", (void*) android_view_GLES20Canvas_updateRenderLayer },
    { "nDestroyLayer",           "(I)V",       (void*) android_view_GLES20Canvas_destroyLayer },
    { "nDestroyLayerDeferred",   "(I)V",       (void*) android_view_GLES20Canvas_destroyLayerDeferred },
    { "nFlushLayer",             "(I)V",       (void*) android_view_GLES20Canvas_flushLayer },
    { "nDrawLayer",              "(IIFFI)V",   (void*) android_view_GLES20Canvas_drawLayer },
    { "nCopyLayer",              "(II)Z",      (void*) android_view_GLES20Canvas_copyLayer },

Loading