[PATCH 2/3] dwrite: Bitmap buffer is zeroed on allocation, no need to do it again

Nikolay Sivov nsivov at codeweavers.com
Thu Aug 27 00:39:25 CDT 2015


---

-------------- next part --------------
>From e6af17153d694233fdf149798811df24da131db2 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov at codeweavers.com>
Date: Thu, 27 Aug 2015 08:31:22 +0300
Subject: [PATCH 2/3] dwrite: Bitmap buffer is zeroed on allocation, no need to
 do it again

---
 dlls/dwrite/freetype.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/dlls/dwrite/freetype.c b/dlls/dwrite/freetype.c
index dc6d701..1f7e6a9 100644
--- a/dlls/dwrite/freetype.c
+++ b/dlls/dwrite/freetype.c
@@ -539,7 +539,6 @@ void freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap)
             ft_bitmap.buffer = bitmap->buf;
 
             /* Note: FreeType will only set 'black' bits for us. */
-            memset(bitmap->buf, 0, height * bitmap->pitch);
             if (pFT_Outline_New(library, src->n_points, src->n_contours, &copy) == 0) {
                 pFT_Outline_Copy(src, &copy);
                 pFT_Outline_Translate(&copy, -bbox->left << 6, bbox->bottom << 6);
@@ -553,8 +552,6 @@ void freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap)
             int w = min(bitmap->pitch, (ft_bitmap->width + 7) >> 3);
             int h = min(height, ft_bitmap->rows);
 
-            memset(bitmap->buf, 0, height * bitmap->pitch);
-
             while (h--) {
                 memcpy(dst, src, w);
                 src += ft_bitmap->pitch;
@@ -680,8 +677,6 @@ void freetype_get_glyph_bbox(struct dwrite_glyphbitmap *bitmap)
 
 void freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap)
 {
-    UINT32 size = (bitmap->bbox.right - bitmap->bbox.left)*(bitmap->bbox.bottom - bitmap->bbox.top);
-    memset(bitmap->buf, 0, size);
 }
 
 INT freetype_get_charmap_index(IDWriteFontFace2 *fontface, BOOL *is_symbol)
-- 
2.1.4



More information about the wine-patches mailing list