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

Commit de439dbe authored by Chris Craik's avatar Chris Craik Committed by Android (Google) Code Review
Browse files

Merge "Update reordering method names, and make 3d reordering API public"

parents 5e31fdba 6657a6c5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -633,6 +633,7 @@ package android {
    field public static final int isScrollContainer = 16843342; // 0x101024e
    field public static final int isSticky = 16843335; // 0x1010247
    field public static final int isolatedProcess = 16843689; // 0x10103a9
    field public static final int isolatedZVolume = 16843769; // 0x10103f9
    field public static final int itemBackground = 16843056; // 0x1010130
    field public static final int itemIconDisabledAlpha = 16843057; // 0x1010131
    field public static final int itemPadding = 16843565; // 0x101032d
@@ -29320,6 +29321,7 @@ package android.view {
    method public int getLayoutMode();
    method public android.animation.LayoutTransition getLayoutTransition();
    method public int getPersistentDrawingCache();
    method public boolean hasIsolatedZVolume();
    method public int indexOfChild(android.view.View);
    method public final void invalidateChild(android.view.View, android.graphics.Rect);
    method public android.view.ViewParent invalidateChildInParent(int[], android.graphics.Rect);
@@ -29364,6 +29366,7 @@ package android.view {
    method public void setClipChildren(boolean);
    method public void setClipToPadding(boolean);
    method public void setDescendantFocusability(int);
    method public void setIsolatedZVolume(boolean);
    method public void setLayoutAnimation(android.view.animation.LayoutAnimationController);
    method public void setLayoutAnimationListener(android.view.animation.Animation.AnimationListener);
    method public void setLayoutMode(int);
+8 −8
Original line number Diff line number Diff line
@@ -406,26 +406,26 @@ public class DisplayList {
     * Set whether the display list should collect and Z order all 3d composited descendents, and
     * draw them in order with the default Z=0 content.
     *
     * @param isContainedVolume true if the display list should collect and Z order descendents.
     * @param isolateZVolume true if the display list should collect and Z order descendents.
     */
    public void setIsContainedVolume(boolean isContainedVolume) {
    public void setIsolatedZVolume(boolean isolatedZVolume) {
        if (hasNativeDisplayList()) {
            nSetIsContainedVolume(mFinalizer.mNativeDisplayList, isContainedVolume);
            nSetIsolatedZVolume(mFinalizer.mNativeDisplayList, isolatedZVolume);
        }
    }

    /**
     * Sets whether the display list should be drawn immediately after the
     * closest ancestor display list where isContainedVolume is true. If the
     * closest ancestor display list where isolateZVolume is true. If the
     * display list itself satisfies this constraint, changing this attribute
     * has no effect on drawing order.
     *
     * @param shouldProject true if the display list should be projected onto a
     *            containing volume.
     */
    public void setProjectToContainedVolume(boolean shouldProject) {
    public void setProjectBackwards(boolean shouldProject) {
        if (hasNativeDisplayList()) {
            nSetProjectToContainedVolume(mFinalizer.mNativeDisplayList, shouldProject);
            nSetProjectBackwards(mFinalizer.mNativeDisplayList, shouldProject);
        }
    }

@@ -1049,8 +1049,8 @@ public class DisplayList {
    private static native void nSetPivotX(long displayList, float pivotX);
    private static native void nSetCaching(long displayList, boolean caching);
    private static native void nSetClipToBounds(long displayList, boolean clipToBounds);
    private static native void nSetProjectToContainedVolume(long displayList, boolean shouldProject);
    private static native void nSetIsContainedVolume(long displayList, boolean isContainedVolume);
    private static native void nSetProjectBackwards(long displayList, boolean shouldProject);
    private static native void nSetIsolatedZVolume(long displayList, boolean isolateZVolume);
    private static native void nSetAlpha(long displayList, float alpha);
    private static native void nSetHasOverlappingRendering(long displayList,
            boolean hasOverlappingRendering);
+2 −2
Original line number Diff line number Diff line
@@ -14263,8 +14263,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                        (((ViewGroup) mParent).mGroupFlags & ViewGroup.FLAG_CLIP_CHILDREN) != 0);
            }
            if (this instanceof ViewGroup) {
                displayList.setIsContainedVolume(
                        (((ViewGroup) this).mGroupFlags & ViewGroup.FLAG_IS_CONTAINED_VOLUME) != 0);
                displayList.setIsolatedZVolume(
                        (((ViewGroup) this).mGroupFlags & ViewGroup.FLAG_ISOLATED_Z_VOLUME) != 0);
            }
            float alpha = 1;
            if (mParent instanceof ViewGroup && (((ViewGroup) mParent).mGroupFlags &
+20 −21
Original line number Diff line number Diff line
@@ -358,7 +358,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
     * When true, indicates that all 3d composited descendents are contained within this group, and
     * will not be interleaved with other 3d composited content.
     */
    static final int FLAG_IS_CONTAINED_VOLUME = 0x1000000;
    static final int FLAG_ISOLATED_Z_VOLUME = 0x1000000;

    /**
     * Indicates which types of drawing caches are to be kept in memory.
@@ -492,7 +492,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        mGroupFlags |= FLAG_ANIMATION_DONE;
        mGroupFlags |= FLAG_ANIMATION_CACHE;
        mGroupFlags |= FLAG_ALWAYS_DRAWN_WITH_CACHE;
        mGroupFlags |= FLAG_IS_CONTAINED_VOLUME;
        mGroupFlags |= FLAG_ISOLATED_Z_VOLUME;

        if (mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.HONEYCOMB) {
            mGroupFlags |= FLAG_SPLIT_MOTION_EVENTS;
@@ -520,6 +520,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                case R.styleable.ViewGroup_clipToPadding:
                    setClipToPadding(a.getBoolean(attr, true));
                    break;
                case R.styleable.ViewGroup_isolatedZVolume:
                    setIsolatedZVolume(a.getBoolean(attr, true));
                    break;
                case R.styleable.ViewGroup_animationCache:
                    setAnimationCacheEnabled(a.getBoolean(attr, true));
                    break;
@@ -3115,34 +3118,30 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
     * independent Z volume. Views drawn in one contained volume will not
     * interleave with views in another, even if their Z values are interleaved.
     * The default value is true.
     * @see #setIsContainedVolume(boolean)
     *
     * @return True if the ViewGroup is a contained volume.
     * @see #setIsolatedZVolume(boolean)
     *
     * @hide
     * @return True if the ViewGroup has an isolated Z volume.
     */
    public boolean isContainedVolume() {
        return ((mGroupFlags & FLAG_IS_CONTAINED_VOLUME) != 0);
    public boolean hasIsolatedZVolume() {
        return ((mGroupFlags & FLAG_ISOLATED_Z_VOLUME) != 0);
    }

    /**
     * By default, only direct children of a group can interleave with
     * interleaved Z values. Set to false on individual groups to enable Z
     * By default, only direct children of a group can interleave drawing order
     * by interleaving Z values. Set to false on individual groups to enable Z
     * interleaving of views that aren't direct siblings.
     *
     * @return True if the group should be a contained volume with its own Z
     *         ordering space, false if its decendents should join the current Z
     *         ordering volume.
     * @attr ref android.R.styleable#ViewGroup_isContainedVolume
     *
     * @hide
     * @return True if the group should be an isolated Z volume with its own Z
     *         ordering space, false if its decendents should inhabit the
     *         inherited Z ordering volume.
     * @attr ref android.R.styleable#ViewGroup_isolateZVolume
     */
    public void setIsContainedVolume(boolean isContainedVolume) {
        boolean previousValue = (mGroupFlags & FLAG_IS_CONTAINED_VOLUME) == FLAG_IS_CONTAINED_VOLUME;
        if (isContainedVolume != previousValue) {
            setBooleanFlag(FLAG_IS_CONTAINED_VOLUME, isContainedVolume);
    public void setIsolatedZVolume(boolean isolateZVolume) {
        boolean previousValue = (mGroupFlags & FLAG_ISOLATED_Z_VOLUME) == FLAG_ISOLATED_Z_VOLUME;
        if (isolateZVolume != previousValue) {
            setBooleanFlag(FLAG_ISOLATED_Z_VOLUME, isolateZVolume);
            if (mDisplayList != null) {
                mDisplayList.setIsContainedVolume(isContainedVolume);
                mDisplayList.setIsolatedZVolume(isolateZVolume);
            }
        }
    }
+7 −8
Original line number Diff line number Diff line
@@ -105,16 +105,16 @@ static void android_view_DisplayList_setClipToBounds(JNIEnv* env,
    displayList->setClipToBounds(clipToBounds);
}

static void android_view_DisplayList_setIsContainedVolume(JNIEnv* env,
        jobject clazz, jlong displayListPtr, jboolean isContainedVolume) {
static void android_view_DisplayList_setIsolatedZVolume(JNIEnv* env,
        jobject clazz, jlong displayListPtr, jboolean shouldIsolate) {
    DisplayList* displayList = reinterpret_cast<DisplayList*>(displayListPtr);
    displayList->setIsContainedVolume(isContainedVolume);
    displayList->setIsolatedZVolume(shouldIsolate);
}

static void android_view_DisplayList_setProjectToContainedVolume(JNIEnv* env,
static void android_view_DisplayList_setProjectBackwards(JNIEnv* env,
        jobject clazz, jlong displayListPtr, jboolean shouldProject) {
    DisplayList* displayList = reinterpret_cast<DisplayList*>(displayListPtr);
    displayList->setProjectToContainedVolume(shouldProject);
    displayList->setProjectBackwards(shouldProject);
}

static void android_view_DisplayList_setAlpha(JNIEnv* env,
@@ -383,9 +383,8 @@ static JNINativeMethod gMethods[] = {
    { "nSetStaticMatrix",      "(JJ)V",  (void*) android_view_DisplayList_setStaticMatrix },
    { "nSetAnimationMatrix",   "(JJ)V",  (void*) android_view_DisplayList_setAnimationMatrix },
    { "nSetClipToBounds",      "(JZ)V",  (void*) android_view_DisplayList_setClipToBounds },
    { "nSetIsContainedVolume", "(JZ)V",  (void*) android_view_DisplayList_setIsContainedVolume },
    { "nSetProjectToContainedVolume", "(JZ)V",
            (void*) android_view_DisplayList_setProjectToContainedVolume },
    { "nSetIsolatedZVolume",   "(JZ)V",  (void*) android_view_DisplayList_setIsolatedZVolume },
    { "nSetProjectBackwards",  "(JZ)V", (void*) android_view_DisplayList_setProjectBackwards },
    { "nSetAlpha",             "(JF)V",  (void*) android_view_DisplayList_setAlpha },
    { "nSetHasOverlappingRendering", "(JZ)V",
            (void*) android_view_DisplayList_setHasOverlappingRendering },
Loading