summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2020-11-14 22:46:43 +0100
committerChristian Persch <chpe@src.gnome.org>2020-11-14 22:46:43 +0100
commit4719a9a7752d621e5a5c23e208c1e970fd416ebf (patch)
tree940895417b66a8a357e8191bce71e4a0dfad71a6
parent9bf650c7848562d8be046b8199371c8accd7d132 (diff)
downloadvte-wip/mosaic.tar.gz
emulation: Add new SGR and implementation for separated mosaicswip/mosaic
-rw-r--r--src/attr.hh1
-rw-r--r--src/minifont.cc7
2 files changed, 2 insertions, 6 deletions
diff --git a/src/attr.hh b/src/attr.hh
index 646d86d9..178aa7ef 100644
--- a/src/attr.hh
+++ b/src/attr.hh
@@ -18,6 +18,7 @@
#pragma once
#include <cstdint>
+#include <glib.h>
#define VTE_ATTR_VALUE_MASK(bits) ((1U << (bits)) - 1U)
#define VTE_ATTR_MASK(shift,bits) (VTE_ATTR_VALUE_MASK(bits) << (shift))
diff --git a/src/minifont.cc b/src/minifont.cc
index 5d106200..62f1be33 100644
--- a/src/minifont.cc
+++ b/src/minifont.cc
@@ -22,10 +22,10 @@
#include <cairo.h>
+#include "attr.hh"
#include "drawing-cairo.hh"
#include "minifont.hh"
-#ifdef WITH_SEPARATED_MOSAICS
static bool
_vte_draw_is_separable_mosaic(vteunistr c)
{
@@ -116,7 +116,6 @@ create_mosaic_separation_pattern(int width,
return pattern;
}
-#endif /* WITH_SEPARATED_MOSAICS */
/* pixman data must have stride 0 mod 4 */
static unsigned char const hatching_pattern_lr_data[16] = {
@@ -277,11 +276,9 @@ Minifont::draw_graphic(DrawingContext const& context,
xright = x + width;
ybottom = y + height;
-#ifdef WITH_SEPARATED_MOSAICS
auto const separated = vte_attr_get_bool(attr, VTE_ATTR_SEPARATED_MOSAIC_SHIFT) &&_vte_draw_is_separable_mosaic(c);
if (separated)
cairo_push_group(cr);
-#endif
switch (c) {
@@ -1206,14 +1203,12 @@ Minifont::draw_graphic(DrawingContext const& context,
g_assert_not_reached();
}
-#ifdef WITH_SEPARATED_MOSAICS
if (separated) {
cairo_pop_group_to_source(cr);
auto pattern = create_mosaic_separation_pattern(width, height, light_line_width);
cairo_mask(cr, pattern);
cairo_pattern_destroy(pattern);
}
-#endif
cairo_restore(cr);
}