Henri Verbeet : d2d1: Add opacity support to bitmap brushes.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Apr 15 08:43:26 CDT 2015


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Apr 15 11:07:14 2015 +0200

d2d1: Add opacity support to bitmap brushes.

---

 dlls/d2d1/render_target.c | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/dlls/d2d1/render_target.c b/dlls/d2d1/render_target.c
index 269e764..cdf82bf 100644
--- a/dlls/d2d1/render_target.c
+++ b/dlls/d2d1/render_target.c
@@ -650,6 +650,7 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRectangle(ID2D1RenderTar
             transform._22 = b._11 / d;
             transform._32 = -(b._11 * b._32 - b._31 * b._12) / d;
         }
+        transform.pad1 = brush_impl->opacity;
 
         buffer_desc.ByteWidth = sizeof(transform);
         buffer_data.pSysMem = &transform;
@@ -1396,27 +1397,39 @@ HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target,
     {
 #if 0
         float3x2 transform;
+        float opacity;
+
         SamplerState s;
         Texture2D t;
 
         float4 main(float4 position : SV_POSITION) : SV_Target
         {
-            return t.Sample(s, mul(float3(position.xy, 1.0), transform));
+            float2 texcoord;
+            float4 ret;
+
+            texcoord.x = position.x * transform._11 + position.y * transform._21 + transform._31;
+            texcoord.y = position.x * transform._12 + position.y * transform._22 + transform._32;
+            ret = t.Sample(s, texcoord);
+            ret.a *= opacity;
+
+            return ret;
         }
 #endif
-        0x43425844, 0x20fce5be, 0x138fa37f, 0x9554f03f, 0x3dbe9c02, 0x00000001, 0x00000184, 0x00000003,
+        0x43425844, 0x9a5f9280, 0xa5351c23, 0x15d6e760, 0xce35bcc3, 0x00000001, 0x000001d0, 0x00000003,
         0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020,
         0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49,
         0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003,
-        0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x000000e8, 0x00000040,
-        0x0000003a, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0300005a, 0x00106000, 0x00000000,
+        0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000134, 0x00000040,
+        0x0000004d, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0300005a, 0x00106000, 0x00000000,
         0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04002064, 0x00101032, 0x00000000, 0x00000001,
-        0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x05000036, 0x00100032, 0x00000000,
-        0x00101046, 0x00000000, 0x05000036, 0x00100042, 0x00000000, 0x00004001, 0x3f800000, 0x08000010,
-        0x00100012, 0x00000001, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x08000010,
-        0x00100022, 0x00000001, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000001, 0x09000045,
-        0x001020f2, 0x00000000, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000,
-        0x0100003e,
+        0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0800000f, 0x00100012, 0x00000000,
+        0x00101046, 0x00000000, 0x00208046, 0x00000000, 0x00000000, 0x08000000, 0x00100012, 0x00000000,
+        0x0010000a, 0x00000000, 0x0020802a, 0x00000000, 0x00000000, 0x0800000f, 0x00100042, 0x00000000,
+        0x00101046, 0x00000000, 0x00208046, 0x00000000, 0x00000001, 0x08000000, 0x00100022, 0x00000000,
+        0x0010002a, 0x00000000, 0x0020802a, 0x00000000, 0x00000001, 0x09000045, 0x001000f2, 0x00000000,
+        0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x00102082,
+        0x00000000, 0x0010003a, 0x00000000, 0x0020803a, 0x00000000, 0x00000001, 0x05000036, 0x00102072,
+        0x00000000, 0x00100246, 0x00000000, 0x0100003e,
     };
     static const struct
     {




More information about the wine-cvs mailing list