summaryrefslogtreecommitdiff
path: root/graphics/java/android
diff options
context:
space:
mode:
author Leon Scroggins III <scroggo@google.com> 2022-01-31 15:47:34 -0500
committer Leon Scroggins III <scroggo@google.com> 2022-02-09 17:30:29 -0500
commit73e0689d8a78e102ece66e0e1ee6dfb2431526f1 (patch)
treec55ddaa6ad45ab92cd4e4ea80f2371f994cf0515 /graphics/java/android
parent48f8424371ac979cefc015be99530f9af3caefc6 (diff)
getDisplayDecorationSupport: return more detailed info
Call the updated native version of getDisplayDecorationSupport (added in I961051c0a660b596039ac04b546040764ee20d34), and convert the NDK struct into a Java class. Depend on the graphics AIDLs, which now have Java backends. A future CL will update SysUI to call the new API. Add a PixelFormat for R_8 to correspond to the native version. This will allow SysUI to use COLOR_MODE_A8 when the HAL reports R_8. If64fd6924960f592b7a211371bc2ca6536ae34f7 demonstrates using this. Bug: 216644902 Test: manual Change-Id: I0e34c6d6e369fda0a96231ab38c3bd5f3bfe3e06
Diffstat (limited to 'graphics/java/android')
-rw-r--r--graphics/java/android/graphics/PixelFormat.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/PixelFormat.java b/graphics/java/android/graphics/PixelFormat.java
index dde757b4eb01..3ec5b9cc7dae 100644
--- a/graphics/java/android/graphics/PixelFormat.java
+++ b/graphics/java/android/graphics/PixelFormat.java
@@ -29,7 +29,7 @@ public class PixelFormat {
/** @hide */
@Retention(RetentionPolicy.SOURCE)
- @IntDef({RGBA_8888, RGBX_8888, RGBA_F16, RGBA_1010102, RGB_888, RGB_565})
+ @IntDef({RGBA_8888, RGBX_8888, RGBA_F16, RGBA_1010102, RGB_888, RGB_565, R_8})
public @interface Format { }
// NOTE: these constants must match the values from graphics/common/x.x/types.hal
@@ -93,6 +93,9 @@ public class PixelFormat {
/** @hide */
public static final int HSV_888 = 0x37;
+ /** @hide */
+ public static final int R_8 = 0x38;
+
/**
* @deprecated use {@link android.graphics.ImageFormat#JPEG
* ImageFormat.JPEG} instead.
@@ -142,6 +145,10 @@ public class PixelFormat {
info.bitsPerPixel = 64;
info.bytesPerPixel = 8;
break;
+ case R_8:
+ info.bitsPerPixel = 8;
+ info.bytesPerPixel = 1;
+ break;
default:
throw new IllegalArgumentException("unknown pixel format " + format);
}
@@ -235,6 +242,8 @@ public class PixelFormat {
return "HSV_888";
case JPEG:
return "JPEG";
+ case R_8:
+ return "R_8";
default:
return Integer.toString(format);
}