HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
draw_context_intf.hpp
1// Copyright Take Vos 2020-2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "gfx_pipeline_box_vulkan_intf.hpp"
8#include "gfx_pipeline_image_vulkan_intf.hpp"
9#include "gfx_pipeline_SDF_vulkan_intf.hpp"
10#include "gfx_pipeline_override_vulkan_intf.hpp"
11#include "../settings/settings.hpp"
12#include "../geometry/geometry.hpp"
13#include "../unicode/unicode.hpp"
14#include "../text/text.hpp"
15#include "../color/color.hpp"
16#include "../container/container.hpp"
17#include "../utility/utility.hpp"
18#include "../macros.hpp"
19
20hi_export_module(hikogui.GFX : draw_context_intf);
21
22hi_export namespace hi { inline namespace v1 {
23class gfx_device;
24class widget_layout;
25
28enum class border_side {
31 on,
32
35 inside,
36
40};
41
42template<typename Context>
43concept draw_attribute = std::same_as<Context, quad_color> or std::same_as<Context, color> or
44 std::same_as<Context, border_side> or std::same_as<Context, line_end_cap> or std::same_as<Context, corner_radii> or
45 std::same_as<Context, aarectangle> or std::same_as<Context, float> or std::same_as<Context, int>;
46
50 unsigned char num_colors = 0;
51 unsigned char num_line_caps = 0;
52
59
65
68 float line_width = 0.0f;
69
72 hi::border_side border_side = hi::border_side::on;
73
77
84
88
92
93 constexpr draw_attributes(draw_attributes const&) noexcept = default;
94 constexpr draw_attributes(draw_attributes&&) noexcept = default;
95 constexpr draw_attributes& operator=(draw_attributes const&) noexcept = default;
96 constexpr draw_attributes& operator=(draw_attributes&&) noexcept = default;
97 constexpr draw_attributes() noexcept = default;
98
119 template<draw_attribute... Args>
120 constexpr draw_attributes(Args const&...args) noexcept
121 {
122 add(args...);
123 }
124
125 constexpr void add() noexcept {}
126
127 template<draw_attribute T>
128 constexpr void add(T const& attribute) noexcept
129 {
130 if constexpr (std::is_same_v<T, quad_color>) {
131 if (num_colors++ == 0) {
132 fill_color = attribute;
133 } else {
134 line_color = attribute;
135 }
136 hi_axiom(num_colors <= 2);
137
138 } else if constexpr (std::is_same_v<T, color>) {
139 if (num_colors++ == 0) {
140 fill_color = quad_color{attribute};
141 } else {
142 line_color = quad_color{attribute};
143 }
144 hi_axiom(num_colors <= 2);
145
146 } else if constexpr (std::is_same_v<T, line_end_cap>) {
147 if (num_line_caps++ == 0) {
148 begin_line_cap = attribute;
149 end_line_cap = attribute;
150 } else {
151 end_line_cap = attribute;
152 }
153 hi_axiom(num_line_caps <= 2);
154
155 } else if constexpr (std::is_same_v<T, hi::border_side>) {
156 border_side = attribute;
157#ifndef NDEBUG
158 hi_assert(not _has_border_side);
159 _has_border_side = true;
160#endif
161
162 } else if constexpr (std::is_same_v<T, corner_radii>) {
163 corner_radius = attribute;
164#ifndef NDEBUG
165 hi_assert(not _has_corner_radii);
166 _has_corner_radii = true;
167#endif
168
169 } else if constexpr (std::is_same_v<T, aarectangle>) {
170 clipping_rectangle = attribute;
171#ifndef NDEBUG
172 hi_assert(not _has_clipping_rectangle);
173 _has_clipping_rectangle = true;
174#endif
175
176 } else if constexpr (std::is_same_v<T, float> or std::is_same_v<T, int>) {
177 line_width = narrow_cast<float>(attribute);
178#ifndef NDEBUG
179 hi_assert(not _has_line_width);
180 _has_line_width = true;
181#endif
182 } else {
183 hi_static_no_default();
184 }
185 }
186
187 template<draw_attribute First, draw_attribute Second, draw_attribute... Rest>
188 constexpr void add(First const& first, Second const& second, Rest const&...rest) noexcept
189 {
190 add(first);
191 add(second, rest...);
192 }
193
194private:
195#ifndef NDEBUG
196 bool _has_border_side = false;
197 bool _has_corner_radii = false;
198 bool _has_clipping_rectangle = false;
199 bool _has_line_width = false;
200#endif
201};
202
203template<typename Context>
204concept draw_quad_shape = std::same_as<Context, quad> or std::same_as<Context, rectangle> or std::same_as<Context, aarectangle> or
205 std::same_as<Context, aarectangle>;
206
210public:
211 gfx_device *device;
212
216
220
223 hi::subpixel_orientation subpixel_orientation;
224
228
231 utc_nanoseconds display_time_point;
232
233 draw_context(draw_context const& rhs) noexcept = default;
234 draw_context(draw_context&& rhs) noexcept = default;
235 draw_context& operator=(draw_context const& rhs) noexcept = default;
236 draw_context& operator=(draw_context&& rhs) noexcept = default;
237 ~draw_context() = default;
238
240 gfx_device& device,
241 vector_span<gfx_pipeline_box::vertex>& box_vertices,
242 vector_span<gfx_pipeline_image::vertex>& image_vertices,
243 vector_span<gfx_pipeline_SDF::vertex>& sdf_vertices,
244 vector_span<gfx_pipeline_override::vertex>& override_vertices) noexcept;
245
248 operator bool() const noexcept
249 {
251 }
252
259 template<std::same_as<widget_layout> WidgetLayout>
260 void draw_box(WidgetLayout const& layout, quad const& box, draw_attributes const& attributes) const noexcept
261 {
262 return _draw_box(
263 layout.clipping_rectangle_on_window(attributes.clipping_rectangle), layout.to_window3() * box, attributes);
264 }
265
272 template<std::same_as<widget_layout> WidgetLayout, draw_quad_shape Shape, draw_attribute... Attributes>
273 void draw_box(WidgetLayout const& layout, Shape const& shape, Attributes const&...attributes) const noexcept
274 {
275 return draw_box(layout, make_quad(shape), draw_attributes{attributes...});
276 }
277
284 template<std::same_as<widget_layout> WidgetLayout>
285 void draw_line(WidgetLayout const& layout, line_segment const& line, draw_attributes const& attributes) const noexcept
286 {
287 auto const box = make_rectangle(line, attributes.line_width, attributes.begin_line_cap, attributes.end_line_cap);
288
289 auto box_attributes = attributes;
290 box_attributes.line_width = 0.0f;
291 box_attributes.corner_radius =
292 make_corner_radii(attributes.line_width, attributes.begin_line_cap, attributes.end_line_cap);
293 return draw_box(layout, box, box_attributes);
294 }
295
302 template<std::same_as<widget_layout> WidgetLayout, draw_attribute... Attributes>
303 void draw_line(WidgetLayout const& layout, line_segment const& line, Attributes const&...attributes) const noexcept
304 {
305 return draw_line(layout, line, draw_attributes{attributes...});
306 }
307
314 template<std::same_as<widget_layout> WidgetLayout>
315 void draw_circle(WidgetLayout const& layout, hi::circle const& circle, draw_attributes const& attributes) const noexcept
316 {
317 auto box_attributes = attributes;
318 box_attributes.corner_radius = make_corner_radii(circle);
319 return draw_box(layout, make_rectangle(circle), box_attributes);
320 }
321
328 template<std::same_as<widget_layout> WidgetLayout, draw_attribute... Attributes>
329 void draw_circle(WidgetLayout const& layout, hi::circle const& circle, Attributes const&...attributes) const noexcept
330 {
331 return draw_circle(layout, circle, draw_attributes{attributes...});
332 }
333
343 template<std::same_as<widget_layout> WidgetLayout>
344 [[nodiscard]] bool
345 draw_image(WidgetLayout const& layout, quad const& box, gfx_pipeline_image::paged_image& image, draw_attributes const& attributes) const noexcept
346 {
347 return _draw_image(layout.clipping_rectangle_on_window(attributes.clipping_rectangle), layout.to_window3() * box, image);
348 }
349
359 template<std::same_as<widget_layout> WidgetLayout, draw_attribute... Attributes>
360 [[nodiscard]] bool
361 draw_image(WidgetLayout const& layout, draw_quad_shape auto const& box, gfx_pipeline_image::paged_image& image, Attributes const&...attributes)
362 const noexcept
363 {
364 return draw_image(layout, make_quad(box), image, draw_attributes{attributes...});
365 }
366
374 template<std::same_as<widget_layout> WidgetLayout>
376 WidgetLayout const& layout,
377 quad const& box,
378 hi::font const& font,
379 glyph_id glyph,
380 draw_attributes const& attributes) const noexcept
381 {
382 return _draw_glyph(
383 layout.clipping_rectangle_on_window(attributes.clipping_rectangle), layout.to_window3() * box, font, glyph, attributes);
384 }
385
393 template<std::same_as<widget_layout> WidgetLayout, draw_quad_shape Shape, draw_attribute... Attributes>
395 WidgetLayout const& layout,
396 Shape const& box,
397 hi::font const& font,
398 hi::glyph_id glyph_id,
399 Attributes const&...attributes) const noexcept
400 {
401 return draw_glyph(layout, make_quad(box), font, glyph_id, draw_attributes{attributes...});
402 }
403
411 template<std::same_as<widget_layout> WidgetLayout>
413 WidgetLayout const& layout,
414 quad const& box,
415 font_book::font_glyph_type const& glyph,
416 draw_attributes const& attributes) const noexcept
417 {
418 return _draw_glyph(
419 layout.clipping_rectangle_on_window(attributes.clipping_rectangle), layout.to_window3() * box, *glyph.font, glyph.id, attributes);
420 }
421
429 template<std::same_as<widget_layout> WidgetLayout, draw_quad_shape Shape, draw_attribute... Attributes>
431 WidgetLayout const& layout,
432 Shape const& box,
433 font_book::font_glyph_type const& glyph,
434 Attributes const&...attributes) const noexcept
435 {
436 return draw_glyph(layout, make_quad(box), *glyph.font, glyph.id, draw_attributes{attributes...});
437 }
438
446 template<std::same_as<widget_layout> WidgetLayout>
447 void
448 draw_text(WidgetLayout const& layout, matrix3 const& transform, text_shaper const& text, draw_attributes const& attributes)
449 const noexcept
450 {
451 return _draw_text(
452 layout.clipping_rectangle_on_window(attributes.clipping_rectangle),
453 layout.to_window3() * transform,
454 text,
455 attributes);
456 }
457
465 template<std::same_as<widget_layout> WidgetLayout, draw_attribute... Attributes>
466 void draw_text(WidgetLayout const& layout, matrix3 const& transform, text_shaper const& text, Attributes const&...attributes)
467 const noexcept
468 {
469 return draw_text(layout, transform, text, draw_attributes{attributes...});
470 }
471
478 template<std::same_as<widget_layout> WidgetLayout, draw_attribute... Attributes>
479 void draw_text(WidgetLayout const& layout, text_shaper const& text, Attributes const&...attributes) const noexcept
480 {
481 return draw_text(layout, matrix3{}, text, draw_attributes{attributes...});
482 }
483
491 template<std::same_as<widget_layout> WidgetLayout>
493 WidgetLayout const& layout,
494 text_shaper const& text,
495 text_selection const& selection,
496 draw_attributes const& attributes) const noexcept
497 {
498 return _draw_text_selection(
499 layout.clipping_rectangle_on_window(attributes.clipping_rectangle), layout.to_window3(), text, selection, attributes);
500 }
501
509 template<std::same_as<widget_layout> WidgetLayout, draw_attribute... Attributes>
511 WidgetLayout const& layout,
512 text_shaper const& text,
513 text_selection const& selection,
514 Attributes const&...attributes) const noexcept
515 {
516 return draw_text_selection(layout, text, selection, draw_attributes{attributes...});
517 }
518
528 template<std::same_as<widget_layout> WidgetLayout>
530 WidgetLayout const& layout,
531 text_shaper const& text,
532 text_cursor cursor,
533 bool overwrite_mode,
534 bool dead_character_mode,
535 draw_attributes const& attributes) const noexcept
536 {
537 return _draw_text_cursors(
538 layout.clipping_rectangle_on_window(attributes.clipping_rectangle),
539 layout.to_window3(),
540 text,
541 cursor,
542 overwrite_mode,
543 dead_character_mode,
544 attributes);
545 }
546
556 template<std::same_as<widget_layout> WidgetLayout, draw_attribute... Attributes>
558 WidgetLayout const& layout,
559 text_shaper const& text,
560 text_cursor cursor,
561 bool overwrite_mode,
562 bool dead_character_mode,
563 Attributes const&...attributes) const noexcept
564 {
565 return draw_text_cursors(layout, text, cursor, overwrite_mode, dead_character_mode, draw_attributes{attributes...});
566 }
567
577 template<std::same_as<widget_layout> WidgetLayout>
578 void draw_hole(WidgetLayout const& layout, quad const& box, draw_attributes attributes) const noexcept
579 {
580 // Override alpha channel.
581 attributes.fill_color = color{0.0f, 0.0f, 0.0f, 0.0f};
582 attributes.line_color = color{0.0f, 0.0f, 0.0f, 1.0f};
583 return _draw_override(
584 layout.clipping_rectangle_on_window(attributes.clipping_rectangle), layout.to_window3() * box, attributes);
585 }
586
596 template<std::same_as<widget_layout> WidgetLayout, draw_quad_shape Shape, draw_attribute... Attributes>
597 void draw_hole(WidgetLayout const& layout, Shape const& box, Attributes const&...attributes) const noexcept
598 {
599 return draw_hole(layout, make_quad(box), draw_attributes{attributes...});
600 }
601
609 template<std::same_as<widget_layout> WidgetLayout>
610 [[nodiscard]] friend bool overlaps(draw_context const& context, WidgetLayout const& layout) noexcept
611 {
612 return overlaps(context.scissor_rectangle, layout.clipping_rectangle_on_window());
613 }
614
615private:
616 vector_span<gfx_pipeline_box::vertex> *_box_vertices;
617 vector_span<gfx_pipeline_image::vertex> *_image_vertices;
618 vector_span<gfx_pipeline_SDF::vertex> *_sdf_vertices;
619 vector_span<gfx_pipeline_override::vertex> *_override_vertices;
620
621 template<draw_quad_shape Shape>
622 [[nodiscard]] constexpr static quad make_quad(Shape const& shape) noexcept
623 {
624 if constexpr (std::is_same_v<Shape, quad>) {
625 return shape;
626 } else {
627 return quad{shape};
628 }
629 }
630
631 [[nodiscard]] constexpr static rectangle
632 make_rectangle(line_segment const& line, float width, line_end_cap c1, line_end_cap c2) noexcept
633 {
634 auto right = line.direction();
635
636 auto const radius = width * 0.5f;
637 auto const n = normal(right, 0.0f);
638 auto const up = n * width;
639 auto const t = normalize(right);
640
641 auto origin = line.origin() - n * radius;
642
643 // Extend the line by the radius for rounded end-caps.
644 auto const radius_offset = t * radius;
645 if (c1 == line_end_cap::round) {
646 origin -= radius_offset;
647 right += radius_offset;
648 }
649 if (c2 == line_end_cap::round) {
650 right += radius_offset;
651 }
652
653 return rectangle{origin, right, up};
654 }
655
656 [[nodiscard]] constexpr static rectangle make_rectangle(hi::circle const& circle) noexcept
657 {
658 auto const circle_ = f32x4{circle};
659 auto const origin = point3{circle_.xyz1() - circle_.ww00()};
660 auto const right = vector3{circle_.w000() * f32x4::broadcast(2.0f)};
661 auto const up = vector3{circle_._0w00() * f32x4::broadcast(2.0f)};
662 return rectangle{origin, right, up};
663 }
664
665 [[nodiscard]] constexpr static corner_radii make_corner_radii(float width, line_end_cap c1, line_end_cap c2) noexcept
666 {
667 auto r = f32x4::broadcast(width * 0.5f);
668
669 if (c1 == line_end_cap::flat) {
670 r = blend<0b0101>(r, f32x4{});
671 }
672 if (c2 == line_end_cap::flat) {
673 r = blend<0b1010>(r, f32x4{});
674 }
675
676 return corner_radii{r};
677 }
678
679 [[nodiscard]] constexpr static corner_radii make_corner_radii(hi::circle const& circle) noexcept
680 {
681 return corner_radii{f32x4{circle}.wwww()};
682 }
683
684 void _draw_override(aarectangle const& clipping_rectangle, quad box, draw_attributes const& attributes) const noexcept;
685
686 void _draw_box(aarectangle const& clipping_rectangle, quad box, draw_attributes const& attributes) const noexcept;
687
688 void _draw_text(
689 aarectangle const& clipping_rectangle,
690 matrix3 const& transform,
691 text_shaper const& text,
692 draw_attributes const& attributes) const noexcept;
693
694 void _draw_text_selection(
695 aarectangle const& clipping_rectangle,
696 matrix3 const& transform,
697 text_shaper const& text,
698 text_selection const& selection,
699 draw_attributes const& attributes) const noexcept;
700
701 void _draw_text_insertion_cursor_empty(
702 aarectangle const& clipping_rectangle,
703 matrix3 const& transform,
704 text_shaper const& text,
705 draw_attributes const& attributes) const noexcept;
706
707 void _draw_text_insertion_cursor(
708 aarectangle const& clipping_rectangle,
709 matrix3 const& transform,
710 text_shaper const& text,
711 text_cursor cursor,
712 bool show_flag,
713 draw_attributes const& attributes) const noexcept;
714
715 void _draw_text_overwrite_cursor(
716 aarectangle const& clipping_rectangle,
717 matrix3 const& transform,
718 text_shaper::char_const_iterator it,
719 draw_attributes const& attributes) const noexcept;
720
721 void _draw_text_cursors(
722 aarectangle const& clipping_rectangle,
723 matrix3 const& transform,
724 text_shaper const& text,
725 text_cursor cursor,
726 bool overwrite_mode,
727 bool dead_character_mode,
728 draw_attributes const& attributes) const noexcept;
729
730 void _draw_glyph(
731 aarectangle const& clipping_rectangle,
732 quad const& box,
733 hi::font const& font,
734 glyph_id glyph,
735 draw_attributes const& attributes) const noexcept;
736
737 [[nodiscard]] bool
738 _draw_image(aarectangle const& clipping_rectangle, quad const& box, gfx_pipeline_image::paged_image const& image) const noexcept;
739};
740
741}} // namespace hi::v1
Defined the color type.
line_end_cap
The way two lines should be joined.
Definition line_end_cap.hpp:21
@ right
Align the text to the right side.
@ flat
The end cap of the line is flat.
@ round
The end cap of the line is round.
@ rectangle
The gui_event has rectangle data.
The HikoGUI namespace.
Definition array_generic.hpp:20
border_side
The side where the border is drawn.
Definition draw_context_intf.hpp:28
@ inside
The border is drawn inside the edge of a quad.
@ outside
The border is drawn outside the edge of a quad.
@ on
The border is drawn on the edge of a quad.
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
This is a RGBA floating point color.
Definition color_intf.hpp:49
A color for each corner of a quad.
Definition quad_color.hpp:22
Class which represents an axis-aligned rectangle.
Definition aarectangle.hpp:33
static constexpr aarectangle large() noexcept
Create a large axis aligned rectangle.
Definition aarectangle.hpp:46
A type defining a 2D circle.
Definition circle.hpp:23
The 4 radii of the corners of a quad or rectangle.
Definition corner_radii.hpp:26
Line segment.
Definition line_segment.hpp:26
A 2D or 3D homogenius matrix for transforming homogenious vectors and points.
Definition matrix3.hpp:36
The draw attributes used to draw shaped into the draw context.
Definition draw_context_intf.hpp:49
aarectangle clipping_rectangle
The rectangle used the clip the shape when drawing.
Definition draw_context_intf.hpp:83
hi::border_side border_side
The side on which side of the edge of a shape the border should be drawn.
Definition draw_context_intf.hpp:72
float line_width
The width of a line, or the width of a border.
Definition draw_context_intf.hpp:68
line_end_cap end_line_cap
The shape of the beginning of a line.
Definition draw_context_intf.hpp:91
quad_color fill_color
The fill color used for the color of a box inside the border.
Definition draw_context_intf.hpp:58
quad_color line_color
The line color used for the color of the border of the box.
Definition draw_context_intf.hpp:64
line_end_cap begin_line_cap
The shape of the beginning of a line.
Definition draw_context_intf.hpp:87
hi::corner_radii corner_radius
The radii of each corner of a quad.
Definition draw_context_intf.hpp:76
Draw context for drawing using the HikoGUI shaders.
Definition draw_context_intf.hpp:209
void draw_glyph(WidgetLayout const &layout, quad const &box, font_book::font_glyph_type const &glyph, draw_attributes const &attributes) const noexcept
Draw a glyph.
Definition draw_context_intf.hpp:412
void draw_text(WidgetLayout const &layout, text_shaper const &text, Attributes const &...attributes) const noexcept
Draw shaped text.
Definition draw_context_intf.hpp:479
void draw_circle(WidgetLayout const &layout, hi::circle const &circle, Attributes const &...attributes) const noexcept
Draw a circle.
Definition draw_context_intf.hpp:329
void draw_text_cursors(WidgetLayout const &layout, text_shaper const &text, text_cursor cursor, bool overwrite_mode, bool dead_character_mode, Attributes const &...attributes) const noexcept
Draw text cursors of shaped text.
Definition draw_context_intf.hpp:557
hi::subpixel_orientation subpixel_orientation
The subpixel orientation for rendering glyphs.
Definition draw_context_intf.hpp:223
friend bool overlaps(draw_context const &context, WidgetLayout const &layout) noexcept
Checks if a widget's layout overlaps with the part of the window that is being drawn.
Definition draw_context_intf.hpp:610
void draw_box(WidgetLayout const &layout, Shape const &shape, Attributes const &...attributes) const noexcept
Draw a box.
Definition draw_context_intf.hpp:273
bool draw_image(WidgetLayout const &layout, draw_quad_shape auto const &box, gfx_pipeline_image::paged_image &image, Attributes const &...attributes) const noexcept
Draw an image.
Definition draw_context_intf.hpp:361
void draw_hole(WidgetLayout const &layout, quad const &box, draw_attributes attributes) const noexcept
Make a hole in the user interface.
Definition draw_context_intf.hpp:578
void draw_circle(WidgetLayout const &layout, hi::circle const &circle, draw_attributes const &attributes) const noexcept
Draw a circle.
Definition draw_context_intf.hpp:315
float saturation
The tone-mapper's saturation.
Definition draw_context_intf.hpp:227
void draw_text(WidgetLayout const &layout, matrix3 const &transform, text_shaper const &text, Attributes const &...attributes) const noexcept
Draw shaped text.
Definition draw_context_intf.hpp:466
void draw_glyph(WidgetLayout const &layout, Shape const &box, hi::font const &font, hi::glyph_id glyph_id, Attributes const &...attributes) const noexcept
Draw a glyph.
Definition draw_context_intf.hpp:394
void draw_text_selection(WidgetLayout const &layout, text_shaper const &text, text_selection const &selection, draw_attributes const &attributes) const noexcept
Draw text-selection of shaped text.
Definition draw_context_intf.hpp:492
aarectangle scissor_rectangle
This is the rectangle of the window that is being redrawn.
Definition draw_context_intf.hpp:219
void draw_line(WidgetLayout const &layout, line_segment const &line, Attributes const &...attributes) const noexcept
Draw a line.
Definition draw_context_intf.hpp:303
void draw_glyph(WidgetLayout const &layout, Shape const &box, font_book::font_glyph_type const &glyph, Attributes const &...attributes) const noexcept
Draw a glyph.
Definition draw_context_intf.hpp:430
std::size_t frame_buffer_index
The frame buffer index of the image we are currently rendering.
Definition draw_context_intf.hpp:215
void draw_hole(WidgetLayout const &layout, Shape const &box, Attributes const &...attributes) const noexcept
Make a hole in the user interface.
Definition draw_context_intf.hpp:597
void draw_text_cursors(WidgetLayout const &layout, text_shaper const &text, text_cursor cursor, bool overwrite_mode, bool dead_character_mode, draw_attributes const &attributes) const noexcept
Draw text cursors of shaped text.
Definition draw_context_intf.hpp:529
void draw_line(WidgetLayout const &layout, line_segment const &line, draw_attributes const &attributes) const noexcept
Draw a line.
Definition draw_context_intf.hpp:285
bool draw_image(WidgetLayout const &layout, quad const &box, gfx_pipeline_image::paged_image &image, draw_attributes const &attributes) const noexcept
Draw an image.
Definition draw_context_intf.hpp:345
void draw_text_selection(WidgetLayout const &layout, text_shaper const &text, text_selection const &selection, Attributes const &...attributes) const noexcept
Draw text-selection of shaped text.
Definition draw_context_intf.hpp:510
void draw_glyph(WidgetLayout const &layout, quad const &box, hi::font const &font, glyph_id glyph, draw_attributes const &attributes) const noexcept
Draw a glyph.
Definition draw_context_intf.hpp:375
void draw_box(WidgetLayout const &layout, quad const &box, draw_attributes const &attributes) const noexcept
Draw a box.
Definition draw_context_intf.hpp:260
utc_nanoseconds display_time_point
The time when the drawing will appear on the screen.
Definition draw_context_intf.hpp:231
void draw_text(WidgetLayout const &layout, matrix3 const &transform, text_shaper const &text, draw_attributes const &attributes) const noexcept
Draw shaped text.
Definition draw_context_intf.hpp:448
This is a image that is uploaded into the texture atlas.
Definition gfx_pipeline_image_vulkan_intf.hpp:83
Definition draw_context_intf.hpp:43
Definition draw_context_intf.hpp:204
T max(T... args)