harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor V. Stolyarov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4902) [classlib][awt] GraphicsConfiguration.getColorModel(int transparency) returns wrong ColorModel
Date Thu, 18 Oct 2007 05:23:50 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12535836
] 

Igor V. Stolyarov commented on HARMONY-4902:
--------------------------------------------

Very curiously. It doesn't depend from bit depth. Right ColorModel should return in any case.


Patch alters getColorModel(int transparency) method:

Index: modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphicsConfiguration.java
===================================================================
--- modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphicsConfiguration.java
(revision 585109)
+++ modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphicsConfiguration.java
(working copy)
@@ -248,9 +248,9 @@
             case Transparency.OPAQUE:
                 return getColorModel();
             case Transparency.TRANSLUCENT:
+                return ColorModel.getRGBdefault();
             case Transparency.BITMASK:
-                // Transparency unsupported yet, return default model again
-                return getColorModel();
+                return new DirectColorModel(25, 0xFF0000, 0xFF00, 0xFF, 0x1000000);
             default:
                 // awt.0D=Invalid transparency
                 throw new IllegalArgumentException(Messages.getString("awt.0D")); //$NON-NLS-1$

May be you tied apply not linux patch? :)

Thanks,
Igor

> [classlib][awt] GraphicsConfiguration.getColorModel(int transparency) returns wrong ColorModel
> ----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4902
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4902
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Igor V. Stolyarov
>            Assignee: Alexei Zakharov
>         Attachments: H-4902-lnx.patch, H-4902.patch
>
>
> GraphicsConfiguration.getColorModel(int transparency) returns wrong ColorModel
> Simple reproducer:
> import java.awt.*;
> import java.awt.image.*;
> public class CMTest{
>     public static void main(String argv[]){
>         GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment()
>                         .getDefaultScreenDevice();
>         GraphicsConfiguration gc = gd.getDefaultConfiguration();
>         System.out.println("TRANSLUCENT CM: " + gc.getColorModel(Transparency.TRANSLUCENT));
>         System.out.println("BITMASK CM: " + gc.getColorModel(Transparency.BITMASK));
>         System.out.println("OPAQUE CM: " + gc.getColorModel());
>         GraphicsConfiguration gcs[] = gd.getConfigurations();
>         for(int i = 0; i < gcs.length; i++)
>             System.out.println("CM: " + gcs[i].getColorModel());
>         
>     }
> }
> Output 32 bit display resolution:
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
>  System optimized over throughput (initial strategy singleparpar))
> TRANSLUCENT CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=ff000000
> BITMASK CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=1000000
> OPAQUE CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0
> CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0
> CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0
> CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0
> CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0
> CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0
> CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0
> CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0
> CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0
> CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0
> CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or
its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r581507, (Oct  3 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TRANSLUCENT CM: DirectColorModel: rmask = ff0000 gmask = ff00 bmask = ff amask = ff000000
> BITMASK CM: DirectColorModel: rmask = ff0000 gmask = ff00 bmask = ff amask = ff000000
> OPAQUE CM: DirectColorModel: rmask = ff0000 gmask = ff00 bmask = ff amask = ff000000
> CM: DirectColorModel: rmask = ff0000 gmask = ff00 bmask = ff amask = ff000000
> CM: DirectColorModel: rmask = ff0000 gmask = ff00 bmask = ff amask = 0
> CM: DirectColorModel: rmask = ff0000 gmask = ff00 bmask = ff amask = ff
> CM: null
> CM: DirectColorModel: rmask = ff0000 gmask = ff00 bmask = ff amask = 0
> CM: DirectColorModel: rmask = ff0000 gmask = ff00 bmask = ff amask = ff
> CM: DirectColorModel: rmask = 7c00 gmask = 3e0 bmask = 1f amask = 0
> CM: DirectColorModel: rmask = 7c00 gmask = 3e0 bmask = 1f amask = ff
> CM: DirectColorModel: rmask = 7 gmask = 38 bmask = c0 amask = 0
> CM: DirectColorModel: rmask = 7 gmask = 38 bmask = c0 amask = ff
> CM: DirectColorModel: rmask = 1 gmask = 2 bmask = 4 amask = 0
> CM: DirectColorModel: rmask = 1 gmask = 2 bmask = 4 amask = ff
> Output 16 bit display resolution:
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
>  System optimized over throughput (initial strategy singleparpar))
> TRANSLUCENT CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=ff000000
> BITMASK CM: DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=1000000
> OPAQUE CM: DirectColorModel: rmask=f800 gmask=7e0 bmask=1f amask=0
> CM: DirectColorModel: rmask=f800 gmask=7e0 bmask=1f amask=0
> CM: DirectColorModel: rmask=f800 gmask=7e0 bmask=1f amask=0
> CM: DirectColorModel: rmask=f800 gmask=7e0 bmask=1f amask=0
> CM: DirectColorModel: rmask=f800 gmask=7e0 bmask=1f amask=0
> CM: DirectColorModel: rmask=f800 gmask=7e0 bmask=1f amask=0
> CM: DirectColorModel: rmask=f800 gmask=7e0 bmask=1f amask=0
> CM: DirectColorModel: rmask=f800 gmask=7e0 bmask=1f amask=0
> CM: DirectColorModel: rmask=f800 gmask=7e0 bmask=1f amask=0
> CM: DirectColorModel: rmask=f800 gmask=7e0 bmask=1f amask=0
> CM: DirectColorModel: rmask=f800 gmask=7e0 bmask=1f amask=0
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or
its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r581507, (Oct  3 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TRANSLUCENT CM: DirectColorModel: rmask = f800 gmask = 7e0 bmask = 1f amask = 0
> BITMASK CM: DirectColorModel: rmask = f800 gmask = 7e0 bmask = 1f amask = 0
> OPAQUE CM: DirectColorModel: rmask = f800 gmask = 7e0 bmask = 1f amask = 0
> CM: DirectColorModel: rmask = f800 gmask = 7e0 bmask = 1f amask = 0
> CM: DirectColorModel: rmask = f800 gmask = 7e0 bmask = 1f amask = ff
> CM: null
> CM: DirectColorModel: rmask = ff0000 gmask = ff00 bmask = ff amask = 0
> CM: DirectColorModel: rmask = ff0000 gmask = ff00 bmask = ff amask = ff
> CM: DirectColorModel: rmask = ff0000 gmask = ff00 bmask = ff amask = 0
> CM: DirectColorModel: rmask = ff0000 gmask = ff00 bmask = ff amask = ff
> CM: DirectColorModel: rmask = 7 gmask = 38 bmask = c0 amask = 0
> CM: DirectColorModel: rmask = 7 gmask = 38 bmask = c0 amask = ff
> CM: DirectColorModel: rmask = 1 gmask = 2 bmask = 4 amask = 0
> CM: DirectColorModel: rmask = 1 gmask = 2 bmask = 4 amask = ff

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message