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

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

     [ 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.