Module: wine Branch: master Commit: 2156e68a4ce47a2d1347d4c1efc40a0a6669e5ee URL: http://source.winehq.org/git/wine.git/?a=commit;h=2156e68a4ce47a2d1347d4c1ef...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed May 14 13:02:38 2014 +0200
d2d1: Add the ID2D1Bitmap interface.
---
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 55a8f4d..367905c 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] const D2D1_POINT_2U *dst_point, + [in] ID2D1Bitmap *bitmap, + [in] const D2D1_RECT_U *src_rect + ); + HRESULT CopyFromRenderTarget( + [in] const D2D1_POINT_2U *dst_point, + [in] ID2D1RenderTarget *render_target, + [in] const D2D1_RECT_U *src_rect + ); + HRESULT CopyFromMemory( + [in] 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 */