1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef MOZILLA_GFX_WPF_GPU_RASTER_H
8 #define MOZILLA_GFX_WPF_GPU_RASTER_H
15 enum class FillMode
{ EvenOdd
, Winding
};
21 constexpr uint8_t PathPointTypeStart
= 0;
22 constexpr uint8_t PathPointTypeLine
= 1;
23 constexpr uint8_t PathPointTypeBezier
= 3;
24 constexpr uint8_t PathPointTypePathTypeMask
= 0x07;
25 constexpr uint8_t PathPointTypeCloseSubpath
= 0x80;
44 PathBuilder
* wgr_new_builder();
45 void wgr_builder_reset(PathBuilder
* pb
);
46 void wgr_builder_move_to(PathBuilder
* pb
, float x
, float y
);
47 void wgr_builder_line_to(PathBuilder
* pb
, float x
, float y
);
48 void wgr_builder_curve_to(PathBuilder
* pb
, float c1x
, float c1y
, float c2x
,
49 float c2y
, float x
, float y
);
50 void wgr_builder_quad_to(PathBuilder
* pb
, float cx
, float cy
, float x
, float y
);
51 void wgr_builder_close(PathBuilder
* pb
);
52 void wgr_builder_set_fill_mode(PathBuilder
* pb
, FillMode fill_mode
);
53 Path
wgr_builder_get_path(PathBuilder
* pb
);
54 VertexBuffer
wgr_path_rasterize_to_tri_list(
55 const Path
* p
, int32_t clip_x
, int32_t clip_y
, int32_t clip_width
,
56 int32_t clip_height
, bool need_inside
= true, bool need_outside
= false,
57 bool rasterization_truncates
= false, OutputVertex
* output_ptr
= nullptr,
58 size_t output_capacity
= 0);
59 void wgr_path_release(Path p
);
60 void wgr_vertex_buffer_release(VertexBuffer vb
);
61 void wgr_builder_release(PathBuilder
* pb
);
66 #endif // MOZILLA_GFX_WPF_GPU_RASTER_H