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

* commit 'f615872cb49062de9113c7c5be31d3b1d1b423af':
  SurfaceControl: Add colorTransform to DisplayInfo
This commit is contained in:
Dan Stoza
2015-09-03 22:13:31 +00:00
committed by Android Git Automerger
2 changed files with 11 additions and 2 deletions

View File

@@ -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 + "}";
}
}

View File

@@ -64,6 +64,7 @@ static struct {
jfieldID secure;
jfieldID appVsyncOffsetNanos;
jfieldID presentationDeadlineNanos;
jfieldID colorTransform;
} gPhysicalDisplayInfoClassInfo;
static struct {
@@ -401,6 +402,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);
}
@@ -663,6 +666,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");