Merge "SurfaceControl: Add colorTransform to DisplayInfo" into mnc-dr-dev
This commit is contained in:
@@ -484,6 +484,7 @@ public class SurfaceControl {
|
|||||||
public boolean secure;
|
public boolean secure;
|
||||||
public long appVsyncOffsetNanos;
|
public long appVsyncOffsetNanos;
|
||||||
public long presentationDeadlineNanos;
|
public long presentationDeadlineNanos;
|
||||||
|
public int colorTransform;
|
||||||
|
|
||||||
public PhysicalDisplayInfo() {
|
public PhysicalDisplayInfo() {
|
||||||
}
|
}
|
||||||
@@ -507,7 +508,8 @@ public class SurfaceControl {
|
|||||||
&& yDpi == other.yDpi
|
&& yDpi == other.yDpi
|
||||||
&& secure == other.secure
|
&& secure == other.secure
|
||||||
&& appVsyncOffsetNanos == other.appVsyncOffsetNanos
|
&& appVsyncOffsetNanos == other.appVsyncOffsetNanos
|
||||||
&& presentationDeadlineNanos == other.presentationDeadlineNanos;
|
&& presentationDeadlineNanos == other.presentationDeadlineNanos
|
||||||
|
&& colorTransform == other.colorTransform;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -525,6 +527,7 @@ public class SurfaceControl {
|
|||||||
secure = other.secure;
|
secure = other.secure;
|
||||||
appVsyncOffsetNanos = other.appVsyncOffsetNanos;
|
appVsyncOffsetNanos = other.appVsyncOffsetNanos;
|
||||||
presentationDeadlineNanos = other.presentationDeadlineNanos;
|
presentationDeadlineNanos = other.presentationDeadlineNanos;
|
||||||
|
colorTransform = other.colorTransform;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For debugging purposes
|
// For debugging purposes
|
||||||
@@ -533,7 +536,8 @@ public class SurfaceControl {
|
|||||||
return "PhysicalDisplayInfo{" + width + " x " + height + ", " + refreshRate + " fps, "
|
return "PhysicalDisplayInfo{" + width + " x " + height + ", " + refreshRate + " fps, "
|
||||||
+ "density " + density + ", " + xDpi + " x " + yDpi + " dpi, secure " + secure
|
+ "density " + density + ", " + xDpi + " x " + yDpi + " dpi, secure " + secure
|
||||||
+ ", appVsyncOffset " + appVsyncOffsetNanos
|
+ ", appVsyncOffset " + appVsyncOffsetNanos
|
||||||
+ ", bufferDeadline " + presentationDeadlineNanos + "}";
|
+ ", bufferDeadline " + presentationDeadlineNanos
|
||||||
|
+ ", colorTransform " + colorTransform + "}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ static struct {
|
|||||||
jfieldID secure;
|
jfieldID secure;
|
||||||
jfieldID appVsyncOffsetNanos;
|
jfieldID appVsyncOffsetNanos;
|
||||||
jfieldID presentationDeadlineNanos;
|
jfieldID presentationDeadlineNanos;
|
||||||
|
jfieldID colorTransform;
|
||||||
} gPhysicalDisplayInfoClassInfo;
|
} gPhysicalDisplayInfoClassInfo;
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
@@ -401,6 +402,8 @@ static jobjectArray nativeGetDisplayConfigs(JNIEnv* env, jclass clazz,
|
|||||||
info.appVsyncOffset);
|
info.appVsyncOffset);
|
||||||
env->SetLongField(infoObj, gPhysicalDisplayInfoClassInfo.presentationDeadlineNanos,
|
env->SetLongField(infoObj, gPhysicalDisplayInfoClassInfo.presentationDeadlineNanos,
|
||||||
info.presentationDeadline);
|
info.presentationDeadline);
|
||||||
|
env->SetIntField(infoObj, gPhysicalDisplayInfoClassInfo.colorTransform,
|
||||||
|
info.colorTransform);
|
||||||
env->SetObjectArrayElement(configArray, static_cast<jsize>(c), infoObj);
|
env->SetObjectArrayElement(configArray, static_cast<jsize>(c), infoObj);
|
||||||
env->DeleteLocalRef(infoObj);
|
env->DeleteLocalRef(infoObj);
|
||||||
}
|
}
|
||||||
@@ -663,6 +666,8 @@ int register_android_view_SurfaceControl(JNIEnv* env)
|
|||||||
clazz, "appVsyncOffsetNanos", "J");
|
clazz, "appVsyncOffsetNanos", "J");
|
||||||
gPhysicalDisplayInfoClassInfo.presentationDeadlineNanos = GetFieldIDOrDie(env,
|
gPhysicalDisplayInfoClassInfo.presentationDeadlineNanos = GetFieldIDOrDie(env,
|
||||||
clazz, "presentationDeadlineNanos", "J");
|
clazz, "presentationDeadlineNanos", "J");
|
||||||
|
gPhysicalDisplayInfoClassInfo.colorTransform = GetFieldIDOrDie(env, clazz,
|
||||||
|
"colorTransform", "I");
|
||||||
|
|
||||||
jclass rectClazz = FindClassOrDie(env, "android/graphics/Rect");
|
jclass rectClazz = FindClassOrDie(env, "android/graphics/Rect");
|
||||||
gRectClassInfo.bottom = GetFieldIDOrDie(env, rectClazz, "bottom", "I");
|
gRectClassInfo.bottom = GetFieldIDOrDie(env, rectClazz, "bottom", "I");
|
||||||
|
|||||||
Reference in New Issue
Block a user