From 1adc14bbe1ad2b0517245375ae9a02235cb6a1bd Mon Sep 17 00:00:00 2001 From: caro Date: Wed, 19 Nov 2008 08:48:00 +0000 Subject: [PATCH] * formatting * use a negative height for the biHeight member of the bitmap info (topdown bitmap) git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@37712 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- .../software_16_wince/evas_wince_gdi_buffer.c | 85 +++++++++++----------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/src/modules/engines/software_16_wince/evas_wince_gdi_buffer.c b/src/modules/engines/software_16_wince/evas_wince_gdi_buffer.c index 5f0a0bb..75bee5c 100644 --- a/src/modules/engines/software_16_wince/evas_wince_gdi_buffer.c +++ b/src/modules/engines/software_16_wince/evas_wince_gdi_buffer.c @@ -41,44 +41,44 @@ evas_software_wince_gdi_init(HWND window, return NULL; } - priv->width = GetSystemMetrics(SM_CXSCREEN); - priv->height = GetSystemMetrics(SM_CYSCREEN); - - if ((priv->width != width) || - (priv->height != height)) - { - fprintf (stderr, "[Evas] [Engine] [WinCE GDI] Size mismatch\n"); - fprintf (stderr, "[Evas] [Engine] [WinCE GDI] asked: %dx%d\n", width, height); - fprintf (stderr, "[Evas] [Engine] [WinCE GDI] got : %dx%d\n", priv->width, priv->height); - ReleaseDC(window, priv->dc); - free(priv); - return NULL; - } - - priv->bitmap_info = (BITMAPINFO_16bpp *)malloc(sizeof(BITMAPINFO_16bpp)); - if (!priv->bitmap_info) - { - ReleaseDC(window, priv->dc); - free(priv); - return NULL; - } - - priv->bitmap_info->bih.biSize = sizeof(BITMAPINFOHEADER); - priv->bitmap_info->bih.biWidth = priv->width; - priv->bitmap_info->bih.biHeight = priv->height; /* -h for topdown bitmap ? */ - priv->bitmap_info->bih.biPlanes = 1; - priv->bitmap_info->bih.biSizeImage = 2 * priv->width * priv->height; - priv->bitmap_info->bih.biXPelsPerMeter = 0; - priv->bitmap_info->bih.biYPelsPerMeter = 0; - priv->bitmap_info->bih.biClrUsed = 0; - priv->bitmap_info->bih.biClrImportant = 0; - priv->bitmap_info->bih.biBitCount = 16; - priv->bitmap_info->bih.biCompression = BI_BITFIELDS; - priv->bitmap_info->masks[0] = 0x0000f800; - priv->bitmap_info->masks[1] = 0x000007e0; - priv->bitmap_info->masks[2] = 0x0000001f; - - return priv; + priv->width = GetSystemMetrics(SM_CXSCREEN); + priv->height = GetSystemMetrics(SM_CYSCREEN); + + if ((priv->width != width) || + (priv->height != height)) + { + fprintf (stderr, "[Evas] [Engine] [WinCE GDI] Size mismatch\n"); + fprintf (stderr, "[Evas] [Engine] [WinCE GDI] asked: %dx%d\n", width, height); + fprintf (stderr, "[Evas] [Engine] [WinCE GDI] got : %dx%d\n", priv->width, priv->height); + ReleaseDC(window, priv->dc); + free(priv); + return NULL; + } + + priv->bitmap_info = (BITMAPINFO_16bpp *)malloc(sizeof(BITMAPINFO_16bpp)); + if (!priv->bitmap_info) + { + ReleaseDC(window, priv->dc); + free(priv); + return NULL; + } + + priv->bitmap_info->bih.biSize = sizeof(BITMAPINFOHEADER); + priv->bitmap_info->bih.biWidth = priv->width; + priv->bitmap_info->bih.biHeight = -priv->height; + priv->bitmap_info->bih.biPlanes = 1; + priv->bitmap_info->bih.biSizeImage = 2 * priv->width * priv->height; + priv->bitmap_info->bih.biXPelsPerMeter = 0; + priv->bitmap_info->bih.biYPelsPerMeter = 0; + priv->bitmap_info->bih.biClrUsed = 0; + priv->bitmap_info->bih.biClrImportant = 0; + priv->bitmap_info->bih.biBitCount = 16; + priv->bitmap_info->bih.biCompression = BI_BITFIELDS; + priv->bitmap_info->masks[0] = 0x0000f800; + priv->bitmap_info->masks[1] = 0x000007e0; + priv->bitmap_info->masks[2] = 0x0000001f; + + return priv; } void @@ -92,12 +92,12 @@ evas_software_wince_gdi_shutdown(void *priv) FB_Output_Buffer * evas_software_wince_gdi_output_buffer_new(void *priv, - int width, - int height) + int width, + int height) { Evas_Engine_WinCE_GDI_Priv *priv2; - FB_Output_Buffer *fbob; - void *buffer; + FB_Output_Buffer *fbob; + void *buffer; fbob = calloc(1, sizeof(FB_Output_Buffer)); if (!fbob) return NULL; @@ -105,6 +105,7 @@ evas_software_wince_gdi_output_buffer_new(void *priv, fbob->priv = priv; priv2 = (Evas_Engine_WinCE_GDI_Priv *)fbob->priv; + priv2->bitmap = CreateDIBSection(priv2->dc, (const BITMAPINFO *)priv2->bitmap_info, DIB_RGB_COLORS, -- 2.7.4