[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 6da021fce8: Fix artifacting on PGTK when bits are copied with an
From: |
Po Lu |
Subject: |
master 6da021fce8: Fix artifacting on PGTK when bits are copied with an alpha channel |
Date: |
Mon, 31 Jan 2022 08:13:52 -0500 (EST) |
branch: master
commit 6da021fce86a06a97b0bff76f69aa57759533dc9
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix artifacting on PGTK when bits are copied with an alpha channel
* src/pgtkterm.c (x_draw_stretch_glyph_string): Draw background
respecting `alpha-background'.
(pgtk_copy_bits): Use CAIRO_OPERATOR_SOURCE to draw onto the
destination surface.
---
src/pgtkterm.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 9bb611e4c5..c0b76b077c 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -2381,7 +2381,7 @@ x_draw_stretch_glyph_string (struct glyph_string *s)
else
{
pgtk_fill_rectangle (s->f, color, x, y, w, h,
- false);
+ true);
}
pgtk_end_cr_clip (s->f);
@@ -2966,17 +2966,20 @@ pgtk_draw_window_cursor (struct window *w, struct
glyph_row *glyph_row, int x,
}
static void
-pgtk_copy_bits (struct frame *f, cairo_rectangle_t * src_rect,
- cairo_rectangle_t * dst_rect)
+pgtk_copy_bits (struct frame *f, cairo_rectangle_t *src_rect,
+ cairo_rectangle_t *dst_rect)
{
cairo_t *cr;
+ GdkWindow *window;
cairo_surface_t *surface; /* temporary surface */
+ window = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
+
surface =
- cairo_surface_create_similar (FRAME_CR_SURFACE (f),
- CAIRO_CONTENT_COLOR_ALPHA,
- (int) src_rect->width,
- (int) src_rect->height);
+ gdk_window_create_similar_surface (window, CAIRO_CONTENT_COLOR_ALPHA,
+ FRAME_CR_SURFACE_DESIRED_WIDTH (f),
+ FRAME_CR_SURFACE_DESIRED_HEIGHT
+ (f));
cr = cairo_create (surface);
cairo_set_source_surface (cr, FRAME_CR_SURFACE (f), -src_rect->x,
@@ -2988,6 +2991,7 @@ pgtk_copy_bits (struct frame *f, cairo_rectangle_t *
src_rect,
cr = pgtk_begin_cr_clip (f);
cairo_set_source_surface (cr, surface, dst_rect->x, dst_rect->y);
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_rectangle (cr, dst_rect->x, dst_rect->y, dst_rect->width,
dst_rect->height);
cairo_clip (cr);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 6da021fce8: Fix artifacting on PGTK when bits are copied with an alpha channel,
Po Lu <=