You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Chunrong Lai (JIRA)" <ji...@apache.org> on 2007/08/02 06:22:52 UTC

[jira] Created: (HARMONY-4591) [classlib][awt] 0 bits color model with hardware acceleration?

[classlib][awt] 0 bits color model with hardware acceleration?
--------------------------------------------------------------

                 Key: HARMONY-4591
                 URL: https://issues.apache.org/jira/browse/HARMONY-4591
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: win32
            Reporter: Chunrong Lai



 Swing application may crash in some platforms with info of awt.26B (The number of bits in the pixel values is less than 1) if turning on hardware accelerations.
 I can reproduce this issue in my win32+Sis651 Video card.
 I see that WinGraphicsDevice.getConfigurations return 36 configurations if without hardware accelerations. where 24 of them are enabled later because the other 12 have pixeltype of WindowsDefs.PFD_TYPE_COLORINDEX. If turning on the hardware acceleration I can see 48 configurations totally. I still see 12 of them have pixeltypes of PFD_TYPE_COLORINDEX. However I also see 6 configurations with get_cColorBits() equals to 0 which lead to later exception in creating ColorModel.
 A simple fix is to modify winGraphicsConfiguration.<init> as follows

    private void init(Win32.PIXELFORMATDESCRIPTOR pfd) {
        flags = pfd.get_dwFlags();
        pixelType = pfd.get_iPixelType();
        if ((pixelType & WindowsDefs.PFD_TYPE_COLORINDEX) == WindowsDefs.PFD_TYPE_COLORINDEX) {
            cm = null;
            return;
        }
 
        bits = pfd.get_cColorBits();
+       if (bits == 0) {
+            cm = null;
+            return;
+       }
        redBits = pfd.get_cRedBits();
        .......    
 

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


[jira] Resolved: (HARMONY-4591) [classlib][awt] 0 bits color model with hardware acceleration?

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko resolved HARMONY-4591.
--------------------------------------

    Resolution: Fixed

The patch has been applied.
Please verify.

> [classlib][awt] 0 bits color model with hardware acceleration?
> --------------------------------------------------------------
>
>                 Key: HARMONY-4591
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4591
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: win32
>            Reporter: Chunrong Lai
>            Assignee: Alexey Petrenko
>         Attachments: h4591.patch
>
>
>  Swing application may crash in some platforms with info of awt.26B (The number of bits in the pixel values is less than 1) if turning on hardware accelerations.
>  I can reproduce this issue in my win32+Sis651 Video card.
>  I see that WinGraphicsDevice.getConfigurations return 36 configurations if without hardware accelerations. where 24 of them are enabled later because the other 12 have pixeltype of WindowsDefs.PFD_TYPE_COLORINDEX. If turning on the hardware acceleration I can see 48 configurations totally. I still see 12 of them have pixeltypes of PFD_TYPE_COLORINDEX. However I also see 6 configurations with get_cColorBits() equals to 0 which lead to later exception in creating ColorModel.
>  A simple fix is to modify winGraphicsConfiguration.<init> as follows
>     private void init(Win32.PIXELFORMATDESCRIPTOR pfd) {
>         flags = pfd.get_dwFlags();
>         pixelType = pfd.get_iPixelType();
>         if ((pixelType & WindowsDefs.PFD_TYPE_COLORINDEX) == WindowsDefs.PFD_TYPE_COLORINDEX) {
>             cm = null;
>             return;
>         }
>  
>         bits = pfd.get_cColorBits();
> +       if (bits == 0) {
> +            cm = null;
> +            return;
> +       }
>         redBits = pfd.get_cRedBits();
>         .......    
>  

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


[jira] Updated: (HARMONY-4591) [classlib][awt] 0 bits color model with hardware acceleration?

Posted by "Chunrong Lai (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chunrong Lai updated HARMONY-4591:
----------------------------------

    Attachment: h4591.patch


 Attached is the patch.
 No special treatment for the 0 bits ColorModel is needed in Linux currently because a ColorModel is created only when the configuration is specified to be used so we should not meet such a ColorModel. As a reference in Win32 Harmony creates ColorModel for every configuration at the beginning whetherever they would be used or not. 

> [classlib][awt] 0 bits color model with hardware acceleration?
> --------------------------------------------------------------
>
>                 Key: HARMONY-4591
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4591
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: win32
>            Reporter: Chunrong Lai
>            Assignee: Alexey Petrenko
>         Attachments: h4591.patch
>
>
>  Swing application may crash in some platforms with info of awt.26B (The number of bits in the pixel values is less than 1) if turning on hardware accelerations.
>  I can reproduce this issue in my win32+Sis651 Video card.
>  I see that WinGraphicsDevice.getConfigurations return 36 configurations if without hardware accelerations. where 24 of them are enabled later because the other 12 have pixeltype of WindowsDefs.PFD_TYPE_COLORINDEX. If turning on the hardware acceleration I can see 48 configurations totally. I still see 12 of them have pixeltypes of PFD_TYPE_COLORINDEX. However I also see 6 configurations with get_cColorBits() equals to 0 which lead to later exception in creating ColorModel.
>  A simple fix is to modify winGraphicsConfiguration.<init> as follows
>     private void init(Win32.PIXELFORMATDESCRIPTOR pfd) {
>         flags = pfd.get_dwFlags();
>         pixelType = pfd.get_iPixelType();
>         if ((pixelType & WindowsDefs.PFD_TYPE_COLORINDEX) == WindowsDefs.PFD_TYPE_COLORINDEX) {
>             cm = null;
>             return;
>         }
>  
>         bits = pfd.get_cColorBits();
> +       if (bits == 0) {
> +            cm = null;
> +            return;
> +       }
>         redBits = pfd.get_cRedBits();
>         .......    
>  

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


[jira] Assigned: (HARMONY-4591) [classlib][awt] 0 bits color model with hardware acceleration?

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko reassigned HARMONY-4591:
----------------------------------------

    Assignee: Alexey Petrenko

> [classlib][awt] 0 bits color model with hardware acceleration?
> --------------------------------------------------------------
>
>                 Key: HARMONY-4591
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4591
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: win32
>            Reporter: Chunrong Lai
>            Assignee: Alexey Petrenko
>
>  Swing application may crash in some platforms with info of awt.26B (The number of bits in the pixel values is less than 1) if turning on hardware accelerations.
>  I can reproduce this issue in my win32+Sis651 Video card.
>  I see that WinGraphicsDevice.getConfigurations return 36 configurations if without hardware accelerations. where 24 of them are enabled later because the other 12 have pixeltype of WindowsDefs.PFD_TYPE_COLORINDEX. If turning on the hardware acceleration I can see 48 configurations totally. I still see 12 of them have pixeltypes of PFD_TYPE_COLORINDEX. However I also see 6 configurations with get_cColorBits() equals to 0 which lead to later exception in creating ColorModel.
>  A simple fix is to modify winGraphicsConfiguration.<init> as follows
>     private void init(Win32.PIXELFORMATDESCRIPTOR pfd) {
>         flags = pfd.get_dwFlags();
>         pixelType = pfd.get_iPixelType();
>         if ((pixelType & WindowsDefs.PFD_TYPE_COLORINDEX) == WindowsDefs.PFD_TYPE_COLORINDEX) {
>             cm = null;
>             return;
>         }
>  
>         bits = pfd.get_cColorBits();
> +       if (bits == 0) {
> +            cm = null;
> +            return;
> +       }
>         redBits = pfd.get_cRedBits();
>         .......    
>  

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