Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 51222 invoked from network); 9 Sep 2007 09:08:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Sep 2007 09:08:50 -0000 Received: (qmail 8019 invoked by uid 500); 9 Sep 2007 09:08:44 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 7992 invoked by uid 500); 9 Sep 2007 09:08:44 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 7983 invoked by uid 99); 9 Sep 2007 09:08:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Sep 2007 02:08:44 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Sep 2007 09:08:50 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B7A0071403F for ; Sun, 9 Sep 2007 02:08:29 -0700 (PDT) Message-ID: <295282.1189328909733.JavaMail.jira@brutus> Date: Sun, 9 Sep 2007 02:08:29 -0700 (PDT) From: "Igor V. Stolyarov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-4741) [classlib][awt] Graphics XORMode drawing doesn't implemented In-Reply-To: <31316907.1188974552953.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-4741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor V. Stolyarov updated HARMONY-4741: --------------------------------------- Attachment: H-4741.patch Attached patch contains implementation XORMode drawing for Component's and BufferedImage's Graphics. Implementation notes: According to Specification, the setXORMode(Color xorcolor) method is implemented as a convenience method to set a special Composite object that ignores the Alpha components of source colors and sets the destination color to the value: dstpixel = (PixelOf(srccolor) ^ PixelOf(xorcolor) ^ dstpixel); But black box testing shows - Alpha components of source colors don't ignore. If SRC Alpha component < 128, pixel considers as fully transparent and it doesn't draw and pixel considers opaque in other cases and drawing XOR composite of SRC, DST and XOR Color. Our implementation works the same way as RI implementation. > [classlib][awt] Graphics XORMode drawing doesn't implemented > ------------------------------------------------------------ > > Key: HARMONY-4741 > URL: https://issues.apache.org/jira/browse/HARMONY-4741 > Project: Harmony > Issue Type: Bug > Reporter: Igor V. Stolyarov > Attachments: H-4741.patch, Harmony.JPG, RI.JPG > > > Graphics XORMode drawing doesn't implemented > Simple reproducer: > import java.awt.*; > import java.awt.image.BufferedImage; > import java.awt.event.*; > import javax.swing.JFrame; > public class XORModeTest { > public static void main(String[] args) { > final Font font = new Font("Dialog",Font.PLAIN, 12); > JFrame f = new JFrame("XORModeTest"){ > public void paint(Graphics g){ > Graphics2D g2d = (Graphics2D)g; > BufferedImage bi = new BufferedImage(200,200,BufferedImage.TYPE_INT_ARGB); > Graphics2D g2 = bi.createGraphics(); > g2.setFont(font); > g2.setColor(Color.green); > g2.fillRect(30, 30, 100, 100); > g2.setColor(Color.red); > g2.drawString("Test", 50, 80); > g2d.setXORMode(Color.blue); > g2d.drawImage(bi,0,0,null); > } > }; > > f.setBounds(0, 0, 300, 300); > f.setVisible(true); > f.addWindowListener(new WindowAdapter() { > public void windowClosing(WindowEvent ev) { > System.exit(0); > } > }); > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.