Closed Bug 734081 Opened 8 years ago Closed 8 years ago

Check pixel depth when choosing config on egl

Categories

(Core :: Graphics, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: mwu, Assigned: mwu)

References

Details

Attachments

(1 file)

Turns out the Nexus S gets upset when we try to use 16bit surfaces on B2G.

Android is fixed at 16bit but I think they all support 16bit anyway. I can switch to proper detection if someone finds a way to do it. However, the docs say: "By default GLSurfaceView chooses a EGLConfig that has an RGB_565 pixel format, with at least a 16-bit depth buffer and no stencil." so we should be ok forcing 16bit.
Attachment #604063 - Flags: review?(jones.chris.g)
Comment on attachment 604063 [details] [diff] [review]
Check pixel depth when choosing config on egl

>diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp

>+    nsCOMPtr<nsIScreenManager> screenMgr = do_GetService("@mozilla.org/gfx/screenmanager;1");
>+    nsCOMPtr<nsIScreen> screen;
>+    screenMgr->GetPrimaryScreen(getter_AddRefs(screen));
>+    PRInt32 depth = 24;
>+    screen->GetColorDepth(&depth);
> 

Yay XPCOM!

Does this work on akami/maguro?
Attachment #604063 - Flags: review?(jones.chris.g) → review+
(In reply to Chris Jones [:cjones] [:warhammer] from comment #1)
> Yay XPCOM!
> 

:(

> Does this work on akami/maguro?

Yeah I checked and my akami picks a 16bit surface.
https://hg.mozilla.org/integration/mozilla-inbound/rev/d5222ee0a6dc

Offending reftest disabled on Android.
https://hg.mozilla.org/mozilla-central/rev/d5222ee0a6dc
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Depends on: 734625
Depends on: 734762
Depends on: 736005
You need to log in before you can comment on or make changes to this bug.