24#define INITIAL_CLIP_STACK_SIZE 4
48 if (effect &&
SUCCEEDED(IUnknown_QueryInterface(effect, &IID_ID2D1Brush, (
void**)&brush)))
51 ID2D1Brush_AddRef(
context->brush);
61 if (
src->right <
dst->right)
63 if (
src->bottom <
dst->bottom)
120 ID3D11Buffer *ib,
unsigned int index_count, ID3D11Buffer *vb,
unsigned int vb_stride,
127 ID3D11Buffer *vs_cb = render_target->
vs_cb, *ps_cb = render_target->
ps_cb;
139 if (render_target->
cs)
143 ID3D11DeviceContext1_SwapDeviceContextState(
context, render_target->
d3d_state, &prev_state);
145 ID3D11DeviceContext1_IASetInputLayout(
context, shape_resources->
il);
149 ID3D11DeviceContext1_IASetVertexBuffers(
context, 0, 1, &vb, &vb_stride, &
offset);
150 ID3D11DeviceContext1_VSSetConstantBuffers(
context, 0, 1, &vs_cb);
151 ID3D11DeviceContext1_VSSetShader(
context, shape_resources->
vs,
NULL, 0);
152 ID3D11DeviceContext1_PSSetConstantBuffers(
context, 0, 1, &ps_cb);
153 ID3D11DeviceContext1_PSSetShader(
context, render_target->
ps,
NULL, 0);
154 ID3D11DeviceContext1_RSSetViewports(
context, 1, &vp);
167 scissor_rect.
left = 0.0f;
168 scissor_rect.
top = 0.0f;
172 ID3D11DeviceContext1_RSSetScissorRects(
context, 1, &scissor_rect);
173 ID3D11DeviceContext1_RSSetState(
context, render_target->
rs);
174 ID3D11DeviceContext1_OMSetRenderTargets(
context, 1, &render_target->
target.bitmap->rtv,
NULL);
188 ID3D11DeviceContext1_DrawIndexed(
context, index_count, 0, 0);
190 ID3D11DeviceContext1_Draw(
context, index_count, 0);
192 ID3D11DeviceContext1_SwapDeviceContextState(
context, prev_state,
NULL);
193 ID3D11DeviceContext1_Release(
context);
194 ID3DDeviceContextState_Release(prev_state);
196 if (render_target->
cs)
234 ID2D1DeviceContext6_AddRef(&
context->ID2D1DeviceContext6_iface);
238 else if (
IsEqualGUID(iid, &IID_ID2D1GdiInteropRenderTarget))
240 ID2D1GdiInteropRenderTarget_AddRef(&
context->ID2D1GdiInteropRenderTarget_iface);
241 *
out = &
context->ID2D1GdiInteropRenderTarget_iface;
270 unsigned int i,
j,
k;
273 IDWriteRenderingParams_Release(
context->default_text_rendering_params);
274 if (
context->text_rendering_params)
275 IDWriteRenderingParams_Release(
context->text_rendering_params);
277 ID3D11BlendState_Release(
context->bs);
278 ID3D11RasterizerState_Release(
context->rs);
279 ID3D11Buffer_Release(
context->vb);
280 ID3D11Buffer_Release(
context->ib);
281 ID3D11Buffer_Release(
context->ps_cb);
282 ID3D11PixelShader_Release(
context->ps);
283 ID3D11Buffer_Release(
context->vs_cb);
286 ID3D11VertexShader_Release(
context->shape_resources[
i].vs);
287 ID3D11InputLayout_Release(
context->shape_resources[
i].il);
296 ID3D11SamplerState_Release(
context->sampler_states[
i][
j][
k]);
301 ID3DDeviceContextState_Release(
context->d3d_state);
303 IUnknown_Release(
context->target.object);
304 ID3D11Device1_Release(
context->d3d_device);
305 ID2D1Factory_Release(
context->factory);
306 ID2D1Device6_Release(&
context->device->ID2D1Device6_iface);
328 return IUnknown_QueryInterface(
context->outer_unknown, iid,
out);
335 TRACE(
"iface %p.\n", iface);
337 return IUnknown_AddRef(
context->outer_unknown);
344 TRACE(
"iface %p.\n", iface);
346 return IUnknown_Release(
context->outer_unknown);
367 TRACE(
"iface %p, size {%u, %u}, src_data %p, pitch %u, desc %p, bitmap %p.\n",
391 TRACE(
"iface %p, bitmap_source %p, desc %p, bitmap %p.\n",
415 TRACE(
"iface %p, iid %s, data %p, desc %p, bitmap %p.\n",
442 TRACE(
"iface %p, bitmap %p, bitmap_brush_desc %p, brush_desc %p, brush %p.\n",
443 iface,
bitmap, bitmap_brush_desc, brush_desc, brush);
446 brush_desc, &
object)))
459 TRACE(
"iface %p, color %p, desc %p, brush %p.\n", iface,
color,
desc, brush);
475 TRACE(
"iface %p, stops %p, stop_count %u, gamma %#x, extend_mode %#x, gradient %p.\n",
480 *gradient = &
object->ID2D1GradientStopCollection_iface;
493 TRACE(
"iface %p, gradient_brush_desc %p, brush_desc %p, gradient %p, brush %p.\n",
494 iface, gradient_brush_desc, brush_desc,
gradient, brush);
511 TRACE(
"iface %p, gradient_brush_desc %p, brush_desc %p, gradient %p, brush %p.\n",
512 iface, gradient_brush_desc, brush_desc,
gradient, brush);
515 gradient_brush_desc, brush_desc,
gradient, &
object)))
529 TRACE(
"iface %p, size %p, pixel_size %p, format %p, options %#x, render_target %p.\n",
532 if (!(
object =
calloc(1,
sizeof(*
object))))
538 WARN(
"Failed to initialise render target, hr %#lx.\n",
hr);
543 TRACE(
"Created render target %p.\n",
object);
544 *rt = &
object->ID2D1BitmapRenderTarget_iface;
559 *
layer = &
object->ID2D1Layer_iface;
570 TRACE(
"iface %p, mesh %p.\n", iface,
mesh);
573 *
mesh = &
object->ID2D1Mesh_iface;
586 TRACE(
"iface %p, p0 %s, p1 %s, brush %p, stroke_width %.8e, stroke_style %p.\n",
595 if (
FAILED(
hr = ID2D1Factory_CreatePathGeometry(
context->factory, &geometry)))
597 WARN(
"Failed to create path geometry, hr %#lx.\n",
hr);
601 if (
FAILED(
hr = ID2D1PathGeometry_Open(geometry, &
sink)))
603 WARN(
"Failed to open geometry sink, hr %#lx.\n",
hr);
604 ID2D1PathGeometry_Release(geometry);
609 ID2D1GeometrySink_AddLine(
sink, p1);
612 WARN(
"Failed to close geometry sink, hr %#lx.\n",
hr);
613 ID2D1GeometrySink_Release(
sink);
615 ID2D1DeviceContext6_DrawGeometry(iface, (
ID2D1Geometry *)geometry, brush, stroke_width, stroke_style);
616 ID2D1PathGeometry_Release(geometry);
626 TRACE(
"iface %p, rect %s, brush %p, stroke_width %.8e, stroke_style %p.\n",
637 ERR(
"Failed to create geometry, hr %#lx.\n",
hr);
641 ID2D1DeviceContext6_DrawGeometry(iface, (
ID2D1Geometry *)geometry, brush, stroke_width, stroke_style);
642 ID2D1RectangleGeometry_Release(geometry);
662 ERR(
"Failed to create geometry, hr %#lx.\n",
hr);
667 ID2D1RectangleGeometry_Release(geometry);
677 TRACE(
"iface %p, rect %p, brush %p, stroke_width %.8e, stroke_style %p.\n",
678 iface,
rect, brush, stroke_width, stroke_style);
680 if (
FAILED(
hr = ID2D1Factory_CreateRoundedRectangleGeometry(render_target->
factory,
rect, &geometry)))
682 ERR(
"Failed to create geometry, hr %#lx.\n",
hr);
686 ID2D1DeviceContext6_DrawGeometry(iface, (
ID2D1Geometry *)geometry, brush, stroke_width, stroke_style);
687 ID2D1RoundedRectangleGeometry_Release(geometry);
697 TRACE(
"iface %p, rect %p, brush %p.\n", iface,
rect, brush);
699 if (
FAILED(
hr = ID2D1Factory_CreateRoundedRectangleGeometry(render_target->
factory,
rect, &geometry)))
701 ERR(
"Failed to create geometry, hr %#lx.\n",
hr);
706 ID2D1RoundedRectangleGeometry_Release(geometry);
716 TRACE(
"iface %p, ellipse %p, brush %p, stroke_width %.8e, stroke_style %p.\n",
717 iface, ellipse, brush, stroke_width, stroke_style);
719 if (
FAILED(
hr = ID2D1Factory_CreateEllipseGeometry(render_target->
factory, ellipse, &geometry)))
721 ERR(
"Failed to create geometry, hr %#lx.\n",
hr);
725 ID2D1DeviceContext6_DrawGeometry(iface, (
ID2D1Geometry *)geometry, brush, stroke_width, stroke_style);
726 ID2D1EllipseGeometry_Release(geometry);
736 TRACE(
"iface %p, ellipse %p, brush %p.\n", iface, ellipse, brush);
738 if (
FAILED(
hr = ID2D1Factory_CreateEllipseGeometry(render_target->
factory, ellipse, &geometry)))
740 ERR(
"Failed to create geometry, hr %#lx.\n",
hr);
745 ID2D1EllipseGeometry_Release(geometry);
752 ID3D11DeviceContext *d3d_context;
756 ID3D11Device1_GetImmediateContext(
context->d3d_device, &d3d_context);
758 if (
FAILED(
hr = ID3D11DeviceContext_Map(d3d_context, (ID3D11Resource *)
context->ps_cb,
761 WARN(
"Failed to map constant buffer, hr %#lx.\n",
hr);
762 ID3D11DeviceContext_Release(d3d_context);
766 cb_data = map_desc.
pData;
772 WARN(
"Failed to initialize colour brush buffer.\n");
774 WARN(
"Failed to initialize opacity brush buffer.\n");
776 ID3D11DeviceContext_Unmap(d3d_context, (ID3D11Resource *)
context->ps_cb, 0);
777 ID3D11DeviceContext_Release(d3d_context);
786 ID3D11DeviceContext *d3d_context;
792 ID3D11Device1_GetImmediateContext(
context->d3d_device, &d3d_context);
794 if (
FAILED(
hr = ID3D11DeviceContext_Map(d3d_context, (ID3D11Resource *)
context->vs_cb,
797 WARN(
"Failed to map constant buffer, hr %#lx.\n",
hr);
798 ID3D11DeviceContext_Release(d3d_context);
802 cb_data = map_desc.
pData;
812 w = &
context->drawing_state.transform;
814 tmp_x =
context->desc.dpiX / 96.0f;
820 tmp_y =
context->desc.dpiY / 96.0f;
826 ID3D11DeviceContext_Unmap(d3d_context, (ID3D11Resource *)
context->vs_cb, 0);
827 ID3D11DeviceContext_Release(d3d_context);
835 D3D11_SUBRESOURCE_DATA buffer_data;
836 D3D11_BUFFER_DESC buffer_desc;
837 ID3D11Buffer *ib, *vb;
842 WARN(
"Failed to update vs constant buffer, hr %#lx.\n",
hr);
848 WARN(
"Failed to update ps constant buffer, hr %#lx.\n",
hr);
852 buffer_desc.Usage = D3D11_USAGE_DEFAULT;
853 buffer_desc.CPUAccessFlags = 0;
854 buffer_desc.MiscFlags = 0;
856 buffer_data.SysMemPitch = 0;
857 buffer_data.SysMemSlicePitch = 0;
859 if (geometry->
outline.face_count)
861 buffer_desc.ByteWidth = geometry->
outline.face_count *
sizeof(*geometry->
outline.faces);
862 buffer_desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
863 buffer_data.pSysMem = geometry->
outline.faces;
865 if (
FAILED(
hr = ID3D11Device1_CreateBuffer(render_target->
d3d_device, &buffer_desc, &buffer_data, &ib)))
867 WARN(
"Failed to create index buffer, hr %#lx.\n",
hr);
871 buffer_desc.ByteWidth = geometry->
outline.vertex_count *
sizeof(*geometry->
outline.vertices);
872 buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
873 buffer_data.pSysMem = geometry->
outline.vertices;
875 if (
FAILED(
hr = ID3D11Device1_CreateBuffer(render_target->
d3d_device, &buffer_desc, &buffer_data, &vb)))
877 ERR(
"Failed to create vertex buffer, hr %#lx.\n",
hr);
878 ID3D11Buffer_Release(ib);
885 ID3D11Buffer_Release(vb);
886 ID3D11Buffer_Release(ib);
889 if (geometry->
outline.bezier_face_count)
891 buffer_desc.ByteWidth = geometry->
outline.bezier_face_count *
sizeof(*geometry->
outline.bezier_faces);
892 buffer_desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
893 buffer_data.pSysMem = geometry->
outline.bezier_faces;
895 if (
FAILED(
hr = ID3D11Device1_CreateBuffer(render_target->
d3d_device, &buffer_desc, &buffer_data, &ib)))
897 WARN(
"Failed to create curves index buffer, hr %#lx.\n",
hr);
901 buffer_desc.ByteWidth = geometry->
outline.bezier_count *
sizeof(*geometry->
outline.beziers);
902 buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
903 buffer_data.pSysMem = geometry->
outline.beziers;
905 if (
FAILED(
hr = ID3D11Device1_CreateBuffer(render_target->
d3d_device, &buffer_desc, &buffer_data, &vb)))
907 ERR(
"Failed to create curves vertex buffer, hr %#lx.\n",
hr);
908 ID3D11Buffer_Release(ib);
913 3 * geometry->
outline.bezier_face_count, vb,
916 ID3D11Buffer_Release(vb);
917 ID3D11Buffer_Release(ib);
920 if (geometry->
outline.arc_face_count)
922 buffer_desc.ByteWidth = geometry->
outline.arc_face_count *
sizeof(*geometry->
outline.arc_faces);
923 buffer_desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
924 buffer_data.pSysMem = geometry->
outline.arc_faces;
926 if (
FAILED(
hr = ID3D11Device1_CreateBuffer(render_target->
d3d_device, &buffer_desc, &buffer_data, &ib)))
928 WARN(
"Failed to create arcs index buffer, hr %#lx.\n",
hr);
932 buffer_desc.ByteWidth = geometry->
outline.arc_count *
sizeof(*geometry->
outline.arcs);
933 buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
934 buffer_data.pSysMem = geometry->
outline.arcs;
936 if (
FAILED(
hr = ID3D11Device1_CreateBuffer(render_target->
d3d_device, &buffer_desc, &buffer_data, &vb)))
938 ERR(
"Failed to create arcs vertex buffer, hr %#lx.\n",
hr);
939 ID3D11Buffer_Release(ib);
945 3 * geometry->
outline.arc_face_count, vb,
948 ID3D11Buffer_Release(vb);
949 ID3D11Buffer_Release(ib);
961 TRACE(
"iface %p, geometry %p, brush %p, stroke_width %.8e, stroke_style %p.\n",
962 iface, geometry, brush, stroke_width, stroke_style);
967 stroke_width, stroke_style);
972 FIXME(
"Ignoring stroke style %p.\n", stroke_style);
974 if (stroke_style_impl)
977 stroke_width /=
context->drawing_state.transform.m11;
986 D3D11_SUBRESOURCE_DATA buffer_data;
987 D3D11_BUFFER_DESC buffer_desc;
988 ID3D11Buffer *ib, *vb;
991 buffer_desc.Usage = D3D11_USAGE_DEFAULT;
992 buffer_desc.CPUAccessFlags = 0;
993 buffer_desc.MiscFlags = 0;
995 buffer_data.SysMemPitch = 0;
996 buffer_data.SysMemSlicePitch = 0;
1000 WARN(
"Failed to update vs constant buffer, hr %#lx.\n",
hr);
1006 WARN(
"Failed to update ps constant buffer, hr %#lx.\n",
hr);
1010 if (geometry->
fill.face_count)
1012 buffer_desc.ByteWidth = geometry->
fill.face_count *
sizeof(*geometry->
fill.faces);
1013 buffer_desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
1014 buffer_data.pSysMem = geometry->
fill.faces;
1016 if (
FAILED(
hr = ID3D11Device1_CreateBuffer(render_target->
d3d_device, &buffer_desc, &buffer_data, &ib)))
1018 WARN(
"Failed to create index buffer, hr %#lx.\n",
hr);
1022 buffer_desc.ByteWidth = geometry->
fill.vertex_count *
sizeof(*geometry->
fill.vertices);
1023 buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
1024 buffer_data.pSysMem = geometry->
fill.vertices;
1026 if (
FAILED(
hr = ID3D11Device1_CreateBuffer(render_target->
d3d_device, &buffer_desc, &buffer_data, &vb)))
1028 ERR(
"Failed to create vertex buffer, hr %#lx.\n",
hr);
1029 ID3D11Buffer_Release(ib);
1034 sizeof(*geometry->
fill.vertices), brush, opacity_brush);
1036 ID3D11Buffer_Release(vb);
1037 ID3D11Buffer_Release(ib);
1040 if (geometry->
fill.bezier_vertex_count)
1042 buffer_desc.ByteWidth = geometry->
fill.bezier_vertex_count *
sizeof(*geometry->
fill.bezier_vertices);
1043 buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
1044 buffer_data.pSysMem = geometry->
fill.bezier_vertices;
1046 if (
FAILED(
hr = ID3D11Device1_CreateBuffer(render_target->
d3d_device, &buffer_desc, &buffer_data, &vb)))
1048 ERR(
"Failed to create curves vertex buffer, hr %#lx.\n",
hr);
1053 sizeof(*geometry->
fill.bezier_vertices), brush, opacity_brush);
1055 ID3D11Buffer_Release(vb);
1058 if (geometry->
fill.arc_vertex_count)
1060 buffer_desc.ByteWidth = geometry->
fill.arc_vertex_count *
sizeof(*geometry->
fill.arc_vertices);
1061 buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
1062 buffer_data.pSysMem = geometry->
fill.arc_vertices;
1064 if (
FAILED(
hr = ID3D11Device1_CreateBuffer(render_target->
d3d_device, &buffer_desc, &buffer_data, &vb)))
1066 ERR(
"Failed to create arc vertex buffer, hr %#lx.\n",
hr);
1072 sizeof(*geometry->
fill.arc_vertices), brush, opacity_brush);
1074 ID3D11Buffer_Release(vb);
1086 TRACE(
"iface %p, geometry %p, brush %p, opacity_brush %p.\n", iface, geometry, brush, opacity_brush);
1108 FIXME(
"iface %p, mesh %p, brush %p stub!\n", iface,
mesh, brush);
1120 FIXME(
"iface %p, mask %p, brush %p, content %#x, dst_rect %s, src_rect %s stub!\n",
1154 if (perspective_transform)
1155 FIXME(
"Perspective transform is ignored.\n");
1159 if (src_rect && src_rect->
left <= src_rect->
right
1165 if (
s.left ==
s.right ||
s.top ==
s.bottom)
1176 d.right =
s.right -
s.left;
1177 d.bottom =
s.bottom -
s.top;
1202 ERR(
"Failed to create bitmap brush, hr %#lx.\n",
hr);
1216 TRACE(
"iface %p, bitmap %p, dst_rect %s, opacity %.8e, interpolation_mode %#x, src_rect %s.\n",
1249 TRACE(
"iface %p, string %s, string_len %u, text_format %p, layout_rect %s, "
1250 "brush %p, options %#x, measuring_mode %#x.\n",
1252 brush,
options, measuring_mode);
1255 &IID_IDWriteFactory, (
IUnknown **)&dwrite_factory)))
1257 ERR(
"Failed to create dwrite factory, hr %#lx.\n",
hr);
1264 hr = IDWriteFactory_CreateTextLayout(dwrite_factory,
string, string_len, text_format,
1267 hr = IDWriteFactory_CreateGdiCompatibleTextLayout(dwrite_factory,
string, string_len, text_format,
1270 IDWriteFactory_Release(dwrite_factory);
1273 ERR(
"Failed to create text layout, hr %#lx.\n",
hr);
1279 IDWriteTextLayout_Release(text_layout);
1289 TRACE(
"iface %p, origin %s, layout %p, brush %p, options %#x.\n",
1295 if (
FAILED(
hr = IDWriteTextLayout_Draw(layout,
1297 FIXME(
"Failed to draw text layout, hr %#lx.\n",
hr);
1305 return prev_antialias_mode;
1317 if (
FAILED(
hr = ID2D1Factory_CreatePathGeometry(render_target->
factory, &geometry)))
1319 ERR(
"Failed to create geometry, hr %#lx.\n",
hr);
1323 if (
FAILED(
hr = ID2D1PathGeometry_Open(geometry, &
sink)))
1325 ERR(
"Failed to open geometry sink, hr %#lx.\n",
hr);
1326 ID2D1PathGeometry_Release(geometry);
1334 ERR(
"Failed to get glyph run outline, hr %#lx.\n",
hr);
1335 ID2D1GeometrySink_Release(
sink);
1336 ID2D1PathGeometry_Release(geometry);
1341 ERR(
"Failed to close geometry sink, hr %#lx.\n",
hr);
1342 ID2D1GeometrySink_Release(
sink);
1354 ID2D1PathGeometry_Release(geometry);
1371 void *opacity_values =
NULL;
1372 size_t opacity_values_size;
1374 float scale_x, scale_y;
1380 &IID_IDWriteFactory2, (
IUnknown **)&dwrite_factory)))
1382 ERR(
"Failed to create dwrite factory, hr %#lx.\n",
hr);
1388 scale_x =
context->desc.dpiX / 96.0f;
1393 scale_y =
context->desc.dpiY / 96.0f;
1398 hr = IDWriteFactory2_CreateGlyphRunAnalysis(dwrite_factory, glyph_run, (
DWRITE_MATRIX *)&
m,
1400 baseline_origin.
x, baseline_origin.
y, &analysis);
1401 IDWriteFactory2_Release(dwrite_factory);
1404 ERR(
"Failed to create glyph run analysis, hr %#lx.\n",
hr);
1413 if (
FAILED(
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, texture_type, &bounds)))
1415 ERR(
"Failed to get alpha texture bounds, hr %#lx.\n",
hr);
1427 bitmap_size.
width *= 3;
1430 ERR(
"Failed to allocate opacity values.\n");
1433 opacity_values_size = bitmap_size.
height * bitmap_size.
width;
1435 if (
FAILED(
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis,
1436 texture_type, &bounds, opacity_values, opacity_values_size)))
1438 ERR(
"Failed to create alpha texture, hr %#lx.\n",
hr);
1446 bitmap_desc.
dpiX *= 3.0f;
1449 bitmap_size, opacity_values, bitmap_size.
width, &bitmap_desc, &opacity_bitmap)))
1451 ERR(
"Failed to create opacity bitmap, hr %#lx.\n",
hr);
1466 opacity_bitmap,
NULL, &brush_desc, &opacity_brush)))
1468 ERR(
"Failed to create opacity bitmap brush, hr %#lx.\n",
hr);
1472 if (
FAILED(
hr = ID2D1Factory_CreateRectangleGeometry(
context->factory, &run_rect, &geometry)))
1474 ERR(
"Failed to create geometry, hr %#lx.\n",
hr);
1486 ID2D1RectangleGeometry_Release(geometry);
1488 ID2D1BitmapBrush_Release(opacity_brush);
1490 ID2D1Bitmap_Release(opacity_bitmap);
1491 free(opacity_values);
1492 IDWriteGlyphRunAnalysis_Release(analysis);
1510 glyph_run_desc,
brush, measuring_mode);
1514 rendering_params =
context->text_rendering_params ?
context->text_rendering_params
1515 :
context->default_text_rendering_params;
1517 rendering_mode = IDWriteRenderingParams_GetRenderingMode(rendering_params);
1519 switch (
context->drawing_state.textAntialiasMode)
1548 switch (
context->drawing_state.textAntialiasMode)
1551 if (IDWriteRenderingParams_GetClearTypeLevel(rendering_params) > 0.0f)
1552 antialias_mode = DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE;
1556 antialias_mode = DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE;
1571 measuring_mode, rendering_params, &rendering_mode)))
1573 ERR(
"Failed to get recommended rendering mode, hr %#lx.\n",
hr);
1582 rendering_mode, measuring_mode, antialias_mode);
1591 TRACE(
"iface %p, baseline_origin %s, glyph_run %p, brush %p, measuring_mode %#x.\n",
1625 TRACE(
"iface %p, antialias_mode %#x stub!\n", iface, antialias_mode);
1630 context->drawing_state.antialiasMode = antialias_mode;
1637 TRACE(
"iface %p.\n", iface);
1647 TRACE(
"iface %p, antialias_mode %#x.\n", iface, antialias_mode);
1652 context->drawing_state.textAntialiasMode = antialias_mode;
1659 TRACE(
"iface %p.\n", iface);
1676 if (
context->text_rendering_params)
1677 IDWriteRenderingParams_Release(
context->text_rendering_params);
1701 context->drawing_state.tag1 = tag1;
1702 context->drawing_state.tag2 = tag2;
1709 TRACE(
"iface %p, tag1 %p, tag2 %p.\n", iface, tag1, tag2);
1720 FIXME(
"iface %p, layer_parameters %p, layer %p stub!\n", iface, layer_parameters,
layer);
1736 FIXME(
"iface %p stub!\n", iface);
1746 FIXME(
"iface %p, tag1 %p, tag2 %p stub!\n", iface, tag1, tag2);
1760 TRACE(
"iface %p, state_block %p.\n", iface, state_block);
1777 TRACE(
"iface %p, state_block %p.\n", iface, state_block);
1797 if (
context->text_rendering_params)
1798 IDWriteRenderingParams_Release(
context->text_rendering_params);
1807 float x_scale, y_scale;
1810 TRACE(
"iface %p, clip_rect %s, antialias_mode %#x.\n", iface,
debug_d2d_rect_f(clip_rect), antialias_mode);
1816 FIXME(
"Ignoring antialias_mode %#x.\n", antialias_mode);
1818 x_scale =
context->desc.dpiX / 96.0f;
1819 y_scale =
context->desc.dpiY / 96.0f;
1821 clip_rect->
left * x_scale, clip_rect->
top * y_scale);
1824 clip_rect->
left * x_scale, clip_rect->
bottom * y_scale);
1827 clip_rect->
right * x_scale, clip_rect->
top * y_scale);
1830 clip_rect->
right * x_scale, clip_rect->
bottom * y_scale);
1834 WARN(
"Failed to push clip rect.\n");
1841 TRACE(
"iface %p.\n", iface);
1853 ID3D11DeviceContext *d3d_context;
1859 TRACE(
"iface %p, colour %p.\n", iface, colour);
1867 ID3D11Device1_GetImmediateContext(
context->d3d_device, &d3d_context);
1869 if (
FAILED(
hr = ID3D11DeviceContext_Map(d3d_context, (ID3D11Resource *)
context->vs_cb,
1872 WARN(
"Failed to map vs constant buffer, hr %#lx.\n",
hr);
1873 ID3D11DeviceContext_Release(d3d_context);
1877 vs_cb_data = map_desc.
pData;
1895 ID3D11DeviceContext_Unmap(d3d_context, (ID3D11Resource *)
context->vs_cb, 0);
1897 if (
FAILED(
hr = ID3D11DeviceContext_Map(d3d_context, (ID3D11Resource *)
context->ps_cb,
1900 WARN(
"Failed to map ps constant buffer, hr %#lx.\n",
hr);
1901 ID3D11DeviceContext_Release(d3d_context);
1905 ps_cb_data = map_desc.
pData;
1906 memset(ps_cb_data, 0,
sizeof(*ps_cb_data));
1913 if (
context->desc.pixelFormat.alphaMode == D2D1_ALPHA_MODE_IGNORE)
1919 ID3D11DeviceContext_Unmap(d3d_context, (ID3D11Resource *)
context->ps_cb, 0);
1920 ID3D11DeviceContext_Release(d3d_context);
1930 TRACE(
"iface %p.\n", iface);
1944 TRACE(
"iface %p, tag1 %p, tag2 %p.\n", iface, tag1, tag2);
1948 FIXME(
"Unimplemented for command list target.\n");
1981 TRACE(
"iface %p, dpi_x %.8e, dpi_y %.8e.\n", iface, dpi_x, dpi_y);
1983 if (dpi_x == 0.0f && dpi_y == 0.0f)
1988 else if (dpi_x <= 0.0f || dpi_y <= 0.0f)
1999 TRACE(
"iface %p, dpi_x %p, dpi_y %p.\n", iface, dpi_x, dpi_y);
2009 TRACE(
"iface %p, size %p.\n", iface,
size);
2029 TRACE(
"iface %p.\n", iface);
2037 FIXME(
"iface %p, desc %p stub!\n", iface,
desc);
2050 TRACE(
"iface %p, size {%u, %u}, src_data %p, pitch %u, desc %p, bitmap %p.\n",
2054 *
bitmap = &
object->ID2D1Bitmap1_iface;
2067 TRACE(
"iface %p, bitmap_source %p, desc %p, bitmap %p.\n", iface, bitmap_source,
desc,
bitmap);
2070 *
bitmap = &
object->ID2D1Bitmap1_iface;
2078 FIXME(
"iface %p, space %#x, profile %p, profile_size %u, color_context %p stub!\n",
2095 FIXME(
"iface %p, wic_color_context %p, color_context %p stub!\n", iface, wic_color_context, color_context);
2145 unsigned int surface_options;
2157 WARN(
"Incompatible bitmap options %#x, surface options %#x.\n",
2158 desc->bitmapOptions, surface_options);
2168 WARN(
"Failed to get surface desc, hr %#lx.\n",
hr);
2172 memset(&bitmap_desc, 0,
sizeof(bitmap_desc));
2176 desc = &bitmap_desc;
2180 *
bitmap = &
object->ID2D1Bitmap1_iface;
2201 FIXME(
"iface %p, stops %p, stop_count %u, preinterpolation_space %#x, postinterpolation_space %#x, "
2202 "buffer_precision %#x, extend_mode %#x, color_interpolation_mode %#x, gradient %p stub!\n",
2203 iface, stops, stop_count, preinterpolation_space, postinterpolation_space,
2204 buffer_precision, extend_mode, color_interpolation_mode, gradient);
2217 TRACE(
"iface %p, image %p, image_brush_desc %p, brush_desc %p, brush %p.\n", iface,
image, image_brush_desc,
2221 brush_desc, &
object)))
2235 TRACE(
"iface %p, bitmap %p, bitmap_brush_desc %p, brush_desc %p, brush %p.\n", iface,
bitmap, bitmap_brush_desc,
2251 TRACE(
"iface %p, command_list %p.\n", iface, command_list);
2254 *command_list = &
object->ID2D1CommandList_iface;
2261 FIXME(
"iface %p, format %#x stub!\n", iface,
format);
2274 TRACE(
"iface %p, buffer_precision %u.\n", iface, buffer_precision);
2276 switch (buffer_precision)
2284 WARN(
"Unexpected precision %u.\n", buffer_precision);
2290 WARN(
"Format support check failed, hr %#lx.\n",
hr);
2293 return !!(support & D3D11_FORMAT_SUPPORT_BUFFER);
2304 TRACE(
"iface %p, image %p, local_bounds %p.\n", iface,
image, local_bounds);
2308 local_bounds->
left = 0.0f;
2309 local_bounds->
top = 0.0f;
2310 switch (
context->drawing_state.unitMode)
2325 WARN(
"Unknown unit mode %#x.\n",
context->drawing_state.unitMode);
2328 ID2D1Bitmap_Release(
bitmap);
2334 FIXME(
"Unable to get local bounds of image %p.\n",
image);
2343 FIXME(
"iface %p, image %p, world_bounds %p stub!\n", iface,
image, world_bounds);
2352 FIXME(
"iface %p, baseline_origin %s, glyph_run %p, measuring_mode %#x, bounds %p stub!\n",
2365 ID2D1Device_AddRef(*
device);
2373 IUnknown_Release(
context->target.object);
2381 ID3D11BlendState_Release(
context->bs);
2391 D3D11_BLEND_DESC blend_desc;
2409 ID2D1Bitmap_Release(
bitmap);
2419 context->target.bitmap = bitmap_impl;
2423 memset(&blend_desc, 0,
sizeof(blend_desc));
2424 blend_desc.IndependentBlendEnable =
FALSE;
2425 blend_desc.RenderTarget[0].BlendEnable =
TRUE;
2432 blend_desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
2434 WARN(
"Failed to create blend state, hr %#lx.\n",
hr);
2436 else if (
SUCCEEDED(ID2D1Image_QueryInterface(
target, &IID_ID2D1CommandList, (
void **)&command_list)))
2442 context->target.command_list = command_list_impl;
2448 WARN(
"Unsupported target type.\n");
2460 ID2D1Image_AddRef(*
target);
2466 FIXME(
"iface %p, rendering_controls %p stub!\n", iface, rendering_controls);
2472 FIXME(
"iface %p, rendering_controls %p stub!\n", iface, rendering_controls);
2480 TRACE(
"iface %p, primitive_blend %u.\n", iface, primitive_blend);
2484 WARN(
"Unknown blend mode %u.\n", primitive_blend);
2491 context->drawing_state.primitiveBlend = primitive_blend;
2498 TRACE(
"iface %p.\n", iface);
2500 return context->drawing_state.primitiveBlend;
2507 TRACE(
"iface %p, unit_mode %#x.\n", iface, unit_mode);
2511 WARN(
"Unknown unit mode %#x.\n", unit_mode);
2518 context->drawing_state.unitMode = unit_mode;
2525 TRACE(
"iface %p.\n", iface);
2527 return context->drawing_state.unitMode;
2536 TRACE(
"iface %p, baseline_origin %s, glyph_run %p, glyph_run_desc %p, brush %p, measuring_mode %#x.\n",
2537 iface,
debug_d2d_point_2f(&baseline_origin), glyph_run, glyph_run_desc, brush, measuring_mode);
2549 TRACE(
"iface %p, image %p, target_offset %s, image_rect %s, interpolation_mode %#x, composite_mode %#x.\n",
2551 interpolation_mode, composite_mode);
2556 interpolation_mode, composite_mode);
2561 FIXME(
"Unhandled composite mode %#x.\n", composite_mode);
2567 ID2D1Bitmap_Release(
bitmap);
2577 FIXME(
"iface %p, metafile %p, target_offset %s stub!\n",
2587 TRACE(
"iface %p, bitmap %p, dst_rect %s, opacity %.8e, interpolation_mode %#x, "
2588 "src_rect %s, perspective_transform %p.\n",
2595 src_rect, perspective_transform);
2600 NULL, perspective_transform);
2609 FIXME(
"iface %p, layer_parameters %p, layer %p stub!\n", iface, layer_parameters,
layer);
2618 FIXME(
"iface %p, effect %p, input %u, input_rect %s stub!\n",
2627 FIXME(
"iface %p, effect %p, rect_count %p stub!\n", iface, effect, rect_count);
2635 FIXME(
"iface %p, effect %p, rectangles %p, rect_count %u stub!\n", iface, effect,
rectangles, rect_count);
2644 FIXME(
"iface %p, effect %p, image_rect %s, desc %p, input_rect %p, input_count %u stub!\n",
2655 FIXME(
"iface %p, mask %p, brush %p, dst_rect %s, src_rect %s stub!\n",
2674 FIXME(
"iface %p, geometry %p, tolerance %.8e, realization %p stub!\n", iface, geometry, tolerance,
2684 FIXME(
"iface %p, geometry %p, tolerance %.8e, stroke_width %.8e, stroke_style %p, realization %p stub!\n",
2685 iface, geometry, tolerance, stroke_width, stroke_style, realization);
2693 FIXME(
"iface %p, realization %p, brush %p stub!\n", iface, realization, brush);
2699 FIXME(
"iface %p, start_point %p, ink %p stub!\n", iface, start_point, ink);
2707 FIXME(
"iface %p, ink_style_properties %p, ink_style %p stub!\n", iface, ink_style_properties, ink_style);
2716 FIXME(
"iface %p, patches %p, patches_count %u, gradient_mesh %p stub!\n", iface, patches,
2717 patches_count, gradient_mesh);
2726 FIXME(
"iface %p, wic_bitmap_source %p, loading_options %#x, alpha_mode %u, image_source %p stub!\n",
2727 iface, wic_bitmap_source, loading_options, alpha_mode, image_source);
2736 FIXME(
"iface %p, precision %u, extents %p, data %p, data_count %u, strides %p, lookup_table %p stub!\n",
2737 iface,
precision, extents,
data, data_count, strides, lookup_table);
2746 FIXME(
"iface %p, surfaces %p, surface_count %u, color_space %u, options %#x, image_source %p stub!\n",
2755 FIXME(
"iface %p, gradient_mesh %p, bounds %p stub!\n", iface, gradient_mesh, bounds);
2763 FIXME(
"iface %p, ink %p, brush %p, ink_style %p stub!\n", iface, ink, brush, ink_style);
2769 FIXME(
"iface %p, gradient_mesh %p stub!\n", iface, gradient_mesh);
2776 FIXME(
"iface %p, gdi_metafile %p, dst_rect %s, src_rect %s stub!\n", iface, gdi_metafile,
2784 FIXME(
"iface %p, source %p, props %p, transformed %p stub!\n", iface,
source,
props, transformed);
2792 FIXME(
"iface %p, sprite_batch %p stub!\n", iface, sprite_batch);
2801 FIXME(
"iface %p, sprite_batch %p, start_index %u, sprite_count %u, bitmap %p, interpolation_mode %u,"
2802 "sprite_options %u stub!\n", iface, sprite_batch, start_index, sprite_count,
bitmap,
2803 interpolation_mode, sprite_options);
2809 FIXME(
"iface %p, svg_glyph_style %p stub!\n", iface, svg_glyph_style);
2819 FIXME(
"iface %p, string %s, string_length %u, text_format %p, layout_rect %s, default_fill_brush %p,"
2820 "svg_glyph_style %p, color_palette_index %u, options %#x, measuring_mode %u stub!\n",
2822 default_fill_brush, svg_glyph_style, color_palette_index,
options, measuring_mode);
2829 FIXME(
"iface %p, origin %s, text_layout %p, default_fill_brush %p, svg_glyph_style %p, color_palette_index %u,"
2831 svg_glyph_style, color_palette_index,
options);
2838 FIXME(
"iface %p, glyph_image_format %#x, baseline_origin %s, glyph_run %p, measuring_mode %u, bitmap_snap_option %#x stub!\n",
2839 iface, glyph_image_format,
debug_d2d_point_2f(&baseline_origin), glyph_run, measuring_mode, bitmap_snap_option);
2846 FIXME(
"iface %p, baseline_origin %s, glyph_run %p, default_fill_brush %p, svg_glyph_style %p,"
2847 "color_palette_index %u, measuring_mode %u stub!\n", iface,
debug_d2d_point_2f(&baseline_origin),
2848 glyph_run, default_fill_brush, svg_glyph_style, color_palette_index, measuring_mode);
2856 FIXME(
"iface %p, glyph_image_format %u, glyph_origin %s, font_face %p, font_em_size %f, glyph_index %u,"
2857 "is_sideways %d, world_transform %p, dpi_x %f, dpi_y %f, glyph_transform %p, glyph_image %p stub!\n",
2858 iface, glyph_image_format,
debug_d2d_point_2f(&glyph_origin), font_face, font_em_size, glyph_index,
2859 is_sideways, world_transform, dpi_x, dpi_y, glyph_transform, glyph_image);
2870 FIXME(
"iface %p, glyph_origin %s, font_face %p, font_em_size %f, glyph_index %u, is_sideways %d,"
2871 "world_transform %p, default_fill_brush %p, svg_glyph_style %p, color_palette_index %u,"
2872 "glyph_transform %p, glyph_image %p stub!\n", iface,
debug_d2d_point_2f(&glyph_origin),
2873 font_face, font_em_size, glyph_index, is_sideways, world_transform, default_fill_brush,
2874 svg_glyph_style, color_palette_index, glyph_transform, glyph_image);
2880 IStream *input_xml_stream,
D2D1_SIZE_F viewport_size, ID2D1SvgDocument **svg_document)
2882 FIXME(
"iface %p, input_xml_stream %p, svg_document %p stub!\n", iface, input_xml_stream,
2889 ID2D1SvgDocument *svg_document)
2891 FIXME(
"iface %p, svg_document %p stub!\n", iface, svg_document);
2897 FIXME(
"iface %p, color_space %u, color_context %p stub!\n", iface, color_space, color_context);
2905 FIXME(
"iface %p, simple_profile %p, color_context %p stub!\n", iface, simple_profile, color_context);
2914 FIXME(
"iface %p, image %p, blend_mode %u, target_offset %s, image_rect %s, interpolation_mode %u stub!\n",
2916 interpolation_mode);
3056 IDWriteTextRenderer_AddRef(iface);
3071 TRACE(
"iface %p.\n", iface);
3080 TRACE(
"iface %p.\n", iface);
3090 TRACE(
"iface %p, ctx %p, disabled %p.\n", iface,
ctx, disabled);
3113 TRACE(
"iface %p, ctx %p, ppd %p.\n", iface,
ctx, ppd);
3115 *ppd = render_target->
desc.
dpiY / 96.0f;
3125 D2D1_POINT_2F baseline_origin = {baseline_origin_x, baseline_origin_y};
3130 TRACE(
"iface %p, ctx %p, baseline_origin_x %.8e, baseline_origin_y %.8e, "
3131 "measuring_mode %#x, glyph_run %p, glyph_run_desc %p, effect %p.\n",
3132 iface,
ctx, baseline_origin_x, baseline_origin_y,
3133 measuring_mode, glyph_run, glyph_run_desc, effect);
3147 &IID_IDWriteFontFace2, (
void **)&fontface)))
3149 color_font = IDWriteFontFace2_IsColorFont(fontface);
3150 IDWriteFontFace2_Release(fontface);
3163 ERR(
"Failed to create dwrite factory, hr %#lx.\n",
hr);
3164 ID2D1Brush_Release(
brush);
3168 hr = IDWriteFactory2_TranslateColorGlyphRun(dwrite_factory, baseline_origin_x, baseline_origin_y,
3170 IDWriteFactory2_Release(dwrite_factory);
3173 ERR(
"Failed to create colour glyph run enumerator, hr %#lx.\n",
hr);
3174 ID2D1Brush_Release(
brush);
3185 if (
FAILED(
hr = IDWriteColorGlyphRunEnumerator_MoveNext(layers, &has_run)))
3187 ERR(
"Failed to switch colour glyph layer, hr %#lx.\n",
hr);
3194 if (
FAILED(
hr = IDWriteColorGlyphRunEnumerator_GetCurrentRun(layers, &color_run)))
3196 ERR(
"Failed to get current colour run, hr %#lx.\n",
hr);
3201 color_brush =
brush;
3207 ERR(
"Failed to create solid colour brush, hr %#lx.\n",
hr);
3217 if (color_brush !=
brush)
3218 ID2D1Brush_Release(color_brush);
3221 IDWriteColorGlyphRunEnumerator_Release(layers);
3225 brush, measuring_mode);
3227 ID2D1Brush_Release(
brush);
3243 TRACE(
"iface %p, ctx %p, baseline_origin_x %.8e, baseline_origin_y %.8e, underline %p, effect %p\n",
3244 iface,
ctx, baseline_origin_x, baseline_origin_y, underline, effect);
3252 start.x = baseline_origin_x;
3253 start.y = baseline_origin_y + underline->
offset + thickness / 2.0f;
3260 ID2D1Brush_Release(
brush);
3276 TRACE(
"iface %p, ctx %p, baseline_origin_x %.8e, baseline_origin_y %.8e, strikethrough %p, effect %p.\n",
3277 iface,
ctx, baseline_origin_x, baseline_origin_y, strikethrough, effect);
3285 start.x = baseline_origin_x;
3286 start.y = baseline_origin_y + strikethrough->
offset + thickness / 2.0f;
3293 ID2D1Brush_Release(
brush);
3305 TRACE(
"iface %p, ctx %p, origin_x %.8e, origin_y %.8e, object %p, is_sideways %#x, is_rtl %#x, effect %p.\n",
3306 iface,
ctx, origin_x, origin_y,
object, is_sideways,
is_rtl, effect);
3315 hr = IDWriteInlineObject_Draw(
object,
ctx, iface, origin_x, origin_y, is_sideways,
is_rtl, effect);
3317 ID2D1Brush_Release(
context->brush);
3356 TRACE(
"iface %p.\n", iface);
3365 TRACE(
"iface %p.\n", iface);
3377 FIXME(
"Unimplemented for target type %u.\n",
context->target.type);
3384 ID3D11RenderTargetView_GetResource(
context->target.bitmap->rtv, &
resource);
3385 hr = ID3D11Resource_QueryInterface(
resource, &IID_IDXGISurface1, (
void **)surface);
3390 WARN(
"Failed to get DXGI surface, %#lx.\n",
hr);
3404 TRACE(
"iface %p, mode %d, dc %p.\n", iface,
mode,
dc);
3408 if (render_target->
target.hdc)
3415 IDXGISurface1_Release(surface);
3433 if (!render_target->
target.hdc)
3441 update_rect = *update;
3442 hr = IDXGISurface1_ReleaseDC(surface, update ? &update_rect :
NULL);
3443 IDXGISurface1_Release(surface);
3460 D3D11_SUBRESOURCE_DATA buffer_data;
3463 D3D11_BUFFER_DESC buffer_desc;
3493 static const char vs_code_outline[] =
3494 "float3x2 transform_geometry;\n"
3495 "float stroke_width;\n"
3496 "float4 transform_rtx;\n"
3497 "float4 transform_rty;\n"
3501 " float2 p : WORLD_POSITION;\n"
3502 " float4 b : BEZIER;\n"
3503 " nointerpolation float2x2 stroke_transform : STROKE_TRANSFORM;\n"
3504 " float4 position : SV_POSITION;\n"
3507 "/* The lines PₚᵣₑᵥP₀ and P₀Pₙₑₓₜ, both offset by ±½w, intersect each other at:\n"
3509 " * Pᵢ = P₀ ± w · ½q⃑ᵢ.\n"
3513 " * q⃑ᵢ = q̂ₚᵣₑᵥ⊥ + tan(½θ) · -q̂ₚᵣₑᵥ\n"
3514 " * θ = ∠PₚᵣₑᵥP₀Pₙₑₓₜ\n"
3515 " * q⃑ₚᵣₑᵥ = P₀ - Pₚᵣₑᵥ */\n"
3516 "void main(float2 position : POSITION, float2 prev : PREV, float2 next : NEXT, out struct output o)\n"
3518 " float2 q_prev, q_next, v_p, q_i;\n"
3522 " o.stroke_transform = float2x2(transform_rtx.xy, transform_rty.xy) * stroke_width * 0.5f;\n"
3524 " geom = float2x2(transform_geometry._11_21, transform_geometry._12_22);\n"
3525 " q_prev = normalize(mul(geom, prev));\n"
3526 " q_next = normalize(mul(geom, next));\n"
3528 " /* tan(½θ) = sin(θ) / (1 + cos(θ))\n"
3529 " * = (q̂ₚᵣₑᵥ⊥ · q̂ₙₑₓₜ) / (1 + (q̂ₚᵣₑᵥ · q̂ₙₑₓₜ)) */\n"
3530 " v_p = float2(-q_prev.y, q_prev.x);\n"
3531 " l = -dot(v_p, q_next) / (1.0f + dot(q_prev, q_next));\n"
3532 " q_i = l * q_prev + v_p;\n"
3534 " o.b = float4(0.0, 0.0, 0.0, 0.0);\n"
3536 " o.p = mul(float3(position, 1.0f), transform_geometry) + stroke_width * 0.5f * q_i;\n"
3537 " position = mul(float2x3(transform_rtx.xyz, transform_rty.xyz), float3(o.p, 1.0f))\n"
3538 " * float2(transform_rtx.w, transform_rty.w);\n"
3539 " o.position = float4(position + float2(-1.0f, 1.0f), 0.0f, 1.0f);\n"
3558 static const char vs_code_bezier_outline[] =
3559 "float3x2 transform_geometry;\n"
3560 "float stroke_width;\n"
3561 "float4 transform_rtx;\n"
3562 "float4 transform_rty;\n"
3566 " float2 p : WORLD_POSITION;\n"
3567 " float4 b : BEZIER;\n"
3568 " nointerpolation float2x2 stroke_transform : STROKE_TRANSFORM;\n"
3569 " float4 position : SV_POSITION;\n"
3572 "void main(float2 position : POSITION, float2 p0 : P0, float2 p1 : P1, float2 p2 : P2,\n"
3573 " float2 prev : PREV, float2 next : NEXT, out struct output o)\n"
3575 " float2 q_prev, q_next, v_p, q_i, p;\n"
3576 " float2x2 geom, rt;\n"
3579 " geom = float2x2(transform_geometry._11_21, transform_geometry._12_22);\n"
3580 " rt = float2x2(transform_rtx.xy, transform_rty.xy);\n"
3581 " o.stroke_transform = rt * stroke_width * 0.5f;\n"
3583 " p = mul(geom, position);\n"
3584 " p0 = mul(geom, p0);\n"
3585 " p1 = mul(geom, p1);\n"
3586 " p2 = mul(geom, p2);\n"
3592 " q_prev = normalize(mul(geom, prev));\n"
3593 " q_next = normalize(mul(geom, next));\n"
3595 " v_p = float2(-q_prev.y, q_prev.x);\n"
3596 " l = -dot(v_p, q_next) / (1.0f + dot(q_prev, q_next));\n"
3597 " q_i = l * q_prev + v_p;\n"
3598 " p += 0.5f * stroke_width * q_i;\n"
3600 " v_p = mul(rt, p2);\n"
3601 " v_p = normalize(float2(-v_p.y, v_p.x));\n"
3602 " if (abs(dot(mul(rt, p1), v_p)) < 1.0f)\n"
3604 " o.b.xzw = float3(0.0f, 0.0f, 0.0f);\n"
3605 " o.b.y = dot(mul(rt, p), v_p);\n"
3609 " o.b.zw = sign(dot(mul(rt, p1), v_p)) * v_p;\n"
3610 " v_p = -float2(-p.y, p.x) / dot(float2(-p1.y, p1.x), p2);\n"
3611 " o.b.x = dot(v_p, p1 - 0.5f * p2);\n"
3612 " o.b.y = dot(v_p, p1);\n"
3615 " o.p = mul(float3(position, 1.0f), transform_geometry) + 0.5f * stroke_width * q_i;\n"
3616 " position = mul(float2x3(transform_rtx.xyz, transform_rty.xyz), float3(o.p, 1.0f))\n"
3617 " * float2(transform_rtx.w, transform_rty.w);\n"
3618 " o.position = float4(position + float2(-1.0f, 1.0f), 0.0f, 1.0f);\n"
3637 static const char vs_code_arc_outline[] =
3638 "float3x2 transform_geometry;\n"
3639 "float stroke_width;\n"
3640 "float4 transform_rtx;\n"
3641 "float4 transform_rty;\n"
3645 " float2 p : WORLD_POSITION;\n"
3646 " float4 b : BEZIER;\n"
3647 " nointerpolation float2x2 stroke_transform : STROKE_TRANSFORM;\n"
3648 " float4 position : SV_POSITION;\n"
3651 "void main(float2 position : POSITION, float2 p0 : P0, float2 p1 : P1, float2 p2 : P2,\n"
3652 " float2 prev : PREV, float2 next : NEXT, out struct output o)\n"
3654 " float2 q_prev, q_next, v_p, q_i, p;\n"
3655 " float2x2 geom, rt, p_inv;\n"
3660 " geom = float2x2(transform_geometry._11_21, transform_geometry._12_22);\n"
3661 " rt = float2x2(transform_rtx.xy, transform_rty.xy);\n"
3662 " o.stroke_transform = rt * stroke_width * 0.5f;\n"
3664 " p = mul(geom, position);\n"
3665 " p0 = mul(geom, p0);\n"
3666 " p1 = mul(geom, p1);\n"
3667 " p2 = mul(geom, p2);\n"
3673 " q_prev = normalize(mul(geom, prev));\n"
3674 " q_next = normalize(mul(geom, next));\n"
3676 " v_p = float2(-q_prev.y, q_prev.x);\n"
3677 " l = -dot(v_p, q_next) / (1.0f + dot(q_prev, q_next));\n"
3678 " q_i = l * q_prev + v_p;\n"
3679 " p += 0.5f * stroke_width * q_i;\n"
3681 " p_inv = float2x2(p1.y, -p1.x, p2.y - p1.y, p1.x - p2.x) / (p1.x * p2.y - p2.x * p1.y);\n"
3682 " o.b.xy = mul(p_inv, p) + float2(1.0f, 0.0f);\n"
3685 " o.p = mul(float3(position, 1.0f), transform_geometry) + 0.5f * stroke_width * q_i;\n"
3686 " position = mul(float2x3(transform_rtx.xyz, transform_rty.xyz), float3(o.p, 1.0f))\n"
3687 " * float2(transform_rtx.w, transform_rty.w);\n"
3688 " o.position = float4(position + float2(-1.0f, 1.0f), 0.0f, 1.0f);\n"
3690 static const char vs_code_triangle[] =
3691 "float3x2 transform_geometry;\n"
3692 "float4 transform_rtx;\n"
3693 "float4 transform_rty;\n"
3697 " float2 p : WORLD_POSITION;\n"
3698 " float4 b : BEZIER;\n"
3699 " nointerpolation float2x2 stroke_transform : STROKE_TRANSFORM;\n"
3700 " float4 position : SV_POSITION;\n"
3703 "void main(float2 position : POSITION, out struct output o)\n"
3705 " o.p = mul(float3(position, 1.0f), transform_geometry);\n"
3706 " o.b = float4(1.0, 0.0, 1.0, 1.0);\n"
3707 " o.stroke_transform = float2x2(1.0, 0.0, 0.0, 1.0);\n"
3708 " position = mul(float2x3(transform_rtx.xyz, transform_rty.xyz), float3(o.p, 1.0f))\n"
3709 " * float2(transform_rtx.w, transform_rty.w);\n"
3710 " o.position = float4(position + float2(-1.0f, 1.0f), 0.0f, 1.0f);\n"
3712 static const char vs_code_curve[] =
3713 "float3x2 transform_geometry;\n"
3714 "float4 transform_rtx;\n"
3715 "float4 transform_rty;\n"
3719 " float2 p : WORLD_POSITION;\n"
3720 " float4 b : BEZIER;\n"
3721 " nointerpolation float2x2 stroke_transform : STROKE_TRANSFORM;\n"
3722 " float4 position : SV_POSITION;\n"
3725 "void main(float2 position : POSITION, float3 texcoord : TEXCOORD0, out struct output o)\n"
3727 " o.p = mul(float3(position, 1.0f), transform_geometry);\n"
3728 " o.b = float4(texcoord, 1.0);\n"
3729 " o.stroke_transform = float2x2(1.0, 0.0, 0.0, 1.0);\n"
3730 " position = mul(float2x3(transform_rtx.xyz, transform_rty.xyz), float3(o.p, 1.0f))\n"
3731 " * float2(transform_rtx.w, transform_rty.w);\n"
3732 " o.position = float4(position + float2(-1.0f, 1.0f), 0.0f, 1.0f);\n"
3734 static const char ps_code[] =
3735 "#define BRUSH_TYPE_SOLID 0\n"
3736 "#define BRUSH_TYPE_LINEAR 1\n"
3737 "#define BRUSH_TYPE_RADIAL 2\n"
3738 "#define BRUSH_TYPE_BITMAP 3\n"
3739 "#define BRUSH_TYPE_COUNT 4\n"
3747 " float4 data[3];\n"
3748 "} colour_brush, opacity_brush;\n"
3750 "SamplerState s0, s1;\n"
3751 "Texture2D t0, t1;\n"
3752 "Buffer<float4> b0, b1;\n"
3756 " float2 p : WORLD_POSITION;\n"
3757 " float4 b : BEZIER;\n"
3758 " nointerpolation float2x2 stroke_transform : STROKE_TRANSFORM;\n"
3761 "float4 sample_gradient(Buffer<float4> gradient, uint stop_count, float position)\n"
3763 " float4 c_low, c_high;\n"
3764 " float p_low, p_high;\n"
3767 " p_low = gradient.Load(0).x;\n"
3768 " c_low = gradient.Load(1);\n"
3769 " c_high = c_low;\n"
3771 " if (position < p_low)\n"
3774 " for (i = 1; i < stop_count; ++i)\n"
3776 " p_high = gradient.Load(i * 2).x;\n"
3777 " c_high = gradient.Load(i * 2 + 1);\n"
3779 " if (position >= p_low && position <= p_high)\n"
3780 " return lerp(c_low, c_high, (position - p_low) / (p_high - p_low));\n"
3782 " p_low = p_high;\n"
3783 " c_low = c_high;\n"
3789 "float4 brush_linear(struct brush brush, Buffer<float4> gradient, float2 position)\n"
3791 " float2 start, end, v_p, v_q;\n"
3792 " uint stop_count;\n"
3795 " start = brush.data[0].xy;\n"
3796 " end = brush.data[0].zw;\n"
3797 " stop_count = asuint(brush.data[1].x);\n"
3799 " v_p = position - start;\n"
3800 " v_q = end - start;\n"
3801 " p = dot(v_q, v_p) / dot(v_q, v_q);\n"
3803 " return sample_gradient(gradient, stop_count, p);\n"
3806 "float4 brush_radial(struct brush brush, Buffer<float4> gradient, float2 position)\n"
3808 " float2 centre, offset, ra, rb, v_p, v_q, r;\n"
3809 " float b, c, l, t;\n"
3810 " uint stop_count;\n"
3812 " centre = brush.data[0].xy;\n"
3813 " offset = brush.data[0].zw;\n"
3814 " ra = brush.data[1].xy;\n"
3815 " rb = brush.data[1].zw;\n"
3816 " stop_count = asuint(brush.data[2].x);\n"
3818 " /* Project onto ra, rb. */\n"
3819 " r = float2(dot(ra, ra), dot(rb, rb));\n"
3820 " v_p = position - (centre + offset);\n"
3821 " v_p = float2(dot(v_p, ra), dot(v_p, rb)) / r;\n"
3822 " v_q = float2(dot(offset, ra), dot(offset, rb)) / r;\n"
3824 " /* ‖t·p̂ + q⃑‖ = 1\n"
3825 " * (t·p̂ + q⃑) · (t·p̂ + q⃑) = 1\n"
3826 " * t² + 2·(p̂·q⃑)·t + (q⃑·q⃑) = 1\n"
3829 " * c = q⃑·q⃑ - 1\n"
3830 " * t = -b + √(b² - c) */\n"
3831 " l = length(v_p);\n"
3832 " b = dot(v_p, v_q) / l;\n"
3833 " c = dot(v_q, v_q) - 1.0;\n"
3834 " t = -b + sqrt(b * b - c);\n"
3836 " return sample_gradient(gradient, stop_count, l / t);\n"
3839 "float4 brush_bitmap(struct brush brush, Texture2D t, SamplerState s, float2 position)\n"
3841 " float3 transform[2];\n"
3842 " bool ignore_alpha;\n"
3843 " float2 texcoord;\n"
3846 " transform[0] = brush.data[0].xyz;\n"
3847 " transform[1] = brush.data[1].xyz;\n"
3848 " ignore_alpha = asuint(brush.data[1].w);\n"
3850 " texcoord.x = dot(position.xy, transform[0].xy) + transform[0].z;\n"
3851 " texcoord.y = dot(position.xy, transform[1].xy) + transform[1].z;\n"
3852 " colour = t.Sample(s, texcoord);\n"
3853 " if (ignore_alpha)\n"
3854 " colour.a = 1.0;\n"
3858 "float4 sample_brush(struct brush brush, Texture2D t, SamplerState s, Buffer<float4> b, float2 position)\n"
3860 " if (brush.type == BRUSH_TYPE_SOLID)\n"
3861 " return brush.data[0] * brush.opacity;\n"
3862 " if (brush.type == BRUSH_TYPE_LINEAR)\n"
3863 " return brush_linear(brush, b, position) * brush.opacity;\n"
3864 " if (brush.type == BRUSH_TYPE_RADIAL)\n"
3865 " return brush_radial(brush, b, position) * brush.opacity;\n"
3866 " if (brush.type == BRUSH_TYPE_BITMAP)\n"
3867 " return brush_bitmap(brush, t, s, position) * brush.opacity;\n"
3868 " return float4(0.0, 0.0, 0.0, brush.opacity);\n"
3871 "float4 main(struct input i) : SV_Target\n"
3875 " colour = sample_brush(colour_brush, t0, s0, b0, i.p);\n"
3876 " if (opacity_brush.type < BRUSH_TYPE_COUNT)\n"
3877 " colour *= sample_brush(opacity_brush, t1, s1, b1, i.p).a;\n"
3881 " float2 du, dv, df;\n"
3884 " /* Evaluate the implicit form of the curve (u² - v = 0\n"
3885 " * for Béziers, u² + v² - 1 = 0 for arcs) in texture\n"
3886 " * space, using the screen-space partial derivatives\n"
3887 " * to convert the calculated distance to object space.\n"
3889 " * d(x, y) = |f(x, y)| / ‖∇f(x, y)‖\n"
3890 " * = |f(x, y)| / √((∂f/∂x)² + (∂f/∂y)²)\n"
3893 " * f(x, y) = u(x, y)² - v(x, y)\n"
3894 " * ∂f/∂x = 2u · ∂u/∂x - ∂v/∂x\n"
3895 " * ∂f/∂y = 2u · ∂u/∂y - ∂v/∂y\n"
3898 " * f(x, y) = u(x, y)² + v(x, y)² - 1\n"
3899 " * ∂f/∂x = 2u · ∂u/∂x + 2v · ∂v/∂x\n"
3900 " * ∂f/∂y = 2u · ∂u/∂y + 2v · ∂v/∂y */\n"
3902 " du = float2(ddx(uv.x), ddy(uv.x));\n"
3903 " dv = float2(ddx(uv.y), ddy(uv.y));\n"
3907 " df = 2.0f * uv.x * du - dv;\n"
3909 " clip(dot(df, uv.zw));\n"
3910 " clip(length(mul(i.stroke_transform, df)) - abs(uv.x * uv.x - uv.y));\n"
3914 " df = 2.0f * uv.x * du + 2.0f * uv.y * dv;\n"
3916 " clip(dot(df, uv.zw));\n"
3917 " clip(length(mul(i.stroke_transform, df)) - abs(uv.x * uv.x + uv.y * uv.y - 1.0f));\n"
3922 " /* Evaluate the implicit form of the curve in texture space.\n"
3923 " * \"i.b.z\" determines which side of the curve is shaded. */\n"
3926 " clip((i.b.x * i.b.x - i.b.y) * i.b.z);\n"
3930 " clip((i.b.x * i.b.x + i.b.y * i.b.y - 1.0) * i.b.z);\n"
3936 static const struct shape_info
3940 unsigned int il_element_count;
3942 const char *vs_code;
3943 size_t vs_code_size;
3948 "outline", vs_code_outline,
sizeof(vs_code_outline) - 1},
3950 "bezier_outline", vs_code_bezier_outline,
sizeof(vs_code_bezier_outline) - 1},
3952 "arc_outline", vs_code_arc_outline,
sizeof(vs_code_arc_outline) - 1},
3954 "triangle", vs_code_triangle,
sizeof(vs_code_triangle) - 1},
3956 "curve", vs_code_curve,
sizeof(vs_code_curve) - 1},
3979 ID2D1Device6_AddRef(&render_target->
device->ID2D1Device6_iface);
3986 render_target->
ops = ops;
3989 &IID_ID3D11Device1, (
void **)&render_target->
d3d_device)))
3991 WARN(
"Failed to query ID3D11Device1 interface, hr %#lx.\n",
hr);
3999 WARN(
"Failed to create device context state, hr %#lx.\n",
hr);
4005 const struct shape_info *
si = &shape_info[
i];
4008 "main",
"vs_4_0", 0, 0, &compiled,
NULL)))
4010 WARN(
"Failed to compile shader for shape type %#x, hr %#lx.\n",
si->shape_type,
hr);
4014 if (
FAILED(
hr = ID3D11Device1_CreateInputLayout(render_target->
d3d_device,
si->il_desc,
si->il_element_count,
4015 ID3D10Blob_GetBufferPointer(compiled), ID3D10Blob_GetBufferSize(compiled),
4018 WARN(
"Failed to create input layout for shape type %#x, hr %#lx.\n",
si->shape_type,
hr);
4019 ID3D10Blob_Release(compiled);
4024 ID3D10Blob_GetBufferPointer(compiled), ID3D10Blob_GetBufferSize(compiled),
4027 WARN(
"Failed to create vertex shader for shape type %#x, hr %#lx.\n",
si->shape_type,
hr);
4028 ID3D10Blob_Release(compiled);
4032 ID3D10Blob_Release(compiled);
4035 buffer_desc.ByteWidth =
sizeof(
struct d2d_vs_cb);
4036 buffer_desc.Usage = D3D11_USAGE_DYNAMIC;
4037 buffer_desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
4038 buffer_desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
4039 buffer_desc.MiscFlags = 0;
4042 &render_target->
vs_cb)))
4044 WARN(
"Failed to create constant buffer, hr %#lx.\n",
hr);
4048 if (
FAILED(
hr =
D3DCompile(ps_code,
sizeof(ps_code) - 1,
"ps",
NULL,
NULL,
"main",
"ps_4_0", 0, 0, &compiled,
NULL)))
4050 WARN(
"Failed to compile the pixel shader, hr %#lx.\n",
hr);
4055 ID3D10Blob_GetBufferPointer(compiled), ID3D10Blob_GetBufferSize(compiled),
4056 NULL, &render_target->
ps)))
4058 WARN(
"Failed to create pixel shader, hr %#lx.\n",
hr);
4059 ID3D10Blob_Release(compiled);
4063 ID3D10Blob_Release(compiled);
4065 buffer_desc.ByteWidth =
sizeof(
struct d2d_ps_cb);
4066 buffer_desc.Usage = D3D11_USAGE_DYNAMIC;
4067 buffer_desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
4068 buffer_desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
4069 buffer_desc.MiscFlags = 0;
4072 &render_target->
ps_cb)))
4074 WARN(
"Failed to create constant buffer, hr %#lx.\n",
hr);
4078 buffer_desc.ByteWidth =
sizeof(
indices);
4079 buffer_desc.Usage = D3D11_USAGE_DEFAULT;
4080 buffer_desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
4081 buffer_desc.CPUAccessFlags = 0;
4082 buffer_desc.MiscFlags = 0;
4084 buffer_data.pSysMem =
indices;
4085 buffer_data.SysMemPitch = 0;
4086 buffer_data.SysMemSlicePitch = 0;
4089 &buffer_desc, &buffer_data, &render_target->
ib)))
4091 WARN(
"Failed to create clear index buffer, hr %#lx.\n",
hr);
4095 buffer_desc.ByteWidth =
sizeof(
quad);
4096 buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
4097 buffer_data.pSysMem =
quad;
4099 render_target->
vb_stride =
sizeof(*quad);
4101 &buffer_desc, &buffer_data, &render_target->
vb)))
4103 WARN(
"Failed to create clear vertex buffer, hr %#lx.\n",
hr);
4117 if (
FAILED(
hr = ID3D11Device1_CreateRasterizerState(render_target->
d3d_device, &rs_desc, &render_target->
rs)))
4119 WARN(
"Failed to create clear rasteriser state, hr %#lx.\n",
hr);
4124 &IID_IDWriteFactory, (
IUnknown **)&dwrite_factory)))
4126 ERR(
"Failed to create dwrite factory, hr %#lx.\n",
hr);
4131 IDWriteFactory_Release(dwrite_factory);
4134 ERR(
"Failed to create default text rendering parameters, hr %#lx.\n",
hr);
4142 WARN(
"Failed to initialize clip stack.\n");
4155 if (render_target->
rs)
4156 ID3D11RasterizerState_Release(render_target->
rs);
4157 if (render_target->
vb)
4158 ID3D11Buffer_Release(render_target->
vb);
4159 if (render_target->
ib)
4160 ID3D11Buffer_Release(render_target->
ib);
4161 if (render_target->
ps_cb)
4162 ID3D11Buffer_Release(render_target->
ps_cb);
4163 if (render_target->
ps)
4164 ID3D11PixelShader_Release(render_target->
ps);
4165 if (render_target->
vs_cb)
4166 ID3D11Buffer_Release(render_target->
vs_cb);
4175 ID3DDeviceContextState_Release(render_target->
d3d_state);
4177 ID3D11Device1_Release(render_target->
d3d_device);
4178 ID2D1Device6_Release(&render_target->
device->ID2D1Device6_iface);
4179 ID2D1Factory_Release(render_target->
factory);
4192 WARN(
"Ignoring render target type %#x.\n",
desc->type);
4194 FIXME(
"Ignoring render target usage %#x.\n",
desc->usage);
4196 WARN(
"Ignoring feature level %#x.\n",
desc->minLevel);
4201 if (bitmap_desc.
dpiX == 0.0f && bitmap_desc.
dpiY == 0.0f)
4203 bitmap_desc.
dpiX = 96.0f;
4204 bitmap_desc.
dpiY = 96.0f;
4206 else if (bitmap_desc.
dpiX <= 0.0f || bitmap_desc.
dpiY <= 0.0f)
4209 if (!(
object =
calloc(1,
sizeof(*
object))))
4214 WARN(
"Failed to initialise render target, hr %#lx.\n",
hr);
4219 ID2D1DeviceContext6_SetDpi(&
object->ID2D1DeviceContext6_iface, bitmap_desc.
dpiX, bitmap_desc.
dpiY);
4229 if (
FAILED(
hr = ID2D1DeviceContext6_CreateBitmapFromDxgiSurface(&
object->ID2D1DeviceContext6_iface,
4230 surface, &bitmap_desc, &
bitmap)))
4232 WARN(
"Failed to create target bitmap, hr %#lx.\n",
hr);
4233 IUnknown_Release(&
object->IUnknown_iface);
4238 ID2D1Bitmap1_Release(
bitmap);
4241 object->desc.pixelFormat =
desc->pixelFormat;
4243 TRACE(
"Created render target %p.\n",
object);
4263 ID2D1Device6_AddRef(iface);
4289 IUnknown_Release(
objects->elements[
i].object);
4303 IDXGIDevice_Release(
device->dxgi_device);
4304 ID2D1Factory1_Release(
device->factory);
4319 ID2D1Factory1_AddRef(
device->factory);
4331 if (!(
object =
calloc(1,
sizeof(*
object))))
4336 WARN(
"Failed to initialise device context, hr %#lx.\n",
hr);
4341 TRACE(
"Created device context %p.\n",
object);
4343 hr = ID2D1DeviceContext6_QueryInterface(&
object->ID2D1DeviceContext6_iface, iid,
context);
4344 ID2D1DeviceContext6_Release(&
object->ID2D1DeviceContext6_iface);
4363 FIXME(
"iface %p, wic_factory %p, document_target %p, desc %p, print_control %p stub!\n", iface, wic_factory,
4364 document_target,
desc, print_control);
4376 FIXME(
"iface %p stub!\n", iface);
4383 FIXME(
"iface %p, msec_since_use %u stub!\n", iface, msec_since_use);
4390 FIXME(
"iface %p stub!\n", iface);
4423 FIXME(
"iface %p, bitmap %p stub!\n", iface,
bitmap);
4433 if (!
device->allow_get_dxgi_device)
4439 IDXGIDevice_AddRef(
device->dxgi_device);
4472 FIXME(
"iface %p stub!\n", iface);
4536 ID2D1Factory1_AddRef(
device->factory);
4538 IDXGIDevice_AddRef(
device->dxgi_device);
4548 WARN(
"Failed to resize elements array.\n");
4554 IUnknown_AddRef(
object);
4571 *
object =
objects->elements[
i].object;
4572 IUnknown_AddRef(*
object);
4578 if (
object) *
object =
NULL;
COMPILER_DEPENDENT_UINT64 UINT64
#define InterlockedIncrement
#define InterlockedDecrement
static const char * wine_dbgstr_rect(const RECT *prc)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define STDMETHODCALLTYPE
HRESULT d2d_bitmap_render_target_init(struct d2d_bitmap_render_target *render_target, const struct d2d_device_context *parent_target, const D2D1_SIZE_F *size, const D2D1_SIZE_U *pixel_size, const D2D1_PIXEL_FORMAT *pixel_format, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options)
void d2d_command_list_draw_geometry(struct d2d_command_list *command_list, const struct d2d_device_context *context, ID2D1Geometry *geometry, ID2D1Brush *orig_brush, float stroke_width, ID2D1StrokeStyle *stroke_style)
void d2d_command_list_fill_opacity_mask(struct d2d_command_list *command_list, const struct d2d_device_context *context, ID2D1Bitmap *bitmap, ID2D1Brush *orig_brush, const D2D1_RECT_F *dst_rect, const D2D1_RECT_F *src_rect)
void d2d_command_list_set_unit_mode(struct d2d_command_list *command_list, D2D1_UNIT_MODE mode)
void d2d_command_list_pop_layer(struct d2d_command_list *command_list)
void d2d_command_list_push_layer(struct d2d_command_list *command_list, const struct d2d_device_context *context, const D2D1_LAYER_PARAMETERS1 *params, ID2D1Layer *layer)
void d2d_command_list_set_text_rendering_params(struct d2d_command_list *command_list, IDWriteRenderingParams *params)
void d2d_command_list_draw_line(struct d2d_command_list *command_list, const struct d2d_device_context *context, D2D1_POINT_2F p0, D2D1_POINT_2F p1, ID2D1Brush *orig_brush, float stroke_width, ID2D1StrokeStyle *stroke_style)
void d2d_command_list_fill_mesh(struct d2d_command_list *command_list, const struct d2d_device_context *context, ID2D1Mesh *mesh, ID2D1Brush *orig_brush)
void d2d_command_list_set_transform(struct d2d_command_list *command_list, const D2D1_MATRIX_3X2_F *transform)
void d2d_command_list_set_text_antialias_mode(struct d2d_command_list *command_list, D2D1_TEXT_ANTIALIAS_MODE mode)
HRESULT d2d_command_list_create(ID2D1Factory *factory, struct d2d_command_list **command_list)
void d2d_command_list_set_tags(struct d2d_command_list *command_list, D2D1_TAG tag1, D2D1_TAG tag2)
void d2d_command_list_set_primitive_blend(struct d2d_command_list *command_list, D2D1_PRIMITIVE_BLEND primitive_blend)
void d2d_command_list_draw_bitmap(struct d2d_command_list *command_list, ID2D1Bitmap *bitmap, const D2D1_RECT_F *dst_rect, float opacity, D2D1_INTERPOLATION_MODE interpolation_mode, const D2D1_RECT_F *src_rect, const D2D1_MATRIX_4X4_F *perspective_transform)
void d2d_command_list_draw_rectangle(struct d2d_command_list *command_list, const struct d2d_device_context *context, const D2D1_RECT_F *rect, ID2D1Brush *orig_brush, float stroke_width, ID2D1StrokeStyle *stroke_style)
void d2d_command_list_push_clip(struct d2d_command_list *command_list, const D2D1_RECT_F *rect, D2D1_ANTIALIAS_MODE mode)
void d2d_command_list_fill_geometry(struct d2d_command_list *command_list, const struct d2d_device_context *context, ID2D1Geometry *geometry, ID2D1Brush *orig_brush, ID2D1Brush *orig_opacity_brush)
void d2d_command_list_draw_glyph_run(struct d2d_command_list *command_list, const struct d2d_device_context *context, D2D1_POINT_2F origin, const DWRITE_GLYPH_RUN *run, const DWRITE_GLYPH_RUN_DESCRIPTION *run_desc, ID2D1Brush *orig_brush, DWRITE_MEASURING_MODE measuring_mode)
struct d2d_command_list * unsafe_impl_from_ID2D1CommandList(ID2D1CommandList *iface)
void d2d_command_list_clear(struct d2d_command_list *command_list, const D2D1_COLOR_F *color)
void d2d_command_list_draw_image(struct d2d_command_list *command_list, ID2D1Image *image, const D2D1_POINT_2F *target_offset, const D2D1_RECT_F *image_rect, D2D1_INTERPOLATION_MODE interpolation_mode, D2D1_COMPOSITE_MODE composite_mode)
void d2d_command_list_set_antialias_mode(struct d2d_command_list *command_list, D2D1_ANTIALIAS_MODE mode)
void d2d_command_list_begin_draw(struct d2d_command_list *command_list, const struct d2d_device_context *context)
void d2d_command_list_fill_rectangle(struct d2d_command_list *command_list, const struct d2d_device_context *context, const D2D1_RECT_F *rect, ID2D1Brush *orig_brush)
void d2d_command_list_pop_clip(struct d2d_command_list *command_list)
D2D1_BITMAP_INTERPOLATION_MODE
@ D2D1_BITMAP_INTERPOLATION_MODE_LINEAR
@ D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR
@ D2D1_FACTORY_TYPE_MULTI_THREADED
D2D1_OPACITY_MASK_CONTENT
@ D2D1_OPACITY_MASK_CONTENT_TEXT_GDI_COMPATIBLE
@ D2D1_FEATURE_LEVEL_DEFAULT
@ D2D1_FIGURE_BEGIN_HOLLOW
@ D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT
@ D2D1_DRAW_TEXT_OPTIONS_NO_SNAP
@ D2D1_RENDER_TARGET_TYPE_DEFAULT
@ D2D1_RENDER_TARGET_TYPE_HARDWARE
@ D2D1_TEXT_ANTIALIAS_MODE_DEFAULT
@ D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE
@ D2D1_TEXT_ANTIALIAS_MODE_ALIASED
@ D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE
D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS
@ D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE
@ D2D1_RENDER_TARGET_USAGE_NONE
@ D2D1_ANTIALIAS_MODE_PER_PRIMITIVE
@ D2D1_ANTIALIAS_MODE_ALIASED
@ D2D1_DC_INITIALIZE_MODE_COPY
@ D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE
@ D2D1_BITMAP_OPTIONS_CANNOT_DRAW
@ D2D1_BITMAP_OPTIONS_CPU_READ
@ D2D1_BITMAP_OPTIONS_NONE
@ D2D1_BITMAP_OPTIONS_TARGET
D2D1_DEVICE_CONTEXT_OPTIONS
@ D2D1_PRIMITIVE_BLEND_MAX
@ D2D1_STROKE_TRANSFORM_TYPE_FIXED
@ D2D1_COMPOSITE_MODE_SOURCE_OVER
D2D1_COLOR_INTERPOLATION_MODE
@ D2D1_BUFFER_PRECISION_32BPC_FLOAT
@ D2D1_BUFFER_PRECISION_8BPC_UNORM
@ D2D1_BUFFER_PRECISION_16BPC_UNORM
@ D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB
@ D2D1_BUFFER_PRECISION_16BPC_FLOAT
@ D2D1_LAYER_OPTIONS1_NONE
@ D2D1_RENDERING_PRIORITY_NORMAL
D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION
D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS
D2D1_IMAGE_SOURCE_LOADING_OPTIONS
@ D2D_TARGET_COMMAND_LIST
static const char * debug_d2d_point_2f(const D2D1_POINT_2F *point)
HRESULT d2d_effect_create(struct d2d_device_context *context, const CLSID *effect_id, ID2D1Effect **effect)
@ D2D_SAMPLER_EXTEND_MODE_COUNT
@ D2D_SAMPLER_INTERPOLATION_MODE_COUNT
HRESULT d2d_layer_create(ID2D1Factory *factory, const D2D1_SIZE_F *size, struct d2d_layer **layer)
static void d2d_rect_expand(D2D1_RECT_F *dst, const D2D1_POINT_2F *point)
struct d2d_geometry * unsafe_impl_from_ID2D1Geometry(ID2D1Geometry *iface)
static struct d2d_factory * unsafe_impl_from_ID2D1Factory(ID2D1Factory *iface)
static BOOL d2d_array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
static const char * debug_d2d_rect_f(const D2D1_RECT_F *rect)
static D2D1_INTERPOLATION_MODE d2d1_1_interp_mode_from_d2d1(D2D1_BITMAP_INTERPOLATION_MODE mode)
struct d2d_state_block * unsafe_impl_from_ID2D1DrawingStateBlock(ID2D1DrawingStateBlock *iface)
struct d2d_stroke_style * unsafe_impl_from_ID2D1StrokeStyle(ID2D1StrokeStyle *iface)
static void d2d_point_set(D2D1_POINT_2F *dst, float x, float y)
HRESULT d2d_mesh_create(ID2D1Factory *factory, struct d2d_mesh **mesh)
@ D2D_SHAPE_TYPE_TRIANGLE
@ D2D_SHAPE_TYPE_BEZIER_OUTLINE
@ D2D_SHAPE_TYPE_ARC_OUTLINE
static void d2d_point_transform(D2D1_POINT_2F *dst, const D2D1_MATRIX_3X2_F *matrix, float x, float y)
const UINT D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION
@ D3D11_BLEND_INV_SRC_ALPHA
const UINT D3D11_DEFAULT_SAMPLE_MASK
@ D3D11_MAP_WRITE_DISCARD
@ D3D11_INPUT_PER_VERTEX_DATA
@ D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST
HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages)
DWRITE_GLYPH_IMAGE_FORMATS
@ DWRITE_MEASURING_MODE_NATURAL
@ DWRITE_MEASURING_MODE_GDI_NATURAL
HRESULT d2d_bitmap_create(struct d2d_device_context *context, D2D1_SIZE_U size, const void *src_data, UINT32 pitch, const D2D1_BITMAP_PROPERTIES1 *desc, struct d2d_bitmap **bitmap)
HRESULT d2d_bitmap_create_shared(struct d2d_device_context *context, REFIID iid, void *data, const D2D1_BITMAP_PROPERTIES1 *desc, struct d2d_bitmap **bitmap)
HRESULT d2d_bitmap_create_from_wic_bitmap(struct d2d_device_context *context, IWICBitmapSource *bitmap_source, const D2D1_BITMAP_PROPERTIES1 *desc, struct d2d_bitmap **bitmap)
struct d2d_bitmap * unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface)
unsigned int d2d_get_bitmap_options_for_surface(IDXGISurface *surface)
BOOL d2d_brush_fill_cb(const struct d2d_brush *brush, struct d2d_brush_cb *cb)
HRESULT d2d_gradient_create(ID2D1Factory *factory, ID3D11Device1 *device, const D2D1_GRADIENT_STOP *stops, UINT32 stop_count, D2D1_GAMMA gamma, D2D1_EXTEND_MODE extend_mode, struct d2d_gradient **out)
HRESULT d2d_image_brush_create(ID2D1Factory *factory, ID2D1Image *image, const D2D1_IMAGE_BRUSH_PROPERTIES *image_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, struct d2d_brush **brush)
HRESULT d2d_solid_color_brush_create(ID2D1Factory *factory, const D2D1_COLOR_F *color, const D2D1_BRUSH_PROPERTIES *desc, struct d2d_brush **brush)
HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory, const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *gradient_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1GradientStopCollection *gradient, struct d2d_brush **brush)
HRESULT d2d_bitmap_brush_create(ID2D1Factory *factory, ID2D1Bitmap *bitmap, const D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmap_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, struct d2d_brush **brush)
struct d2d_brush * unsafe_impl_from_ID2D1Brush(ID2D1Brush *iface)
void d2d_brush_bind_resources(struct d2d_brush *brush, struct d2d_device_context *context, unsigned int brush_idx)
HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory, const D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *gradient_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1GradientStopCollection *gradient, struct d2d_brush **brush)
static struct d2d_device_context * impl_from_ID2D1DeviceContext(ID2D1DeviceContext6 *iface)
static void d2d_device_context_draw_glyph_run_bitmap(struct d2d_device_context *context, D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run, ID2D1Brush *brush, DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEASURING_MODE measuring_mode, DWRITE_TEXT_ANTIALIAS_MODE antialias_mode)
static void d2d_rect_set(D2D1_RECT_F *dst, float left, float top, float right, float bottom)
static HRESULT STDMETHODCALLTYPE d2d_device_context_inner_QueryInterface(IUnknown *iface, REFIID iid, void **out)
static HRESULT STDMETHODCALLTYPE d2d_device_context_EndDraw(ID2D1DeviceContext6 *iface, D2D1_TAG *tag1, D2D1_TAG *tag2)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateCompatibleRenderTarget(ID2D1DeviceContext6 *iface, const D2D1_SIZE_F *size, const D2D1_SIZE_U *pixel_size, const D2D1_PIXEL_FORMAT *format, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options, ID2D1BitmapRenderTarget **rt)
struct d2d_device * unsafe_impl_from_ID2D1Device(ID2D1Device1 *iface)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateColorContextFromDxgiColorSpace(ID2D1DeviceContext6 *iface, DXGI_COLOR_SPACE_TYPE color_space, ID2D1ColorContext1 **color_context)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateMesh(ID2D1DeviceContext6 *iface, ID2D1Mesh **mesh)
HRESULT d2d_device_add_indexed_object(struct d2d_indexed_objects *objects, const GUID *id, IUnknown *object)
static const struct ID2D1Device6Vtbl d2d_device_vtbl
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateColorContext(ID2D1DeviceContext6 *iface, D2D1_COLOR_SPACE space, const BYTE *profile, UINT32 profile_size, ID2D1ColorContext **color_context)
static HRESULT WINAPI d2d_device_QueryInterface(ID2D1Device6 *iface, REFIID iid, void **out)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateImageSourceFromWic(ID2D1DeviceContext6 *iface, IWICBitmapSource *wic_bitmap_source, D2D1_IMAGE_SOURCE_LOADING_OPTIONS loading_options, D2D1_ALPHA_MODE alpha_mode, ID2D1ImageSourceFromWic **image_source)
static void STDMETHODCALLTYPE d2d_device_context_GetFactory(ID2D1DeviceContext6 *iface, ID2D1Factory **factory)
static BOOL d2d_clip_stack_init(struct d2d_clip_stack *stack)
static void STDMETHODCALLTYPE d2d_device_context_SaveDrawingState(ID2D1DeviceContext6 *iface, ID2D1DrawingStateBlock *state_block)
static HRESULT WINAPI d2d_device_CreateDeviceContext(ID2D1Device6 *iface, D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext **context)
static void STDMETHODCALLTYPE d2d_device_context_DrawSvgDocument(ID2D1DeviceContext6 *iface, ID2D1SvgDocument *svg_document)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateColorContextFromWicColorContext(ID2D1DeviceContext6 *iface, IWICColorContext *wic_color_context, ID2D1ColorContext **color_context)
static void STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_DrawGlyphRun(ID2D1DeviceContext6 *iface, D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run, const DWRITE_GLYPH_RUN_DESCRIPTION *glyph_run_desc, ID2D1Brush *brush, DWRITE_MEASURING_MODE measuring_mode)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateImageBrush(ID2D1DeviceContext6 *iface, ID2D1Image *image, const D2D1_IMAGE_BRUSH_PROPERTIES *image_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1ImageBrush **brush)
static void STDMETHODCALLTYPE d2d_device_context_GetRenderingControls(ID2D1DeviceContext6 *iface, D2D1_RENDERING_CONTROLS *rendering_controls)
static BOOL STDMETHODCALLTYPE d2d_device_context_IsDxgiFormatSupported(ID2D1DeviceContext6 *iface, DXGI_FORMAT format)
static void STDMETHODCALLTYPE d2d_device_context_GetTarget(ID2D1DeviceContext6 *iface, ID2D1Image **target)
static void STDMETHODCALLTYPE d2d_device_context_FillOpacityMask(ID2D1DeviceContext6 *iface, ID2D1Bitmap *mask, ID2D1Brush *brush, D2D1_OPACITY_MASK_CONTENT content, const D2D1_RECT_F *dst_rect, const D2D1_RECT_F *src_rect)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateEffect(ID2D1DeviceContext6 *iface, REFCLSID effect_id, ID2D1Effect **effect)
static HRESULT STDMETHODCALLTYPE d2d_gdi_interop_render_target_QueryInterface(ID2D1GdiInteropRenderTarget *iface, REFIID iid, void **out)
static void STDMETHODCALLTYPE d2d_device_context_SetTags(ID2D1DeviceContext6 *iface, D2D1_TAG tag1, D2D1_TAG tag2)
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_GetPixelsPerDip(IDWriteTextRenderer *iface, void *ctx, float *ppd)
static void STDMETHODCALLTYPE d2d_device_context_RestoreDrawingState(ID2D1DeviceContext6 *iface, ID2D1DrawingStateBlock *state_block)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateLinearGradientBrush(ID2D1DeviceContext6 *iface, const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *gradient_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1GradientStopCollection *gradient, ID2D1LinearGradientBrush **brush)
static const D2D1_MATRIX_3X2_F identity
static void STDMETHODCALLTYPE d2d_device_context_DrawGlyphRun(ID2D1DeviceContext6 *iface, D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run, ID2D1Brush *brush, DWRITE_MEASURING_MODE measuring_mode)
static const struct ID2D1GdiInteropRenderTargetVtbl d2d_gdi_interop_render_target_vtbl
static struct d2d_device_context * impl_from_IUnknown(IUnknown *iface)
static void STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext4_DrawText(ID2D1DeviceContext6 *iface, const WCHAR *string, UINT32 string_length, IDWriteTextFormat *text_format, const D2D1_RECT_F *layout_rect, ID2D1Brush *default_fill_brush, ID2D1SvgGlyphStyle *svg_glyph_style, UINT32 color_palette_index, D2D1_DRAW_TEXT_OPTIONS options, DWRITE_MEASURING_MODE measuring_mode)
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawStrikethrough(IDWriteTextRenderer *iface, void *ctx, float baseline_origin_x, float baseline_origin_y, const DWRITE_STRIKETHROUGH *strikethrough, IUnknown *effect)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateSvgGlyphStyle(ID2D1DeviceContext6 *iface, ID2D1SvgGlyphStyle **svg_glyph_style)
static BOOL STDMETHODCALLTYPE d2d_device_context_IsSupported(ID2D1DeviceContext6 *iface, const D2D1_RENDER_TARGET_PROPERTIES *desc)
static HRESULT STDMETHODCALLTYPE d2d_gdi_interop_render_target_GetDC(ID2D1GdiInteropRenderTarget *iface, D2D1_DC_INITIALIZE_MODE mode, HDC *dc)
static HRESULT STDMETHODCALLTYPE d2d_device_ID2D1Device5_CreateDeviceContext(ID2D1Device6 *iface, D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext5 **context)
static void STDMETHODCALLTYPE d2d_device_context_DrawSvgGlyphRun(ID2D1DeviceContext6 *iface, D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run, ID2D1Brush *default_fill_brush, ID2D1SvgGlyphStyle *svg_glyph_style, UINT32 color_palette_index, DWRITE_MEASURING_MODE measuring_mode)
static D2D1_PRIMITIVE_BLEND STDMETHODCALLTYPE d2d_device_context_GetPrimitiveBlend(ID2D1DeviceContext6 *iface)
static void STDMETHODCALLTYPE d2d_device_context_GetDpi(ID2D1DeviceContext6 *iface, float *dpi_x, float *dpi_y)
static void STDMETHODCALLTYPE d2d_device_context_SetTextRenderingParams(ID2D1DeviceContext6 *iface, IDWriteRenderingParams *text_rendering_params)
static void WINAPI d2d_device_SetRenderingPriority(ID2D1Device6 *iface, D2D1_RENDERING_PRIORITY priority)
static void STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_PushLayer(ID2D1DeviceContext6 *iface, const D2D1_LAYER_PARAMETERS1 *layer_parameters, ID2D1Layer *layer)
static void d2d_rect_intersect(D2D1_RECT_F *dst, const D2D1_RECT_F *src)
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_IsPixelSnappingDisabled(IDWriteTextRenderer *iface, void *ctx, BOOL *disabled)
static HRESULT STDMETHODCALLTYPE d2d_device_ID2D1Device4_CreateDeviceContext(ID2D1Device6 *iface, D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext4 **context)
static void STDMETHODCALLTYPE d2d_device_context_SetUnitMode(ID2D1DeviceContext6 *iface, D2D1_UNIT_MODE unit_mode)
static D2D1_RENDERING_PRIORITY WINAPI d2d_device_GetRenderingPriority(ID2D1Device6 *iface)
static void STDMETHODCALLTYPE d2d_device_context_DrawImage(ID2D1DeviceContext6 *iface, ID2D1Image *image, const D2D1_POINT_2F *target_offset, const D2D1_RECT_F *image_rect, D2D1_INTERPOLATION_MODE interpolation_mode, D2D1_COMPOSITE_MODE composite_mode)
static void STDMETHODCALLTYPE d2d_device_context_SetTransform(ID2D1DeviceContext6 *iface, const D2D1_MATRIX_3X2_F *transform)
static BOOL d2d_clip_stack_push(struct d2d_clip_stack *stack, const D2D1_RECT_F *rect)
static void STDMETHODCALLTYPE d2d_device_context_FillGeometry(ID2D1DeviceContext6 *iface, ID2D1Geometry *geometry, ID2D1Brush *brush, ID2D1Brush *opacity_brush)
static void STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext4_DrawTextLayout(ID2D1DeviceContext6 *iface, D2D1_POINT_2F origin, IDWriteTextLayout *text_layout, ID2D1Brush *default_fill_brush, ID2D1SvgGlyphStyle *svg_glyph_style, UINT32 color_palette_index, D2D1_DRAW_TEXT_OPTIONS options)
static ULONG WINAPI d2d_device_Release(ID2D1Device6 *iface)
static HRESULT STDMETHODCALLTYPE d2d_device_ID2D1Device6_CreateDeviceContext(ID2D1Device6 *iface, D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext6 **context)
static void STDMETHODCALLTYPE d2d_device_context_DrawRoundedRectangle(ID2D1DeviceContext6 *iface, const D2D1_ROUNDED_RECT *rect, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style)
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawInlineObject(IDWriteTextRenderer *iface, void *ctx, float origin_x, float origin_y, IDWriteInlineObject *object, BOOL is_sideways, BOOL is_rtl, IUnknown *effect)
void d2d_device_init(struct d2d_device *device, ID2D1Factory1 *factory, IDXGIDevice *dxgi_device, bool allow_get_dxgi_device)
static void d2d_device_context_draw_bitmap(struct d2d_device_context *context, ID2D1Bitmap *bitmap, const D2D1_RECT_F *dst_rect, float opacity, D2D1_INTERPOLATION_MODE interpolation_mode, const D2D1_RECT_F *src_rect, const D2D1_POINT_2F *offset, const D2D1_MATRIX_4X4_F *perspective_transform)
static void d2d_device_context_set_error(struct d2d_device_context *context, HRESULT code)
static HRESULT STDMETHODCALLTYPE d2d_device_context_Flush(ID2D1DeviceContext6 *iface, D2D1_TAG *tag1, D2D1_TAG *tag2)
static void STDMETHODCALLTYPE d2d_device_context_PopLayer(ID2D1DeviceContext6 *iface)
static void d2d_size_set(D2D1_SIZE_U *dst, float width, float height)
static void d2d_device_context_draw(struct d2d_device_context *render_target, enum d2d_shape_type shape_type, ID3D11Buffer *ib, unsigned int index_count, ID3D11Buffer *vb, unsigned int vb_stride, struct d2d_brush *brush, struct d2d_brush *opacity_brush)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateColorContextFromSimpleColorProfile(ID2D1DeviceContext6 *iface, const D2D1_SIMPLE_COLOR_PROFILE *simple_profile, ID2D1ColorContext1 **color_context)
static void STDMETHODCALLTYPE d2d_device_context_SetRenderingControls(ID2D1DeviceContext6 *iface, const D2D1_RENDERING_CONTROLS *rendering_controls)
static ULONG WINAPI d2d_device_AddRef(ID2D1Device6 *iface)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateSpriteBatch(ID2D1DeviceContext6 *iface, ID2D1SpriteBatch **sprite_batch)
static D2D1_SIZE_U *STDMETHODCALLTYPE d2d_device_context_GetPixelSize(ID2D1DeviceContext6 *iface, D2D1_SIZE_U *pixel_size)
static void STDMETHODCALLTYPE d2d_device_context_GetTags(ID2D1DeviceContext6 *iface, D2D1_TAG *tag1, D2D1_TAG *tag2)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateFilledGeometryRealization(ID2D1DeviceContext6 *iface, ID2D1Geometry *geometry, float tolerance, ID2D1GeometryRealization **realization)
static void STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_FillOpacityMask(ID2D1DeviceContext6 *iface, ID2D1Bitmap *mask, ID2D1Brush *brush, const D2D1_RECT_F *dst_rect, const D2D1_RECT_F *src_rect)
static void WINAPI d2d_device_GetFactory(ID2D1Device6 *iface, ID2D1Factory **factory)
static void STDMETHODCALLTYPE d2d_device_context_DrawGdiMetafile(ID2D1DeviceContext6 *iface, ID2D1GdiMetafile *metafile, const D2D1_POINT_2F *target_offset)
static void d2d_clip_stack_pop(struct d2d_clip_stack *stack)
static void STDMETHODCALLTYPE d2d_device_context_DrawEllipse(ID2D1DeviceContext6 *iface, const D2D1_ELLIPSE *ellipse, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style)
static D2D1_TEXT_ANTIALIAS_MODE STDMETHODCALLTYPE d2d_device_context_GetTextAntialiasMode(ID2D1DeviceContext6 *iface)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmapFromWicBitmap(ID2D1DeviceContext6 *iface, IWICBitmapSource *bitmap_source, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap)
static HRESULT STDMETHODCALLTYPE d2d_device_context_GetGlyphRunWorldBounds(ID2D1DeviceContext6 *iface, D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run, DWRITE_MEASURING_MODE measuring_mode, D2D1_RECT_F *bounds)
static HRESULT STDMETHODCALLTYPE d2d_device_ID2D1Device2_CreateDeviceContext(ID2D1Device6 *iface, D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext2 **context)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateStrokedGeometryRealization(ID2D1DeviceContext6 *iface, ID2D1Geometry *geometry, float tolerance, float stroke_width, ID2D1StrokeStyle *stroke_style, ID2D1GeometryRealization **realization)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmapFromDxgiSurface(ID2D1DeviceContext6 *iface, IDXGISurface *surface, const D2D1_BITMAP_PROPERTIES1 *desc, ID2D1Bitmap1 **bitmap)
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_QueryInterface(IDWriteTextRenderer *iface, REFIID iid, void **out)
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_GetCurrentTransform(IDWriteTextRenderer *iface, void *ctx, DWRITE_MATRIX *transform)
static ULONG STDMETHODCALLTYPE d2d_gdi_interop_render_target_AddRef(ID2D1GdiInteropRenderTarget *iface)
static HRESULT d2d_gdi_interop_get_surface(struct d2d_device_context *context, IDXGISurface1 **surface)
static UINT64 STDMETHODCALLTYPE d2d_device_GetMaximumColorGlyphCacheMemory(ID2D1Device6 *iface)
static D2D1_PIXEL_FORMAT *STDMETHODCALLTYPE d2d_device_context_GetPixelFormat(ID2D1DeviceContext6 *iface, D2D1_PIXEL_FORMAT *format)
static void STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_DrawBitmap(ID2D1DeviceContext6 *iface, ID2D1Bitmap *bitmap, const D2D1_RECT_F *dst_rect, float opacity, D2D1_INTERPOLATION_MODE interpolation_mode, const D2D1_RECT_F *src_rect, const D2D1_MATRIX_4X4_F *perspective_transform)
static HRESULT WINAPI d2d_device_CreatePrintControl(ID2D1Device6 *iface, IWICImagingFactory *wic_factory, IPrintDocumentPackageTarget *document_target, const D2D1_PRINT_CONTROL_PROPERTIES *desc, ID2D1PrintControl **print_control)
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawGlyphRun(IDWriteTextRenderer *iface, void *ctx, float baseline_origin_x, float baseline_origin_y, DWRITE_MEASURING_MODE measuring_mode, const DWRITE_GLYPH_RUN *glyph_run, const DWRITE_GLYPH_RUN_DESCRIPTION *glyph_run_desc, IUnknown *effect)
static HRESULT STDMETHODCALLTYPE d2d_device_context_GetSvgGlyphImage(ID2D1DeviceContext6 *iface, D2D1_POINT_2F glyph_origin, IDWriteFontFace *font_face, FLOAT font_em_size, UINT16 glyph_index, BOOL is_sideways, const D2D1_MATRIX_3X2_F *world_transform, ID2D1Brush *default_fill_brush, ID2D1SvgGlyphStyle *svg_glyph_style, UINT32 color_palette_index, D2D1_MATRIX_3X2_F *glyph_transform, ID2D1CommandList **glyph_image)
static HRESULT STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_CreateBitmapFromWicBitmap(ID2D1DeviceContext6 *iface, IWICBitmapSource *bitmap_source, const D2D1_BITMAP_PROPERTIES1 *desc, ID2D1Bitmap1 **bitmap)
static void WINAPI d2d_device_SetMaximumTextureMemory(ID2D1Device6 *iface, UINT64 max_texture_memory)
static void d2d_device_context_draw_glyph_run(struct d2d_device_context *context, D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run, const DWRITE_GLYPH_RUN_DESCRIPTION *glyph_run_desc, ID2D1Brush *brush, DWRITE_MEASURING_MODE measuring_mode)
static void STDMETHODCALLTYPE d2d_device_context_FillRoundedRectangle(ID2D1DeviceContext6 *iface, const D2D1_ROUNDED_RECT *rect, ID2D1Brush *brush)
static D2D1_UNIT_MODE STDMETHODCALLTYPE d2d_device_context_GetUnitMode(ID2D1DeviceContext6 *iface)
static void STDMETHODCALLTYPE d2d_device_context_FillMesh(ID2D1DeviceContext6 *iface, ID2D1Mesh *mesh, ID2D1Brush *brush)
static void d2d_device_context_reset_target(struct d2d_device_context *context)
static void d2d_device_context_fill_geometry(struct d2d_device_context *render_target, const struct d2d_geometry *geometry, struct d2d_brush *brush, struct d2d_brush *opacity_brush)
static ID2D1Brush * d2d_draw_get_text_brush(struct d2d_draw_text_layout_ctx *context, IUnknown *effect)
void d2d_device_indexed_objects_clear(struct d2d_indexed_objects *objects)
static D2D1_SIZE_F *STDMETHODCALLTYPE d2d_device_context_GetSize(ID2D1DeviceContext6 *iface, D2D1_SIZE_F *size)
static void STDMETHODCALLTYPE d2d_device_context_DrawGradientMesh(ID2D1DeviceContext6 *iface, ID2D1GradientMesh *gradient_mesh)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateRadialGradientBrush(ID2D1DeviceContext6 *iface, const D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *gradient_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1GradientStopCollection *gradient, ID2D1RadialGradientBrush **brush)
static void STDMETHODCALLTYPE d2d_device_context_DrawLine(ID2D1DeviceContext6 *iface, D2D1_POINT_2F p0, D2D1_POINT_2F p1, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style)
static ULONG STDMETHODCALLTYPE d2d_gdi_interop_render_target_Release(ID2D1GdiInteropRenderTarget *iface)
static void STDMETHODCALLTYPE d2d_device_context_GetDevice(ID2D1DeviceContext6 *iface, ID2D1Device **device)
static void STDMETHODCALLTYPE d2d_device_context_FillEllipse(ID2D1DeviceContext6 *iface, const D2D1_ELLIPSE *ellipse, ID2D1Brush *brush)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateSolidColorBrush(ID2D1DeviceContext6 *iface, const D2D1_COLOR_F *color, const D2D1_BRUSH_PROPERTIES *desc, ID2D1SolidColorBrush **brush)
static void STDMETHODCALLTYPE d2d_device_context_SetDpi(ID2D1DeviceContext6 *iface, float dpi_x, float dpi_y)
static void STDMETHODCALLTYPE d2d_device_context_SetTextAntialiasMode(ID2D1DeviceContext6 *iface, D2D1_TEXT_ANTIALIAS_MODE antialias_mode)
HRESULT d2d_d3d_create_render_target(struct d2d_device *device, IDXGISurface *surface, IUnknown *outer_unknown, const struct d2d_device_context_ops *ops, const D2D1_RENDER_TARGET_PROPERTIES *desc, void **render_target)
static UINT64 WINAPI d2d_device_GetMaximumTextureMemory(ID2D1Device6 *iface)
static ULONG STDMETHODCALLTYPE d2d_text_renderer_Release(IDWriteTextRenderer *iface)
static void STDMETHODCALLTYPE d2d_device_context_DrawGeometryRealization(ID2D1DeviceContext6 *iface, ID2D1GeometryRealization *realization, ID2D1Brush *brush)
#define INITIAL_CLIP_STACK_SIZE
static HRESULT STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_CreateBitmap(ID2D1DeviceContext6 *iface, D2D1_SIZE_U size, const void *src_data, UINT32 pitch, const D2D1_BITMAP_PROPERTIES1 *desc, ID2D1Bitmap1 **bitmap)
static HRESULT STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_CreateBitmapBrush(ID2D1DeviceContext6 *iface, ID2D1Bitmap *bitmap, const D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmap_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1BitmapBrush1 **brush)
static void STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext2_DrawGdiMetafile(ID2D1DeviceContext6 *iface, ID2D1GdiMetafile *gdi_metafile, const D2D1_RECT_F *dst_rect, const D2D1_RECT_F *src_rect)
static void STDMETHODCALLTYPE d2d_device_context_GetTransform(ID2D1DeviceContext6 *iface, D2D1_MATRIX_3X2_F *transform)
static const struct ID2D1DeviceContext6Vtbl d2d_device_context_vtbl
static void STDMETHODCALLTYPE d2d_device_context_SetAntialiasMode(ID2D1DeviceContext6 *iface, D2D1_ANTIALIAS_MODE antialias_mode)
static void STDMETHODCALLTYPE d2d_device_context_DrawSpriteBatch(ID2D1DeviceContext6 *iface, ID2D1SpriteBatch *sprite_batch, UINT32 start_index, UINT32 sprite_count, ID2D1Bitmap *bitmap, D2D1_BITMAP_INTERPOLATION_MODE interpolation_mode, D2D1_SPRITE_OPTIONS sprite_options)
static void STDMETHODCALLTYPE d2d_device_context_GetTextRenderingParams(ID2D1DeviceContext6 *iface, IDWriteRenderingParams **text_rendering_params)
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawUnderline(IDWriteTextRenderer *iface, void *ctx, float baseline_origin_x, float baseline_origin_y, const DWRITE_UNDERLINE *underline, IUnknown *effect)
static void STDMETHODCALLTYPE d2d_device_FlushDeviceContexts(ID2D1Device6 *iface, ID2D1Bitmap *bitmap)
static struct d2d_device_context * impl_from_IDWriteTextRenderer(IDWriteTextRenderer *iface)
static HRESULT STDMETHODCALLTYPE d2d_device_context_GetImageLocalBounds(ID2D1DeviceContext6 *iface, ID2D1Image *image, D2D1_RECT_F *local_bounds)
static void d2d_clip_stack_cleanup(struct d2d_clip_stack *stack)
static HRESULT d2d_device_context_init(struct d2d_device_context *render_target, struct d2d_device *device, IUnknown *outer_unknown, const struct d2d_device_context_ops *ops)
static void STDMETHODCALLTYPE d2d_device_context_BlendImage(ID2D1DeviceContext6 *iface, ID2D1Image *image, D2D1_BLEND_MODE blend_mode, const D2D1_POINT_2F *target_offset, const D2D1_RECT_F *image_rect, D2D1_INTERPOLATION_MODE interpolation_mode)
static void STDMETHODCALLTYPE d2d_device_context_DrawText(ID2D1DeviceContext6 *iface, const WCHAR *string, UINT32 string_len, IDWriteTextFormat *text_format, const D2D1_RECT_F *layout_rect, ID2D1Brush *brush, D2D1_DRAW_TEXT_OPTIONS options, DWRITE_MEASURING_MODE measuring_mode)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateSharedBitmap(ID2D1DeviceContext6 *iface, REFIID iid, void *data, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap)
static void STDMETHODCALLTYPE d2d_device_context_BeginDraw(ID2D1DeviceContext6 *iface)
static const struct IDWriteTextRendererVtbl d2d_text_renderer_vtbl
static ULONG STDMETHODCALLTYPE d2d_text_renderer_AddRef(IDWriteTextRenderer *iface)
static D2D1_ANTIALIAS_MODE d2d_device_context_set_aa_mode_from_text_aa_mode(struct d2d_device_context *rt)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateGradientStopCollection(ID2D1DeviceContext6 *iface, const D2D1_GRADIENT_STOP *stops, UINT32 stop_count, D2D1_GAMMA gamma, D2D1_EXTEND_MODE extend_mode, ID2D1GradientStopCollection **gradient)
static void STDMETHODCALLTYPE d2d_device_context_Clear(ID2D1DeviceContext6 *iface, const D2D1_COLOR_F *colour)
static ULONG STDMETHODCALLTYPE d2d_device_context_AddRef(ID2D1DeviceContext6 *iface)
static HRESULT STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_CreateGradientStopCollection(ID2D1DeviceContext6 *iface, const D2D1_GRADIENT_STOP *stops, UINT32 stop_count, D2D1_COLOR_SPACE preinterpolation_space, D2D1_COLOR_SPACE postinterpolation_space, D2D1_BUFFER_PRECISION buffer_precision, D2D1_EXTEND_MODE extend_mode, D2D1_COLOR_INTERPOLATION_MODE color_interpolation_mode, ID2D1GradientStopCollection1 **gradient)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateTransformedImageSource(ID2D1DeviceContext6 *iface, ID2D1ImageSource *source, const D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES *props, ID2D1TransformedImageSource **transformed)
static void STDMETHODCALLTYPE d2d_device_context_DrawColorBitmapGlyphRun(ID2D1DeviceContext6 *iface, DWRITE_GLYPH_IMAGE_FORMATS glyph_image_format, D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run, DWRITE_MEASURING_MODE measuring_mode, D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION bitmap_snap_option)
static HRESULT STDMETHODCALLTYPE d2d_device_context_InvalidateEffectInputRectangle(ID2D1DeviceContext6 *iface, ID2D1Effect *effect, UINT32 input, const D2D1_RECT_F *input_rect)
static BOOL STDMETHODCALLTYPE d2d_device_context_IsBufferPrecisionSupported(ID2D1DeviceContext6 *iface, D2D1_BUFFER_PRECISION buffer_precision)
static struct d2d_device * impl_from_ID2D1Device(ID2D1Device6 *iface)
static struct d2d_device_context * impl_from_ID2D1GdiInteropRenderTarget(ID2D1GdiInteropRenderTarget *iface)
static void STDMETHODCALLTYPE d2d_device_context_DrawGeometry(ID2D1DeviceContext6 *iface, ID2D1Geometry *geometry, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateLookupTable3D(ID2D1DeviceContext6 *iface, D2D1_BUFFER_PRECISION precision, const UINT32 *extents, const BYTE *data, UINT32 data_count, const UINT32 *strides, ID2D1LookupTable3D **lookup_table)
static void STDMETHODCALLTYPE d2d_device_context_FillRectangle(ID2D1DeviceContext6 *iface, const D2D1_RECT_F *rect, ID2D1Brush *brush)
BOOL d2d_device_get_indexed_object(struct d2d_indexed_objects *objects, const GUID *id, IUnknown **object)
static D2D1_ANTIALIAS_MODE STDMETHODCALLTYPE d2d_device_context_GetAntialiasMode(ID2D1DeviceContext6 *iface)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateLayer(ID2D1DeviceContext6 *iface, const D2D1_SIZE_F *size, ID2D1Layer **layer)
static void STDMETHODCALLTYPE d2d_device_context_DrawBitmap(ID2D1DeviceContext6 *iface, ID2D1Bitmap *bitmap, const D2D1_RECT_F *dst_rect, float opacity, D2D1_BITMAP_INTERPOLATION_MODE interpolation_mode, const D2D1_RECT_F *src_rect)
static HRESULT STDMETHODCALLTYPE d2d_device_context_GetEffectInvalidRectangleCount(ID2D1DeviceContext6 *iface, ID2D1Effect *effect, UINT32 *rect_count)
static void d2d_device_context_draw_glyph_run_outline(struct d2d_device_context *render_target, D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run, ID2D1Brush *brush)
static ULONG STDMETHODCALLTYPE d2d_device_context_Release(ID2D1DeviceContext6 *iface)
static BOOL d2d_bitmap_check_options_with_surface(unsigned int options, unsigned int surface_options)
static UINT32 STDMETHODCALLTYPE d2d_device_context_GetMaximumBitmapSize(ID2D1DeviceContext6 *iface)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateCommandList(ID2D1DeviceContext6 *iface, ID2D1CommandList **command_list)
static HRESULT STDMETHODCALLTYPE d2d_device_context_GetGradientMeshWorldBounds(ID2D1DeviceContext6 *iface, ID2D1GradientMesh *gradient_mesh, D2D1_RECT_F *bounds)
static void STDMETHODCALLTYPE d2d_device_context_SetPrimitiveBlend(ID2D1DeviceContext6 *iface, D2D1_PRIMITIVE_BLEND primitive_blend)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateImageSourceFromDxgi(ID2D1DeviceContext6 *iface, IDXGISurface **surfaces, UINT32 surface_count, DXGI_COLOR_SPACE_TYPE color_space, D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS options, ID2D1ImageSource **image_source)
static HRESULT STDMETHODCALLTYPE d2d_device_context_GetEffectRequiredInputRectangles(ID2D1DeviceContext6 *iface, ID2D1Effect *effect, const D2D1_RECT_F *image_rect, const D2D1_EFFECT_INPUT_DESCRIPTION *desc, D2D1_RECT_F *input_rect, UINT32 input_count)
static void STDMETHODCALLTYPE d2d_device_context_PushAxisAlignedClip(ID2D1DeviceContext6 *iface, const D2D1_RECT_F *clip_rect, D2D1_ANTIALIAS_MODE antialias_mode)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmap(ID2D1DeviceContext6 *iface, D2D1_SIZE_U size, const void *src_data, UINT32 pitch, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap)
static const struct IUnknownVtbl d2d_device_context_inner_unknown_vtbl
static HRESULT STDMETHODCALLTYPE d2d_device_context_GetImageWorldBounds(ID2D1DeviceContext6 *iface, ID2D1Image *image, D2D1_RECT_F *world_bounds)
static void STDMETHODCALLTYPE d2d_device_context_SetTarget(ID2D1DeviceContext6 *iface, ID2D1Image *target)
static HRESULT STDMETHODCALLTYPE d2d_device_context_GetEffectInvalidRectangles(ID2D1DeviceContext6 *iface, ID2D1Effect *effect, D2D1_RECT_F *rectangles, UINT32 rect_count)
static HRESULT d2d_device_context_update_vs_cb(struct d2d_device_context *context, const D2D_MATRIX_3X2_F *geometry_transform, float stroke_width)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateSvgDocument(ID2D1DeviceContext6 *iface, IStream *input_xml_stream, D2D1_SIZE_F viewport_size, ID2D1SvgDocument **svg_document)
static void STDMETHODCALLTYPE d2d_device_context_PopAxisAlignedClip(ID2D1DeviceContext6 *iface)
static void STDMETHODCALLTYPE d2d_device_context_DrawTextLayout(ID2D1DeviceContext6 *iface, D2D1_POINT_2F origin, IDWriteTextLayout *layout, ID2D1Brush *brush, D2D1_DRAW_TEXT_OPTIONS options)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmapBrush(ID2D1DeviceContext6 *iface, ID2D1Bitmap *bitmap, const D2D1_BITMAP_BRUSH_PROPERTIES *bitmap_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1BitmapBrush **brush)
static HRESULT STDMETHODCALLTYPE d2d_device_ID2D1Device3_CreateDeviceContext(ID2D1Device6 *iface, D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext3 **context)
static void d2d_device_context_draw_geometry(struct d2d_device_context *render_target, const struct d2d_geometry *geometry, struct d2d_brush *brush, float stroke_width)
static ULONG STDMETHODCALLTYPE d2d_device_context_inner_Release(IUnknown *iface)
static void STDMETHODCALLTYPE d2d_device_SetMaximumColorGlyphCacheMemory(ID2D1Device6 *iface, UINT64 size)
static void STDMETHODCALLTYPE d2d_device_context_DrawRectangle(ID2D1DeviceContext6 *iface, const D2D1_RECT_F *rect, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateInk(ID2D1DeviceContext6 *iface, const D2D1_INK_POINT *start_point, ID2D1Ink **ink)
static HRESULT STDMETHODCALLTYPE d2d_gdi_interop_render_target_ReleaseDC(ID2D1GdiInteropRenderTarget *iface, const RECT *update)
static ULONG STDMETHODCALLTYPE d2d_device_context_inner_AddRef(IUnknown *iface)
static void STDMETHODCALLTYPE d2d_device_context_DrawInk(ID2D1DeviceContext6 *iface, ID2D1Ink *ink, ID2D1Brush *brush, ID2D1InkStyle *ink_style)
static void STDMETHODCALLTYPE d2d_device_context_PushLayer(ID2D1DeviceContext6 *iface, const D2D1_LAYER_PARAMETERS *layer_parameters, ID2D1Layer *layer)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateColorContextFromFilename(ID2D1DeviceContext6 *iface, const WCHAR *filename, ID2D1ColorContext **color_context)
static HRESULT STDMETHODCALLTYPE d2d_device_GetDxgiDevice(ID2D1Device6 *iface, IDXGIDevice **dxgi_device)
static HRESULT WINAPI d2d_device_CreateDeviceContext1(ID2D1Device6 *iface, D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext1 **context)
static HRESULT STDMETHODCALLTYPE d2d_device_context_QueryInterface(ID2D1DeviceContext6 *iface, REFIID iid, void **out)
static HRESULT WINAPI d2d_device_ClearResources(ID2D1Device6 *iface, UINT msec_since_use)
static HRESULT d2d_device_create_device_context(struct d2d_device *device, D2D1_DEVICE_CONTEXT_OPTIONS options, REFIID iid, void **context)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateInkStyle(ID2D1DeviceContext6 *iface, const D2D1_INK_STYLE_PROPERTIES *ink_style_properties, ID2D1InkStyle **ink_style)
static HRESULT d2d_device_context_update_ps_cb(struct d2d_device_context *context, struct d2d_brush *brush, struct d2d_brush *opacity_brush, BOOL outline, BOOL is_arc)
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateGradientMesh(ID2D1DeviceContext6 *iface, const D2D1_GRADIENT_MESH_PATCH *patches, UINT32 patches_count, ID2D1GradientMesh **gradient_mesh)
static HRESULT STDMETHODCALLTYPE d2d_device_context_GetColorBitmapGlyphImage(ID2D1DeviceContext6 *iface, DWRITE_GLYPH_IMAGE_FORMATS glyph_image_format, D2D1_POINT_2F glyph_origin, IDWriteFontFace *font_face, FLOAT font_em_size, UINT16 glyph_index, BOOL is_sideways, const D2D1_MATRIX_3X2_F *world_transform, FLOAT dpi_x, FLOAT dpi_y, D2D1_MATRIX_3X2_F *glyph_transform, ID2D1Image **glyph_image)
HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE type, REFIID riid, IUnknown **ret)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
_ACRTIMP float __cdecl fabsf(float)
@ DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL
@ DWRITE_RENDERING_MODE_OUTLINE
@ DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC
@ DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL
@ DWRITE_RENDERING_MODE_DEFAULT
@ DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC
@ DWRITE_RENDERING_MODE_ALIASED
@ DWRITE_FACTORY_TYPE_SHARED
@ DWRITE_TEXTURE_ALIASED_1x1
@ DWRITE_TEXTURE_CLEARTYPE_3x1
@ DWRITE_GRID_FIT_MODE_DEFAULT
GLint GLint GLint GLint GLint x
GLint GLint GLsizei GLsizei height
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLuint GLuint GLsizei GLenum const GLvoid * indices
GLuint GLenum GLenum transform
GLdouble GLdouble GLdouble GLdouble top
const GLvdpauSurfaceNV * surfaces
GLsizei GLenum GLboolean sink
GLenum GLint GLint * precision
GLenum GLuint GLint GLint layer
GLenum GLenum GLenum input
GLubyte GLubyte GLubyte GLubyte w
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static D3D_DRIVER_TYPE HMODULE UINT const D3D_FEATURE_LEVEL * feature_levels
#define memcpy(s1, s2, n)
static const CLSID * objects[]
D3D11_SHADER_VARIABLE_DESC desc
static const RECT rectangles[]
static const unsigned char metafile[]
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
static void quad(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, GLuint pv)
D2D1_INTERPOLATION_MODE interpolationMode
D2D1_EXTEND_MODE extendModeY
D2D1_EXTEND_MODE extendModeX
D2D1_PIXEL_FORMAT pixelFormat
ID2D1ColorContext * colorContext
D2D1_BITMAP_OPTIONS bitmapOptions
D2D1_PIXEL_FORMAT pixelFormat
D2D1_MATRIX_3X2_F transform
D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode
D2D1_ANTIALIAS_MODE antialiasMode
D2D1_MATRIX_3X2_F transform
D2D1_PRIMITIVE_BLEND primitiveBlend
D2D1_PIXEL_FORMAT pixelFormat
D2D1_STROKE_TRANSFORM_TYPE transformType
BOOL FrontCounterClockwise
BOOL AntialiasedLineEnable
FLOAT SlopeScaledDepthBias
DWRITE_GLYPH_RUN glyphRun
DWRITE_GLYPH_RUN_DESCRIPTION * glyphRunDescription
IDWriteFontFace * fontFace
DWRITE_GLYPH_OFFSET const * glyphOffsets
UINT16 const * glyphIndices
FLOAT const * glyphAdvances
D2D1_BITMAP_OPTIONS options
ID2D1Brush ID2D1Brush_iface
struct d2d_gradient * gradient
D2D1_INTERPOLATION_MODE interpolation_mode
IDWriteRenderingParams * default_text_rendering_params
ID3D11RasterizerState * rs
ID3D11Device1 * d3d_device
ID2D1DeviceContext6 ID2D1DeviceContext6_iface
ID3DDeviceContextState * d3d_state
ID2D1GdiInteropRenderTarget ID2D1GdiInteropRenderTarget_iface
struct d2d_device_context::@231 target
const struct d2d_device_context_ops * ops
struct d2d_device * device
D2D1_RENDER_TARGET_PROPERTIES desc
D2D1_DRAWING_STATE_DESCRIPTION1 drawing_state
struct d2d_shape_resources shape_resources[D2D_SHAPE_TYPE_COUNT]
IDWriteRenderingParams * text_rendering_params
struct d2d_bitmap * bitmap
IDWriteTextRenderer IDWriteTextRenderer_iface
struct d2d_clip_stack clip_stack
bool allow_get_dxgi_device
IDXGIDevice * dxgi_device
ID2D1Device6 ID2D1Device6_iface
D2D1_DRAW_TEXT_OPTIONS options
D2D_MATRIX_3X2_F transform
struct d2d_geometry::@241 fill
struct d2d_geometry::@242 outline
D2D1_GRADIENT_STOP * stops
struct d2d_brush_cb opacity_brush
struct d2d_brush_cb colour_brush
IDWriteRenderingParams * text_rendering_params
D2D1_DRAWING_STATE_DESCRIPTION1 drawing_state
D2D1_STROKE_STYLE_PROPERTIES1 desc
struct d2d_vec4 transform_rtx
struct d2d_vec4 transform_rty
struct d2d_vs_cb::@229 transform_geometry
#define CONTAINING_RECORD(address, type, field)
static const WCHAR props[]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define D2DERR_WRONG_STATE
#define D2DERR_INVALID_CALL
#define D2DERR_TARGET_NOT_GDI_COMPATIBLE
#define D2DERR_INVALID_TARGET
#define D2DERR_INCOMPATIBLE_BRUSH_TYPES