Module: wine Branch: master Commit: c525dae7abce37ac9968d5720fd985e33ef7dc83 URL: https://source.winehq.org/git/wine.git/?a=commit;h=c525dae7abce37ac9968d5720...
Author: Ziqing Hui zhui@codeweavers.com Date: Wed Aug 19 10:04:05 2020 +0800
windowscodecs/tests: Add macro BLOCK_WIDTH and BLOCK_HEIGHT.
Signed-off-by: Ziqing Hui zhui@codeweavers.com Signed-off-by: Esme Povirk esme@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/windowscodecs/tests/ddsformat.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/windowscodecs/tests/ddsformat.c b/dlls/windowscodecs/tests/ddsformat.c index 18ce0a241a..790c28315a 100644 --- a/dlls/windowscodecs/tests/ddsformat.c +++ b/dlls/windowscodecs/tests/ddsformat.c @@ -30,6 +30,9 @@ #define MAKE_RGB565(r, g, b) ((WORD)(((BYTE)(r) << 11) | ((BYTE)(g) << 5) | (BYTE)(b))) #define MAKE_ARGB(a, r, g, b) (((DWORD)(a) << 24) | ((DWORD)(r) << 16) | ((DWORD)(g) << 8) | (DWORD)(b))
+#define BLOCK_WIDTH 4 +#define BLOCK_HEIGHT 4 + /* 1x1 uncompressed(Alpha) DDS image */ static BYTE test_dds_alpha[] = { 'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, @@ -645,10 +648,10 @@ static void decode_block(const BYTE *block_data, UINT block_count, DXGI_FORMAT f buffer[x + y * width] = rgb565_to_argb(color_value, alpha_value); }
- block_x += 4; + block_x += BLOCK_WIDTH; if (block_x >= width) { block_x = 0; - block_y += 4; + block_y += BLOCK_HEIGHT; } } } @@ -883,8 +886,8 @@ static void test_dds_decoder_frame_properties(IWICBitmapFrameDecode *frame_decod expected_block_width = 1; expected_block_height = 1; } else { - expected_block_width = 4; - expected_block_height = 4; + expected_block_width = BLOCK_WIDTH; + expected_block_height = BLOCK_HEIGHT; }
hr = IWICDdsFrameDecode_GetFormatInfo(dds_frame, NULL);