summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2018-01-24 18:19:19 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-01-24 18:19:19 +0000
commita6e13b1c1d791b5bec9fd96780a5e45b708240b8 (patch)
tree615c91372479aa6584b9341e2de61ff30f1e363f
parent52a0dad79c63db6d8588809fcb9e702ada01b9ed (diff)
parentfd05d13edcf20c04c40467e9445f8f442b7667ad (diff)
downloadlibhardware-a6e13b1c1d791b5bec9fd96780a5e45b708240b8.tar.gz
Merge "[HWC] Add setLayerFloatColor API."
-rw-r--r--include/hardware/hwcomposer2.h24
-rw-r--r--include/hardware/hwcomposer_defs.h7
2 files changed, 30 insertions, 1 deletions
diff --git a/include/hardware/hwcomposer2.h b/include/hardware/hwcomposer2.h
index 11c9bdd0..a052962a 100644
--- a/include/hardware/hwcomposer2.h
+++ b/include/hardware/hwcomposer2.h
@@ -114,7 +114,7 @@ typedef enum {
* presentDisplay should fail as fast as possible in the case a
* validateDisplay step is needed.
*/
- HWC2_CAPABILITY_SKIP_VALIDATE= 4,
+ HWC2_CAPABILITY_SKIP_VALIDATE = 4,
} hwc2_capability_t;
/* Possible composition types for a given layer */
@@ -262,6 +262,7 @@ typedef enum {
HWC2_FUNCTION_SET_POWER_MODE,
HWC2_FUNCTION_SET_VSYNC_ENABLED,
HWC2_FUNCTION_VALIDATE_DISPLAY,
+ HWC2_FUNCTION_SET_LAYER_FLOAT_COLOR,
} hwc2_function_descriptor_t;
/* Layer requests returned from getDisplayRequests */
@@ -479,6 +480,7 @@ static inline const char* getFunctionDescriptorName(
case HWC2_FUNCTION_SET_POWER_MODE: return "SetPowerMode";
case HWC2_FUNCTION_SET_VSYNC_ENABLED: return "SetVsyncEnabled";
case HWC2_FUNCTION_VALIDATE_DISPLAY: return "ValidateDisplay";
+ case HWC2_FUNCTION_SET_LAYER_FLOAT_COLOR: return "SetLayerFloatColor";
default: return "Unknown";
}
}
@@ -668,6 +670,7 @@ enum class FunctionDescriptor : int32_t {
SetPowerMode = HWC2_FUNCTION_SET_POWER_MODE,
SetVsyncEnabled = HWC2_FUNCTION_SET_VSYNC_ENABLED,
ValidateDisplay = HWC2_FUNCTION_VALIDATE_DISPLAY,
+ SetLayerFloatColor = HWC2_FUNCTION_SET_LAYER_FLOAT_COLOR,
};
TO_STRING(hwc2_function_descriptor_t, FunctionDescriptor,
getFunctionDescriptorName)
@@ -1805,6 +1808,25 @@ typedef int32_t /*hwc2_error_t*/ (*HWC2_PFN_SET_LAYER_COLOR)(
hwc2_device_t* device, hwc2_display_t display, hwc2_layer_t layer,
hwc_color_t color);
+/* setLayerFloatColor(..., color)
+ * Descriptor: HWC2_FUNCTION_SET_LAYER_FLOAT_COLOR
+ * Provided by HWC2 devices which don't return nullptr function pointer.
+ *
+ * Sets the color of the given layer. If the composition type of the layer is
+ * not HWC2_COMPOSITION_SOLID_COLOR, this call must return HWC2_ERROR_NONE and
+ * have no other effect.
+ *
+ * Parameters:
+ * color - the new color in float type, rage is [0.0, 1.0], the colorspace is
+ * defined by the dataspace that gets set by calling setLayerDataspace.
+ *
+ * Returns HWC2_ERROR_NONE or one of the following errors:
+ * HWC2_ERROR_BAD_LAYER - an invalid layer handle was passed in
+ */
+typedef int32_t /*hwc2_error_t*/ (*HWC2_PFN_SET_LAYER_FLOAT_COLOR)(
+ hwc2_device_t* device, hwc2_display_t display, hwc2_layer_t layer,
+ hwc_float_color_t color);
+
/* setLayerCompositionType(..., type)
* Descriptor: HWC2_FUNCTION_SET_LAYER_COMPOSITION_TYPE
* Must be provided by all HWC2 devices
diff --git a/include/hardware/hwcomposer_defs.h b/include/hardware/hwcomposer_defs.h
index 1e81e6e6..fd373e31 100644
--- a/include/hardware/hwcomposer_defs.h
+++ b/include/hardware/hwcomposer_defs.h
@@ -58,6 +58,13 @@ typedef struct hwc_color {
uint8_t a;
} hwc_color_t;
+typedef struct hwc_float_color {
+ float r;
+ float g;
+ float b;
+ float a;
+} hwc_float_color_t;
+
typedef struct hwc_frect {
float left;
float top;