[PATCH 4/5] d2d1: Add the ID2D1Bitmap interface.
Henri Verbeet
hverbeet at codeweavers.com
Wed May 14 00:56:25 CDT 2014
---
include/d2d1.idl | 36 ++++++++++++++++++++++++++++++++++++
include/d2dbasetypes.h | 20 ++++++++++++++++++++
include/dcommon.h | 17 +++++++++++++++++
3 files changed, 73 insertions(+)
diff --git a/include/d2d1.idl b/include/d2d1.idl
index 84a5d74..84fd157 100644
--- a/include/d2d1.idl
+++ b/include/d2d1.idl
@@ -17,9 +17,11 @@
*/
import "unknwn.idl";
+import "dcommon.h";
import "d2dbasetypes.h";
interface ID2D1Factory;
+interface ID2D1RenderTarget;
interface IDWriteRenderingParams;
typedef D2D_POINT_2F D2D1_POINT_2F;
@@ -27,6 +29,9 @@ typedef D2D_MATRIX_3X2_F D2D1_MATRIX_3X2_F;
typedef D2D_RECT_F D2D1_RECT_F;
typedef D2D_SIZE_F D2D1_SIZE_F;
typedef UINT64 D2D1_TAG;
+typedef D2D_SIZE_U D2D1_SIZE_U;
+typedef D2D_POINT_2U D2D1_POINT_2U;
+typedef D2D_RECT_U D2D1_RECT_U;
typedef enum D2D1_DEBUG_LEVEL
{
@@ -507,5 +512,36 @@ interface ID2D1Image : ID2D1Resource
{
}
+[
+ local,
+ object,
+ uuid(a2296057-ea42-4099-983b-539fb6505426)
+]
+interface ID2D1Bitmap : ID2D1Image
+{
+ D2D1_SIZE_F GetSize();
+ D2D1_SIZE_U GetPixelSize();
+ D2D1_PIXEL_FORMAT GetPixelFormat();
+ void GetDpi(
+ [out] float *dpi_x,
+ [out] float *dpi_y
+ );
+ HRESULT CopyFromBitmap(
+ [in, optional] const D2D1_POINT_2U *dst_point,
+ [in] ID2D1Bitmap *bitmap,
+ [in, optional] const D2D1_RECT_U *src_rect
+ );
+ HRESULT CopyFromRenderTarget(
+ [in, optional] const D2D1_POINT_2U *dst_point,
+ [in] ID2D1RenderTarget *render_target,
+ [in, optional] const D2D1_RECT_U *src_rect
+ );
+ HRESULT CopyFromMemory(
+ [in, optional] const D2D1_RECT_U *dst_rect,
+ [in] const void *src_data,
+ [in] UINT32 pitch
+ );
+}
+
[local] HRESULT __stdcall D2D1CreateFactory(D2D1_FACTORY_TYPE factory_type, REFIID iid,
const D2D1_FACTORY_OPTIONS *factory_options, void **factory);
diff --git a/include/d2dbasetypes.h b/include/d2dbasetypes.h
index 4ddb994..61158ac 100644
--- a/include/d2dbasetypes.h
+++ b/include/d2dbasetypes.h
@@ -45,3 +45,23 @@ typedef struct D2D_SIZE_F
float width;
float height;
} D2D_SIZE_F;
+
+typedef struct D2D_SIZE_U
+{
+ UINT32 width;
+ UINT32 height;
+} D2D_SIZE_U;
+
+typedef struct D2D_POINT_2U
+{
+ UINT32 x;
+ UINT32 y;
+} D2D_POINT_2U;
+
+typedef struct D2D_RECT_U
+{
+ UINT32 left;
+ UINT32 top;
+ UINT32 right;
+ UINT32 bottom;
+} D2D_RECT_U;
diff --git a/include/dcommon.h b/include/dcommon.h
index 50daefb..56445a3 100644
--- a/include/dcommon.h
+++ b/include/dcommon.h
@@ -19,6 +19,8 @@
#ifndef __WINE_DCOMMON_H
#define __WINE_DCOMMON_H
+#include "dxgiformat.h"
+
typedef enum DWRITE_MEASURING_MODE
{
DWRITE_MEASURING_MODE_NATURAL,
@@ -26,4 +28,19 @@ typedef enum DWRITE_MEASURING_MODE
DWRITE_MEASURING_MODE_GDI_NATURAL
} DWRITE_MEASURING_MODE;
+typedef enum D2D1_ALPHA_MODE
+{
+ D2D1_ALPHA_MODE_UNKNOWN = 0,
+ D2D1_ALPHA_MODE_PREMULTIPLIED = 1,
+ D2D1_ALPHA_MODE_STRAIGHT = 2,
+ D2D1_ALPHA_MODE_IGNORE = 3,
+ D2D1_ALPHA_MODE_FORCE_DWORD = 0xffffffff,
+} D2D1_ALPHA_MODE;
+
+typedef struct D2D1_PIXEL_FORMAT
+{
+ DXGI_FORMAT format;
+ D2D1_ALPHA_MODE alphaMode;
+} D2D1_PIXEL_FORMAT;
+
#endif /* __WINE_DCOMMON_H */
--
1.7.10.4
More information about the wine-patches
mailing list