diff options
author | Mathias Agopian <mathias@google.com> | 2013-07-10 23:10:47 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-07-10 23:10:48 +0000 |
commit | 2260585d3791ab9628b2755c96ce0c254d191395 (patch) | |
tree | 2b9f62941bfbc931de870715df322afef91e95ca | |
parent | 9cd49c9c4e4fcb3f1fad4c86b60b0e929a5dce9a (diff) | |
parent | 3b4732c9d5462daf52a2ee1a42410bb0220fd28f (diff) | |
download | hardware_libhardware-2260585d3791ab9628b2755c96ce0c254d191395.zip hardware_libhardware-2260585d3791ab9628b2755c96ce0c254d191395.tar.gz hardware_libhardware-2260585d3791ab9628b2755c96ce0c254d191395.tar.bz2 |
Merge "bump HWC version to 1.3, add support for float crop rectangle"
-rw-r--r-- | include/hardware/hwcomposer.h | 20 | ||||
-rw-r--r-- | include/hardware/hwcomposer_defs.h | 1 |
2 files changed, 19 insertions, 2 deletions
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h index d75a047..9492d3a 100644 --- a/include/hardware/hwcomposer.h +++ b/include/hardware/hwcomposer.h @@ -54,6 +54,13 @@ typedef struct hwc_rect { int bottom; } hwc_rect_t; +typedef struct hwc_frect { + float left; + float top; + float right; + float bottom; +} hwc_frect_t; + typedef struct hwc_region { size_t numRects; hwc_rect_t const* rects; @@ -149,8 +156,17 @@ typedef struct hwc_layer_1 { int32_t blending; /* area of the source to consider, the origin is the top-left corner of - * the buffer */ - hwc_rect_t sourceCrop; + * the buffer. As of HWC_DEVICE_API_VERSION_1_3, sourceRect uses floats. + * If the h/w can't support a non-integer source crop rectangle, it should + * punt to OpenGL ES composition. + */ + union { + // crop rectangle in integer (pre HWC_DEVICE_API_VERSION_1_3) + hwc_rect_t sourceCropi; + hwc_rect_t sourceCrop; // just for source compatibility + // crop rectangle in floats (as of HWC_DEVICE_API_VERSION_1_3) + hwc_frect_t sourceCropf; + }; /* where to composite the sourceCrop onto the display. The sourceCrop * is scaled using linear filtering to the displayFrame. The origin is the diff --git a/include/hardware/hwcomposer_defs.h b/include/hardware/hwcomposer_defs.h index 1edfd3d..ce4723c 100644 --- a/include/hardware/hwcomposer_defs.h +++ b/include/hardware/hwcomposer_defs.h @@ -35,6 +35,7 @@ __BEGIN_DECLS #define HWC_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION_2(1, 0, HWC_HEADER_VERSION) #define HWC_DEVICE_API_VERSION_1_1 HARDWARE_DEVICE_API_VERSION_2(1, 1, HWC_HEADER_VERSION) #define HWC_DEVICE_API_VERSION_1_2 HARDWARE_DEVICE_API_VERSION_2(1, 2, HWC_HEADER_VERSION) +#define HWC_DEVICE_API_VERSION_1_3 HARDWARE_DEVICE_API_VERSION_2(1, 3, HWC_HEADER_VERSION) enum { /* hwc_composer_device_t::set failed in EGL */ |