[Wine-patches] [eterhack] Revert "gdiplus: Use StretchBlt instead of GdiAlphaBlend if device doesn't support alpha blending (eterbug #5892)."
Dmitry Timoshkov
dmitry на baikal.ru
Пт Апр 20 08:19:24 MSK 2012
This reverts commit 18cc73ce46adf93830700c81a1529ad5315263b1.
A more general solution has been accepted by WineHQ.
---
dlls/gdiplus/graphics.c | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 9aa5f97..2c6c4b2 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -373,6 +373,7 @@ static GpStatus alpha_blend_pixels(GpGraphics *graphics, INT dst_x, INT dst_y,
HBITMAP hbitmap, old_hbm=NULL;
BITMAPINFOHEADER bih;
BYTE *temp_bits;
+ BLENDFUNCTION bf;
hdc = CreateCompatibleDC(0);
@@ -396,25 +397,13 @@ static GpStatus alpha_blend_pixels(GpGraphics *graphics, INT dst_x, INT dst_y,
old_hbm = SelectObject(hdc, hbitmap);
- if (GetDeviceCaps(graphics->hdc, SHADEBLENDCAPS) == SB_NONE)
- {
- TRACE("alpha blending not supported by device, fallback to StretchBlt\n");
+ bf.BlendOp = AC_SRC_OVER;
+ bf.BlendFlags = 0;
+ bf.SourceConstantAlpha = 255;
+ bf.AlphaFormat = AC_SRC_ALPHA;
- StretchBlt(graphics->hdc, dst_x, dst_y, src_width, src_height,
- hdc, 0, 0, src_width, src_height, SRCCOPY);
- }
- else
- {
- BLENDFUNCTION bf;
-
- bf.BlendOp = AC_SRC_OVER;
- bf.BlendFlags = 0;
- bf.SourceConstantAlpha = 255;
- bf.AlphaFormat = AC_SRC_ALPHA;
-
- GdiAlphaBlend(graphics->hdc, dst_x, dst_y, src_width, src_height,
- hdc, 0, 0, src_width, src_height, bf);
- }
+ GdiAlphaBlend(graphics->hdc, dst_x, dst_y, src_width, src_height,
+ hdc, 0, 0, src_width, src_height, bf);
SelectObject(hdc, old_hbm);
DeleteDC(hdc);
--
1.7.9.4
Подробная информация о списке рассылки Wine-patches