Nikolay Sivov : dwrite: Use proper pixel format when accessing dib memory directly.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 24 07:37:15 CDT 2015


Module: wine
Branch: master
Commit: f52ef006cdae2e83d392aee0e0f8e3c547c79221
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f52ef006cdae2e83d392aee0e0f8e3c547c79221

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Aug 24 12:01:06 2015 +0300

dwrite: Use proper pixel format when accessing dib memory directly.

---

 dlls/dwrite/gdiinterop.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c
index 8ef38e2..ea745c5 100644
--- a/dlls/dwrite/gdiinterop.c
+++ b/dlls/dwrite/gdiinterop.c
@@ -299,6 +299,11 @@ static void blit_subpixel_888(struct dib_data *dib, int dib_width, const BYTE *s
     }
 }
 
+static inline DWORD colorref_to_pixel_888(COLORREF color)
+{
+    return (((color >> 16) & 0xff) | (color & 0xff00) | ((color << 16) & 0xff0000));
+}
+
 static HRESULT WINAPI rendertarget_DrawGlyphRun(IDWriteBitmapRenderTarget1 *iface,
     FLOAT originX, FLOAT originY, DWRITE_MEASURING_MODE measuring_mode,
     DWRITE_GLYPH_RUN const *run, IDWriteRenderingParams *params, COLORREF color,
@@ -412,6 +417,7 @@ static HRESULT WINAPI rendertarget_DrawGlyphRun(IDWriteBitmapRenderTarget1 *ifac
         UINT32 size = (target.right - target.left) * (target.bottom - target.top);
         BYTE *bitmap;
 
+        color = colorref_to_pixel_888(color);
         if (texturetype == DWRITE_TEXTURE_CLEARTYPE_3x1)
             size *= 3;
         bitmap = heap_alloc_zero(size);




More information about the wine-cvs mailing list