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

Commit c619b6e5 authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Add DisplayList bit for projecting onto a contained volume"

parents 4be3573c 58f09b35
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -414,6 +414,21 @@ public class DisplayList {
        }
    }

    /**
     * Sets whether the display list should be drawn immediately after the
     * closest ancestor display list where isContainedVolume 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) {
        if (hasNativeDisplayList()) {
            nSetProjectToContainedVolume(mFinalizer.mNativeDisplayList, shouldProject);
        }
    }

    /**
     * Set the static matrix on the display list. The specified matrix is combined with other
     * transforms (such as {@link #setScaleX(float)}, {@link #setRotation(float)}, etc.)
@@ -1034,6 +1049,7 @@ public class DisplayList {
    private static native void nSetPivotX(int displayList, float pivotX);
    private static native void nSetCaching(int displayList, boolean caching);
    private static native void nSetClipToBounds(int displayList, boolean clipToBounds);
    private static native void nSetProjectToContainedVolume(int displayList, boolean shouldProject);
    private static native void nSetIsContainedVolume(int displayList, boolean isContainedVolume);
    private static native void nSetAlpha(int displayList, float alpha);
    private static native void nSetHasOverlappingRendering(int displayList,
+8 −0
Original line number Diff line number Diff line
@@ -111,6 +111,12 @@ static void android_view_DisplayList_setIsContainedVolume(JNIEnv* env,
    displayList->setIsContainedVolume(isContainedVolume);
}

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

static void android_view_DisplayList_setAlpha(JNIEnv* env,
        jobject clazz, jint displayListPtr, float alpha) {
    DisplayList* displayList = reinterpret_cast<DisplayList*>(displayListPtr);
@@ -378,6 +384,8 @@ static JNINativeMethod gMethods[] = {
    { "nSetAnimationMatrix",   "(II)V",  (void*) android_view_DisplayList_setAnimationMatrix },
    { "nSetClipToBounds",      "(IZ)V",  (void*) android_view_DisplayList_setClipToBounds },
    { "nSetIsContainedVolume", "(IZ)V",  (void*) android_view_DisplayList_setIsContainedVolume },
    { "nSetProjectToContainedVolume", "(IZ)V",
            (void*) android_view_DisplayList_setProjectToContainedVolume },
    { "nSetAlpha",             "(IF)V",  (void*) android_view_DisplayList_setAlpha },
    { "nSetHasOverlappingRendering", "(IZ)V",
            (void*) android_view_DisplayList_setHasOverlappingRendering },
+1 −0
Original line number Diff line number Diff line
@@ -238,6 +238,7 @@ void DisplayList::init() {
    mBottom = 0;
    mClipToBounds = true;
    mIsContainedVolume = true;
    mProjectToContainedVolume = false;
    mAlpha = 1;
    mHasOverlappingRendering = true;
    mTranslationX = 0;
+6 −1
Original line number Diff line number Diff line
@@ -189,6 +189,10 @@ public:
        mIsContainedVolume = isContainedVolume;
    }

    void setProjectToContainedVolume(bool shouldProject) {
        mProjectToContainedVolume = shouldProject;
    }

    void setStaticMatrix(SkMatrix* matrix) {
        delete mStaticMatrix;
        mStaticMatrix = new SkMatrix(*matrix);
@@ -572,9 +576,10 @@ private:
    String8 mName;
    bool mDestroyed; // used for debugging crash, TODO: remove once invalid state crash fixed

    // View properties
    // Rendering properties
    bool mClipToBounds;
    bool mIsContainedVolume;
    bool mProjectToContainedVolume;
    float mAlpha;
    bool mHasOverlappingRendering;
    float mTranslationX, mTranslationY, mTranslationZ;