emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master bb7623b9be: Fix subpixel AA with alpha-background on Cairo on X


From: Po Lu
Subject: master bb7623b9be: Fix subpixel AA with alpha-background on Cairo on X
Date: Fri, 8 Apr 2022 20:41:34 -0400 (EDT)

branch: master
commit bb7623b9bee14bf428accc5b8cc88fa34fd9c9a2
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix subpixel AA with alpha-background on Cairo on X
    
    * xterm.c (x_set_cr_source_with_gc_foreground)
    (x_set_cr_source_with_gc_background): Set operator back to OVER
    if alpha-background isn't to be respected.
---
 src/xterm.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index dc06df246c..da67173186 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4240,8 +4240,11 @@ x_set_cr_source_with_gc_foreground (struct frame *f, GC 
gc,
       cairo_set_operator (FRAME_CR_CONTEXT (f), CAIRO_OPERATOR_SOURCE);
     }
   else
-    cairo_set_source_rgb (FRAME_CR_CONTEXT (f), color.red / 65535.0,
-                          color.green / 65535.0, color.blue / 65535.0);
+    {
+      cairo_set_source_rgb (FRAME_CR_CONTEXT (f), color.red / 65535.0,
+                           color.green / 65535.0, color.blue / 65535.0);
+      cairo_set_operator (FRAME_CR_CONTEXT (f), CAIRO_OPERATOR_OVER);
+    }
 }
 
 void
@@ -4269,8 +4272,11 @@ x_set_cr_source_with_gc_background (struct frame *f, GC 
gc,
       cairo_set_operator (FRAME_CR_CONTEXT (f), CAIRO_OPERATOR_SOURCE);
     }
   else
-    cairo_set_source_rgb (FRAME_CR_CONTEXT (f), color.red / 65535.0,
-                          color.green / 65535.0, color.blue / 65535.0);
+    {
+      cairo_set_source_rgb (FRAME_CR_CONTEXT (f), color.red / 65535.0,
+                           color.green / 65535.0, color.blue / 65535.0);
+      cairo_set_operator (FRAME_CR_CONTEXT (f), CAIRO_OPERATOR_OVER);
+    }
 }
 
 static const cairo_user_data_key_t xlib_surface_key, saved_drawable_key;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]