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

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

Merge "Enable display lists."

parents 4bd78cbe 0d9275e5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -7580,6 +7580,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
     * size than the view. This implies that your application must be able to handle this
     * size.</p>
     * 
     * <p>You should avoid calling this method when hardware acceleration is enabled. If
     * you do not need the drawing cache bitmap, calling this method will increase memory
     * usage and cause the view to be rendered in software once, thus negatively impacting 
     * performance.</p>
     *
     * @see #getDrawingCache()
     * @see #destroyDrawingCache()
     */
@@ -7699,7 +7704,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
            canvas.translate(-mScrollX, -mScrollY);

            mPrivateFlags |= DRAWN;
            if (mAttachInfo == null || !mAttachInfo.mHardwareAccelerated) {
                mPrivateFlags |= DRAWING_CACHE_VALID;
            }

            // Fast path for layouts with no backgrounds
            if ((mPrivateFlags & SKIP_DRAW) == SKIP_DRAW) {
+9 −4
Original line number Diff line number Diff line
@@ -1867,14 +1867,17 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        if ((mGroupFlags & FLAG_ANIMATION_CACHE) == FLAG_ANIMATION_CACHE) {
            final int count = mChildrenCount;
            final View[] children = mChildren;
            final boolean buildCache = !isHardwareAccelerated();

            for (int i = 0; i < count; i++) {
                final View child = children[i];
                if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE) {
                    child.setDrawingCacheEnabled(true);
                    if (buildCache) {
                        child.buildDrawingCache(true);
                    }
                }
            }

            mGroupFlags |= FLAG_CHILDREN_DRAWN_WITH_CACHE;
        }
@@ -1933,6 +1936,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        if ((flags & FLAG_RUN_ANIMATION) != 0 && canAnimate()) {
            final boolean cache = (mGroupFlags & FLAG_ANIMATION_CACHE) == FLAG_ANIMATION_CACHE;

            final boolean buildCache = !isHardwareAccelerated();
            for (int i = 0; i < count; i++) {
                final View child = children[i];
                if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE) {
@@ -1941,10 +1945,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                    bindLayoutAnimation(child);
                    if (cache) {
                        child.setDrawingCacheEnabled(true);
                        if (buildCache) {                        
                            child.buildDrawingCache(true);
                        }
                    }
                }
            }

            final LayoutAnimationController controller = mLayoutAnimationController;
            if (controller.willOverlap()) {
@@ -2205,8 +2211,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
            if (!canvas.isHardwareAccelerated()) {
                cache = child.getDrawingCache(true);
            } else {
                // TODO: bring back
                // displayList = child.getDisplayList();
                displayList = child.getDisplayList();
            }
        }

+5 −0
Original line number Diff line number Diff line
@@ -562,6 +562,11 @@ public final class ViewRoot extends Handler implements ViewParent, View.AttachIn
        }
    }
    
    void invalidate() {
        mDirty.set(0, 0, mWidth, mHeight);
        scheduleTraversals();
    }

    public ViewParent getParent() {
        return null;
    }
+1 −1
Original line number Diff line number Diff line
@@ -652,7 +652,7 @@ public class SlidingDrawer extends ViewGroup {
        // Try only once... we should really loop but it's not a big deal
        // if the draw was cancelled, it will only be temporary anyway
        content.getViewTreeObserver().dispatchOnPreDraw();
        content.buildDrawingCache();
        if (!content.isHardwareAccelerated()) content.buildDrawingCache();

        content.setVisibility(View.GONE);        
    }