mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +09:00
Bug 1875345 - Report 24 instead of 32 as the colorDepth (and pixelDepth) on Linux (assuming 8 of 32 bits are for the alpha channel).
This now matches the logic in our equivalent Windows code, and this is
also per spec ("number of bits...excluding the alpha channel"):
https://drafts.csswg.org/cssom-view/#dom-screen-colordepth
With this change, the WPT test starts passing on Ubuntu 22.04
(which was previously flagged as an unexpected failure).
This commit is contained in:
parent
bd734f795c
commit
e3de626c1f
1 changed files with 8 additions and 4 deletions
|
|
@ -97,17 +97,21 @@ NS_IMETHODIMP
|
|||
nsScreenGtk :: GetPixelDepth(int32_t *aPixelDepth)
|
||||
{
|
||||
GdkVisual * visual = gdk_screen_get_system_visual(gdk_screen_get_default());
|
||||
*aPixelDepth = gdk_visual_get_depth(visual);
|
||||
|
||||
uint32_t pixelDepth = gdk_visual_get_depth(visual);
|
||||
if (pixelDepth == 32) {
|
||||
// If a device reports 32 bits per pixel, it's still only using 8 bits
|
||||
// per color component, which is what our callers want to know.
|
||||
// (Some devices report 32 and some devices report 24, because Linux)
|
||||
pixelDepth = 24;
|
||||
}
|
||||
*aPixelDepth = pixelDepth;
|
||||
return NS_OK;
|
||||
|
||||
} // GetPixelDepth
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScreenGtk :: GetColorDepth(int32_t *aColorDepth)
|
||||
{
|
||||
return GetPixelDepth ( aColorDepth );
|
||||
|
||||
} // GetColorDepth
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue