harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r601344 - /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphics2D.java
Date Wed, 05 Dec 2007 14:33:16 GMT
Author: apetrenko
Date: Wed Dec  5 06:33:14 2007
New Revision: 601344

URL: http://svn.apache.org/viewvc?rev=601344&view=rev
Log:
Patch for HARMONY-5260 "[classlib][awt] Graphics.drawLine method works 
incorretly with in XORMode"

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphics2D.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphics2D.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphics2D.java?rev=601344&r1=601343&r2=601344&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphics2D.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphics2D.java
Wed Dec  5 06:33:14 2007
@@ -33,6 +33,7 @@
 import org.apache.harmony.awt.gl.MultiRectArea;
 import org.apache.harmony.awt.gl.Surface;
 import org.apache.harmony.awt.gl.Utils;
+import org.apache.harmony.awt.gl.XORComposite;
 import org.apache.harmony.awt.gl.font.FontManager;
 import org.apache.harmony.awt.gl.font.LinuxNativeFont;
 import org.apache.harmony.awt.wtk.NativeWindow;
@@ -383,6 +384,19 @@
                     (int) points[0], (int) points[1],
                     (int) points[2], (int) points[3]
             );
+            if (composite instanceof XORComposite) {
+                XORComposite xor = (XORComposite)composite;
+                Color xorcolor = xor.getXORColor();
+                xSetForeground(xorcolor.getRGB());
+                x11.XDrawLine(
+                        display,
+                        drawable,
+                        gc,
+                        (int) points[0], (int) points[1],
+                        (int) points[2], (int) points[3]
+                );
+                xSetForeground(fgColor.getRGB());
+            }
         } else {
             super.drawLine(x1, y1, x2, y2);
         }
@@ -515,6 +529,18 @@
 
     public void drawOval(int x, int y, int width, int height) {
         drawArc(x, y, width, height, 0, 360);
+    }
+
+    @Override
+    public void setXORMode(Color color) {
+        super.setXORMode(color);
+        x11.XSetFunction(display, gc, X11Defs.GXxor);
+        simpleComposite = true;
+    }
+
+    @Override
+    public void setPaintMode() {
+        setComposite(AlphaComposite.SrcOver);
     }
 
     public void setComposite(Composite composite) {



Mime
View raw message