Adam Petaccia : gdiplus: Implement GdipCreateTexture.

Alexandre Julliard julliard at winehq.org
Tue Sep 2 08:33:17 CDT 2008


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

Author: Adam Petaccia <adam at tpetaccia.com>
Date:   Sun Aug 31 01:06:58 2008 -0400

gdiplus: Implement GdipCreateTexture.

---

 dlls/gdiplus/brush.c |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c
index ae7266e..3a991d2 100644
--- a/dlls/gdiplus/brush.c
+++ b/dlls/gdiplus/brush.c
@@ -373,12 +373,38 @@ GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
     return Ok;
 }
 
+/*******************************************************************************
+ * GdipCreateTexture [GDIPLUS.@]
+ *
+ * PARAMS
+ *  image       [I] image to use
+ *  wrapmode    [I] optional
+ *  texture     [O] pointer to the resulting texturebrush
+ *
+ * RETURNS
+ *  SUCCESS: Ok
+ *  FAILURE: element of GpStatus
+ */
 GpStatus WINGDIPAPI GdipCreateTexture(GpImage *image, GpWrapMode wrapmode,
         GpTexture **texture)
 {
-    FIXME("stub: %p, %d %p\n", image, wrapmode, texture);
+    UINT width, height;
+    GpImageAttributes attributes;
+    GpStatus stat;
 
-    return NotImplemented;
+    TRACE("%p, %d %p\n", image, wrapmode, texture);
+
+    if (!(image && texture))
+        return InvalidParameter;
+
+    stat = GdipGetImageWidth(image, &width);
+    if (stat != Ok) return stat;
+    stat = GdipGetImageHeight(image, &height);
+    if (stat != Ok) return stat;
+    attributes.wrap = wrapmode;
+
+    return GdipCreateTextureIA(image, &attributes, 0, 0, width, height,
+            texture);
 }
 
 GpStatus WINGDIPAPI GdipCreateTexture2(GpImage *image, GpWrapMode wrapmode,




More information about the wine-cvs mailing list