wined3d: Use a separate STATE_VDECL state handler in the GLSL pipeline.
[wine/multimedia.git] / dlls / d2d1 / d2d1_private.h
blob42694d2d86d058fd5dc6c37885ac5e252170b61c
1 /*
2 * Copyright 2014 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_D2D1_PRIVATE_H
20 #define __WINE_D2D1_PRIVATE_H
22 #include "wine/debug.h"
24 #include <assert.h>
25 #include <limits.h>
26 #define COBJMACROS
27 #include "d2d1.h"
28 #ifdef D2D1_INIT_GUID
29 #include "initguid.h"
30 #endif
31 #include "dwrite.h"
33 enum d2d_brush_type
35 D2D_BRUSH_TYPE_SOLID,
36 D2D_BRUSH_TYPE_LINEAR,
37 D2D_BRUSH_TYPE_BITMAP,
40 struct d2d_clip_stack
42 D2D1_RECT_F *stack;
43 unsigned int size;
44 unsigned int count;
47 struct d2d_d3d_render_target
49 ID2D1RenderTarget ID2D1RenderTarget_iface;
50 IDWriteTextRenderer IDWriteTextRenderer_iface;
51 LONG refcount;
53 ID3D10Device *device;
54 ID3D10RenderTargetView *view;
55 ID3D10StateBlock *stateblock;
56 ID3D10InputLayout *il;
57 unsigned int vb_stride;
58 ID3D10Buffer *vb;
59 ID3D10VertexShader *vs;
60 ID3D10RasterizerState *rs;
61 ID3D10BlendState *bs;
63 ID3D10PixelShader *rect_solid_ps;
64 ID3D10PixelShader *rect_bitmap_ps;
66 D2D1_SIZE_U pixel_size;
67 D2D1_MATRIX_3X2_F transform;
68 struct d2d_clip_stack clip_stack;
69 float dpi_x;
70 float dpi_y;
73 HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target, ID2D1Factory *factory,
74 IDXGISurface *surface, const D2D1_RENDER_TARGET_PROPERTIES *desc) DECLSPEC_HIDDEN;
76 struct d2d_wic_render_target
78 ID2D1RenderTarget ID2D1RenderTarget_iface;
79 LONG refcount;
81 IDXGISurface *dxgi_surface;
82 ID2D1RenderTarget *dxgi_target;
83 ID3D10Texture2D *readback_texture;
84 IWICBitmap *bitmap;
86 unsigned int width;
87 unsigned int height;
88 unsigned int bpp;
91 HRESULT d2d_wic_render_target_init(struct d2d_wic_render_target *render_target, ID2D1Factory *factory,
92 IWICBitmap *bitmap, const D2D1_RENDER_TARGET_PROPERTIES *desc) DECLSPEC_HIDDEN;
94 struct d2d_gradient
96 ID2D1GradientStopCollection ID2D1GradientStopCollection_iface;
97 LONG refcount;
99 D2D1_GRADIENT_STOP *stops;
100 UINT32 stop_count;
103 HRESULT d2d_gradient_init(struct d2d_gradient *gradient, ID2D1RenderTarget *render_target,
104 const D2D1_GRADIENT_STOP *stops, UINT32 stop_count, D2D1_GAMMA gamma,
105 D2D1_EXTEND_MODE extend_mode) DECLSPEC_HIDDEN;
107 struct d2d_brush
109 ID2D1Brush ID2D1Brush_iface;
110 LONG refcount;
112 float opacity;
113 D2D1_MATRIX_3X2_F transform;
115 enum d2d_brush_type type;
116 union
118 struct
120 D2D1_COLOR_F color;
121 } solid;
122 struct
124 struct d2d_bitmap *bitmap;
125 ID3D10SamplerState *sampler_state;
126 } bitmap;
127 } u;
130 void d2d_solid_color_brush_init(struct d2d_brush *brush, ID2D1RenderTarget *render_target,
131 const D2D1_COLOR_F *color, const D2D1_BRUSH_PROPERTIES *desc) DECLSPEC_HIDDEN;
132 void d2d_linear_gradient_brush_init(struct d2d_brush *brush, ID2D1RenderTarget *render_target,
133 const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *gradient_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc,
134 ID2D1GradientStopCollection *gradient) DECLSPEC_HIDDEN;
135 HRESULT d2d_bitmap_brush_init(struct d2d_brush *brush, struct d2d_d3d_render_target *render_target,
136 ID2D1Bitmap *bitmap, const D2D1_BITMAP_BRUSH_PROPERTIES *bitmap_brush_desc,
137 const D2D1_BRUSH_PROPERTIES *brush_desc) DECLSPEC_HIDDEN;
138 void d2d_brush_bind_resources(struct d2d_brush *brush, ID3D10Device *device) DECLSPEC_HIDDEN;
139 struct d2d_brush *unsafe_impl_from_ID2D1Brush(ID2D1Brush *iface) DECLSPEC_HIDDEN;
141 struct d2d_stroke_style
143 ID2D1StrokeStyle ID2D1StrokeStyle_iface;
144 LONG refcount;
147 void d2d_stroke_style_init(struct d2d_stroke_style *style, ID2D1Factory *factory,
148 const D2D1_STROKE_STYLE_PROPERTIES *desc, const float *dashes, UINT32 dash_count) DECLSPEC_HIDDEN;
150 struct d2d_mesh
152 ID2D1Mesh ID2D1Mesh_iface;
153 LONG refcount;
156 void d2d_mesh_init(struct d2d_mesh *mesh) DECLSPEC_HIDDEN;
158 struct d2d_bitmap
160 ID2D1Bitmap ID2D1Bitmap_iface;
161 LONG refcount;
163 ID3D10ShaderResourceView *view;
164 D2D1_SIZE_U pixel_size;
165 float dpi_x;
166 float dpi_y;
169 HRESULT d2d_bitmap_init(struct d2d_bitmap *bitmap, struct d2d_d3d_render_target *render_target,
170 D2D1_SIZE_U size, const void *src_data, UINT32 pitch, const D2D1_BITMAP_PROPERTIES *desc) DECLSPEC_HIDDEN;
171 struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface) DECLSPEC_HIDDEN;
173 struct d2d_state_block
175 ID2D1DrawingStateBlock ID2D1DrawingStateBlock_iface;
176 LONG refcount;
179 void d2d_state_block_init(struct d2d_state_block *state_block, const D2D1_DRAWING_STATE_DESCRIPTION *desc,
180 IDWriteRenderingParams *text_rendering_params) DECLSPEC_HIDDEN;
182 #endif /* __WINE_D2D1_PRIVATE_H */