diff --git a/graphic/graphic_2d/native_buffer/native_buffer.h b/graphic/graphic_2d/native_buffer/native_buffer.h index 7c8597cde860977519b09d97d50e0e04e7211f90..17efdb7235810648f7b4d24b66efaf04b299fb7b 100644 --- a/graphic/graphic_2d/native_buffer/native_buffer.h +++ b/graphic/graphic_2d/native_buffer/native_buffer.h @@ -58,6 +58,10 @@ enum OH_NativeBuffer_Usage { NATIVEBUFFER_USAGE_CPU_READ = (1ULL << 0), /// < CPU read buffer */ NATIVEBUFFER_USAGE_CPU_WRITE = (1ULL << 1), /// < CPU write memory */ NATIVEBUFFER_USAGE_MEM_DMA = (1ULL << 3), /// < Direct memory access (DMA) buffer */ + NATIVEBUFFER_USAGE_HW_RENDER = (1ULL << 8), /// < For GPU write case */ + NATIVEBUFFER_USAGE_HW_TEXTURE = (1ULL << 9), /// < For GPU read case */ + NATIVEBUFFER_USAGE_CPU_READ_OFTEN = (1ULL << 16), /// < Often be mapped for direct CPU reads */ + NATIVEBUFFER_USAGE_ALIGNMENT_512 = (1ULL << 18), /// < 512 bytes alignment */ }; /** @@ -171,6 +175,21 @@ enum OH_NativeBuffer_Format { * @since 12 */ NATIVEBUFFER_PIXEL_FMT_RGBA_1010102, + /** + * YCBCR420 semi-planar 10bit packed format + * @since 12 + */ + NATIVEBUFFER_PIXEL_FMT_YCBCR_P010, + /** + * YCRCB420 semi-planar 10bit packed format + * @since 12 + */ + NATIVEBUFFER_PIXEL_FMT_YCRCB_P010, + /** + * Raw 10bit packed format + * @since 12 + */ + NATIVEBUFFER_PIXEL_FMT_RAW10, /** * vender mask format * @since 12 diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index 66db08561edacfa1d5935a19c94570b8e89d3a27..ece38e46c50f72c5436110289706fe315df3c2c4 100644 --- a/graphic/graphic_2d/native_window/external_window.h +++ b/graphic/graphic_2d/native_window/external_window.h @@ -229,6 +229,37 @@ typedef enum { OH_SCALING_MODE_NO_SCALE_CROP, } OHScalingMode; +/** + * @brief Indicates Scaling Mode. + * @since 12 + */ +typedef enum { + /** + * the window content is not updated until a buffer of + * the window size is received + */ + OH_SCALING_MODE_FREEZE_V2 = 0, + /** + * the buffer is scaled in two dimensions to match the window size + */ + OH_SCALING_MODE_SCALE_TO_WINDOW_V2, + /** + * the buffer is uniformly scaled so that the smaller size of + * the buffer matches the window size + */ + OH_SCALING_MODE_SCALE_CROP_V2, + /** + * the window is clipped to the size of the buffer's clipping rectangle + * pixels outside the clipping rectangle are considered fully transparent. + */ + OH_SCALING_MODE_NO_SCALE_CROP_V2, + /** + * Adapt to the buffer and scale proportionally to the buffer size. Prioritize displaying all buffer content. + * If the size is not the same as the window size, fill the unfilled area of the window with a background color. + */ + OH_SCALING_MODE_SCALE_FIT_V2, +} OHScalingModeV2; + /** * @brief Enumerates the HDR metadata keys. * @since 9