Closed Bug 614832 Opened 9 years ago Closed 9 years ago

Changing orientation causes fennec to stop drawing with opengl

Categories

(Core :: Graphics, defect)

x86
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Tracking Status
fennec 2.0+ ---

People

(Reporter: jrmuizel, Assigned: jrmuizel)

References

Details

Attachments

(5 files, 3 obsolete files)

No description provided.
There are two possible approaches that I see for this:
 1. On resize throw away our layer manager and opengl context. It will be recreated for the new buffer.
 2. Use the new buffer with the existing gl context.

I have prototypes of both approaches, and think I prefer the second one.
Both of these patches break text entry for me.

When typing into the address bar no letters show up, it does still work correctly though.

I think this has to do with the second window triggering a resize and being reset as well. When my onscreen keyboard appears I get a resize for an area half the size of the screen (debugging using glClear to bright green :)
It also makes the phone respond to input slowly. Haven't checked the CPU usage, will try do that in the morning
This version does the resize on draw, perhaps it fixes the text input problem.
Attachment #494052 - Attachment is obsolete: true
My guess is that when we were ignoring the resizes earlier we would get lucky and our buffer would still be valid.
During orientation change we get SurfaceCreated/SurfaceDestroyed events, we should probably use those to renew the EGLSurface instead of hanging off of resize. That way we won't interfere with the text input resizing that happens.
Comment on attachment 495966 [details] [diff] [review]
This should work better

This fix this and bug 613002 for me.
Attached patch refactor EGL surface creation (obsolete) — Splinter Review
This factors CreateSurfaceForWindow() out of CreateForWindow() so that we can reuse it in RenewSurface(). For this to work we also need to factor out CreateConfig(). The QT implementation is also pulled out because it didn't share any code.
Attachment #496233 - Flags: review?(vladimir)
Attachment #496233 - Flags: feedback?(romaxa)
Uses the new RenewSurface() to renew the surface when it is destroyed.
Attachment #496237 - Flags: review?(vladimir)
Duplicate of this bug: 613002
tracking-fennec: --- → ?
Comment on attachment 496237 [details] [diff] [review]
Renew the surface after it's been destroyed

looks fine I think, maybe sans printfs?
Attachment #496237 - Flags: review?(vladimir) → review+
Attachment #496237 - Attachment is obsolete: true
Attachment #496560 - Flags: review?(vladimir)
Assignee: nobody → jmuizelaar
OS: Mac OS X → Android
Comment on attachment 496560 [details] [diff] [review]
Actual cleaned up version I meant to upload

even better!
Attachment #496560 - Flags: review?(vladimir) → review+
Comment on attachment 496233 [details] [diff] [review]
refactor EGL surface creation

some printfs/#if 0s etc in this one also?
Indeed, that was the wrong patch too. Sorry about the mess ups.
Attachment #496233 - Attachment is obsolete: true
Attachment #496771 - Flags: review?(vladimir)
Attachment #496771 - Flags: feedback?
Attachment #496233 - Flags: review?(vladimir)
Attachment #496233 - Flags: feedback?(romaxa)
Attachment #496771 - Flags: feedback? → feedback?(romaxa)
tracking-fennec: ? → 2.0+
Attachment #496771 - Flags: feedback?(romaxa) → feedback+
You need to log in before you can comment on or make changes to this bug.