Confused about PixelFormat

前端 未结 3 1485
孤街浪徒
孤街浪徒 2021-02-02 00:00

I\'m confused about PixelFormat on Android.

My device is Motorola Defy.

I have two questions:

  • On Android 2.3 getWindowManager().getDefaultDi
3条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-02 00:29

    RGBA_8888 corresponds to 1 as can be seen in the annex below.

    If you go to the code related to mPixelFormat you find the following.

    // Following fields are initialized from native code
    private int mPixelFormat;
    

    That means that for some reason your device is being treated as RGB_565 due to an OS decision more than hardware capabilities. Actually, that makes me feel curious.

    Interestingly enough descriptions of Galaxy Nexus and Nexus 7 don't feel to have too much in common. GN N7

    public static final int RGBA_8888   = 1;
    public static final int RGBX_8888   = 2;
    public static final int RGB_888     = 3;
    public static final int RGB_565     = 4;
    
    @Deprecated
    public static final int RGBA_5551   = 6;
    @Deprecated
    public static final int RGBA_4444   = 7;
    public static final int A_8         = 8;
    public static final int L_8         = 9;
    @Deprecated
    public static final int LA_88       = 0xA;
    @Deprecated
    public static final int RGB_332     = 0xB;
    

提交回复
热议问题