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

Commit 4b4d29a6 authored by Dan Stoza's avatar Dan Stoza Committed by Android Git Automerger
Browse files

am 8dcd14cd: am 4a90942e: am f615872c: am 0b887e57: Merge "SurfaceControl: Add...

am 8dcd14cd: am 4a90942e: am f615872c: am 0b887e57: Merge "SurfaceControl: Add colorTransform to DisplayInfo" into mnc-dr-dev

* commit '8dcd14cd':
  SurfaceControl: Add colorTransform to DisplayInfo
parents da03796d 8dcd14cd
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -484,6 +484,7 @@ public class SurfaceControl {
        public boolean secure;
        public long appVsyncOffsetNanos;
        public long presentationDeadlineNanos;
        public int colorTransform;

        public PhysicalDisplayInfo() {
        }
@@ -507,7 +508,8 @@ public class SurfaceControl {
                    && yDpi == other.yDpi
                    && secure == other.secure
                    && appVsyncOffsetNanos == other.appVsyncOffsetNanos
                    && presentationDeadlineNanos == other.presentationDeadlineNanos;
                    && presentationDeadlineNanos == other.presentationDeadlineNanos
                    && colorTransform == other.colorTransform;
        }

        @Override
@@ -525,6 +527,7 @@ public class SurfaceControl {
            secure = other.secure;
            appVsyncOffsetNanos = other.appVsyncOffsetNanos;
            presentationDeadlineNanos = other.presentationDeadlineNanos;
            colorTransform = other.colorTransform;
        }

        // For debugging purposes
@@ -533,7 +536,8 @@ public class SurfaceControl {
            return "PhysicalDisplayInfo{" + width + " x " + height + ", " + refreshRate + " fps, "
                    + "density " + density + ", " + xDpi + " x " + yDpi + " dpi, secure " + secure
                    + ", appVsyncOffset " + appVsyncOffsetNanos
                    + ", bufferDeadline " + presentationDeadlineNanos + "}";
                    + ", bufferDeadline " + presentationDeadlineNanos
                    + ", colorTransform " + colorTransform + "}";
        }
    }

+5 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ static struct {
    jfieldID secure;
    jfieldID appVsyncOffsetNanos;
    jfieldID presentationDeadlineNanos;
    jfieldID colorTransform;
} gPhysicalDisplayInfoClassInfo;

static struct {
@@ -394,6 +395,8 @@ static jobjectArray nativeGetDisplayConfigs(JNIEnv* env, jclass clazz,
                info.appVsyncOffset);
        env->SetLongField(infoObj, gPhysicalDisplayInfoClassInfo.presentationDeadlineNanos,
                info.presentationDeadline);
        env->SetIntField(infoObj, gPhysicalDisplayInfoClassInfo.colorTransform,
                info.colorTransform);
        env->SetObjectArrayElement(configArray, static_cast<jsize>(c), infoObj);
        env->DeleteLocalRef(infoObj);
    }
@@ -656,6 +659,8 @@ int register_android_view_SurfaceControl(JNIEnv* env)
            clazz, "appVsyncOffsetNanos", "J");
    gPhysicalDisplayInfoClassInfo.presentationDeadlineNanos = GetFieldIDOrDie(env,
            clazz, "presentationDeadlineNanos", "J");
    gPhysicalDisplayInfoClassInfo.colorTransform = GetFieldIDOrDie(env, clazz,
            "colorTransform", "I");

    jclass rectClazz = FindClassOrDie(env, "android/graphics/Rect");
    gRectClassInfo.bottom = GetFieldIDOrDie(env, rectClazz, "bottom", "I");