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

Commit 339f901b authored by John Reck's avatar John Reck
Browse files

Cleanups

 Simplify DisplayList creation
 Remove unnecessary debug code

Change-Id: I310c9196485c6bf65a6793669bd2dc2b9a8a0a15
parent 79d81e68
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -176,6 +176,20 @@ public abstract class DisplayList {
     */
    public static final int STATUS_DREW = 0x4;

    /**
     * Creates a new display list that can be used to record batches of
     * drawing operations.
     *
     * @param name The name of the display list, used for debugging purpose. May be null.
     *
     * @return A new display list.
     *
     * @hide
     */
    public static DisplayList create(String name) {
        return new GLES20DisplayList(name);
    }

    /**
     * Starts recording the display list. All operations performed on the
     * returned canvas are recorded and stored in this display list.
+1 −25
Original line number Diff line number Diff line
@@ -65,13 +65,6 @@ public abstract class HardwareRenderer {
     */
    private static final String CACHE_PATH_SHADERS = "com.android.opengl.shaders_cache";

    /**
     * Turn on to only refresh the parts of the screen that need updating.
     * When turned on the property defined by {@link #RENDER_DIRTY_REGIONS_PROPERTY}
     * must also have the value "true".
     */
    static final boolean RENDER_DIRTY_REGIONS = true;

    /**
     * System property used to enable or disable dirty regions invalidation.
     * This property is only queried if {@link #RENDER_DIRTY_REGIONS} is true.
@@ -508,18 +501,6 @@ public abstract class HardwareRenderer {
    abstract void draw(View view, View.AttachInfo attachInfo, HardwareDrawCallbacks callbacks,
            Rect dirty);

    /**
     * Creates a new display list that can be used to record batches of
     * drawing operations.
     *
     * @param name The name of the display list, used for debugging purpose. May be null.
     *
     * @return A new display list.
     *
     * @hide
     */
    public abstract DisplayList createDisplayList(String name);

    /**
     * Creates a new hardware layer. A hardware layer built by calling this
     * method will be treated as a texture layer, instead of as a render target.
@@ -853,7 +834,7 @@ public abstract class HardwareRenderer {
        static {
            String dirtyProperty = SystemProperties.get(RENDER_DIRTY_REGIONS_PROPERTY, "true");
            //noinspection PointlessBooleanExpression,ConstantConditions
            sDirtyRegions = RENDER_DIRTY_REGIONS && "true".equalsIgnoreCase(dirtyProperty);
            sDirtyRegions = "true".equalsIgnoreCase(dirtyProperty);
            sDirtyRegionsRequested = sDirtyRegions;
        }

@@ -2186,11 +2167,6 @@ public abstract class HardwareRenderer {
            mGlCanvas.flushLayerUpdates();
        }

        @Override
        public DisplayList createDisplayList(String name) {
            return new GLES20DisplayList(name);
        }

        @Override
        HardwareLayer createHardwareLayer(boolean isOpaque) {
            return new GLES20TextureLayer(isOpaque);
+1 −28
Original line number Diff line number Diff line
@@ -10946,15 +10946,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            mPrivateFlags |= PFLAG_DIRTY;
            final ViewParent p = mParent;
            final AttachInfo ai = mAttachInfo;
            //noinspection PointlessBooleanExpression,ConstantConditions
            if (!HardwareRenderer.RENDER_DIRTY_REGIONS) {
                if (p != null && ai != null && ai.mHardwareAccelerated) {
                    // fast-track for GL-enabled applications; just invalidate the whole hierarchy
                    // with a null dirty rect, which tells the ViewAncestor to redraw everything
                    p.invalidateChild(this, null);
                    return;
                }
            }
            if (p != null && ai != null) {
                final int scrollX = mScrollX;
                final int scrollY = mScrollY;
@@ -10989,15 +10980,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            mPrivateFlags |= PFLAG_DIRTY;
            final ViewParent p = mParent;
            final AttachInfo ai = mAttachInfo;
            //noinspection PointlessBooleanExpression,ConstantConditions
            if (!HardwareRenderer.RENDER_DIRTY_REGIONS) {
                if (p != null && ai != null && ai.mHardwareAccelerated) {
                    // fast-track for GL-enabled applications; just invalidate the whole hierarchy
                    // with a null dirty rect, which tells the ViewAncestor to redraw everything
                    p.invalidateChild(this, null);
                    return;
                }
            }
            if (p != null && ai != null && l < r && t < b) {
                final int scrollX = mScrollX;
                final int scrollY = mScrollY;
@@ -11045,15 +11027,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            }
            final AttachInfo ai = mAttachInfo;
            final ViewParent p = mParent;
            //noinspection PointlessBooleanExpression,ConstantConditions
            if (!HardwareRenderer.RENDER_DIRTY_REGIONS) {
                if (p != null && ai != null && ai.mHardwareAccelerated) {
                    // fast-track for GL-enabled applications; just invalidate the whole hierarchy
                    // with a null dirty rect, which tells the ViewAncestor to redraw everything
                    p.invalidateChild(this, null);
                    return;
                }
            }
            if (p != null && ai != null) {
                final Rect r = ai.mTmpInvalRect;
@@ -13433,7 +13406,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                mRecreateDisplayList = true;
            }
            if (displayList == null) {
                displayList = mAttachInfo.mHardwareRenderer.createDisplayList(getClass().getName());
                displayList = DisplayList.create(getClass().getName());
                // If we're creating a new display list, make sure our parent gets invalidated
                // since they will need to recreate their display list to account for this
                // new child display list.
+1 −1
Original line number Diff line number Diff line
@@ -1346,7 +1346,7 @@ public class Editor {
                DisplayList blockDisplayList = mTextDisplayLists[blockIndex];
                if (blockDisplayList == null) {
                    blockDisplayList = mTextDisplayLists[blockIndex] =
                            mTextView.getHardwareRenderer().createDisplayList("Text " + blockIndex);
                            DisplayList.create("Text " + blockIndex);
                } else {
                    if (blockIsInvalid) blockDisplayList.clear();
                }