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

Commit e3718553 authored by Cairn Overturf's avatar Cairn Overturf Committed by Android (Google) Code Review
Browse files

Merge "Remove client drawn shadow code" into main

parents b718277e 86e46760
Loading
Loading
Loading
Loading
+0 −31
Original line number Diff line number Diff line
@@ -162,8 +162,6 @@ public final class SurfaceControl implements Parcelable {
            float cornerRadius);
    private static native void nativeSetClientDrawnCornerRadius(long transactionObj,
            long nativeObject, float clientDrawnCornerRadius);
    private static native void nativeSetClientDrawnShadows(long transactionObj,
            long nativeObject, float clientDrawnShadows);
    private static native void nativeSetBackgroundBlurRadius(long transactionObj, long nativeObject,
            int blurRadius);
    private static native void nativeSetLayerStack(long transactionObj, long nativeObject,
@@ -3694,35 +3692,6 @@ public final class SurfaceControl implements Parcelable {
            return this;
        }

        /**
         * Disables shadows of a {@link SurfaceControl}. When the radius set by
         * {@link Transaction#setClientDrawnShadows(SurfaceControl, float)} is equal to
         * clientDrawnShadowRadius the shadows drawn by SurfaceFlinger is disabled.
         *
         * @param sc SurfaceControl
         * @param clientDrawnShadowRadius Shadow radius drawn by the client
         * @return Itself.
         * @hide
         */
        @NonNull
        public Transaction setClientDrawnShadows(@NonNull SurfaceControl sc,
                                                        float clientDrawnShadowRadius) {
            checkPreconditions(sc);
            if (SurfaceControlRegistry.sCallStackDebuggingEnabled) {
                SurfaceControlRegistry.getProcessInstance().checkCallStackDebugging(
                        "setClientDrawnShadows", this, sc,
                        "clientDrawnShadowRadius=" + clientDrawnShadowRadius);
            }
            if (Flags.ignoreCornerRadiusAndShadows()) {
                nativeSetClientDrawnShadows(mNativeObject, sc.mNativeObject,
                                                        clientDrawnShadowRadius);
            } else {
                Log.w(TAG, "setClientDrawnShadows was called but"
                            + "ignore_corner_radius_and_shadows flag is disabled");
            }
            return this;
        }

        /**
         * Sets the background blur radius of the {@link SurfaceControl}.
         *
+0 −10
Original line number Diff line number Diff line
@@ -1122,14 +1122,6 @@ static void nativeSetClientDrawnCornerRadius(JNIEnv* env, jclass clazz, jlong tr
    transaction->setClientDrawnCornerRadius(ctrl, clientDrawnCornerRadius);
}

static void nativeSetClientDrawnShadows(JNIEnv* env, jclass clazz, jlong transactionObj,
                                        jlong nativeObject, jfloat clientDrawnShadowRadius) {
    auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);

    SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl*>(nativeObject);
    transaction->setClientDrawnShadowRadius(ctrl, clientDrawnShadowRadius);
}

static void nativeSetBackgroundBlurRadius(JNIEnv* env, jclass clazz, jlong transactionObj,
         jlong nativeObject, jint blurRadius) {
    auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
@@ -2566,8 +2558,6 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
            (void*)nativeSetCornerRadius },
    {"nativeSetClientDrawnCornerRadius", "(JJF)V",
            (void*) nativeSetClientDrawnCornerRadius },
    {"nativeSetClientDrawnShadows", "(JJF)V",
            (void*) nativeSetClientDrawnShadows },
    {"nativeSetBackgroundBlurRadius", "(JJI)V",
            (void*)nativeSetBackgroundBlurRadius },
    {"nativeSetLayerStack", "(JJI)V",