Closed
Bug 1049887
Opened 10 years ago
Closed 10 years ago
gl::ScopedScissorRect doesn't properly restore scissor rect after Fennec Java code modifies it
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: kats, Assigned: kats)
Details
Attachments
(1 file, 2 obsolete files)
12.47 KB,
patch
|
snorp
:
review+
|
Details | Diff | Splinter Review |
The code at [1] is intended to save the current scissor rect and restore it at the end of the function, so as to guard against changes in the java code at [2]. However, this doesn't work. When the ScopedScissorRect is created, it reads the current scissor rect, which GLContext.h actually provides from the internally-cached mScissorRect [3]. That's fine. When the ScopedScissorRect is destroyed though, it calls fScissor which then compares the value to the cached value and does an early return at [4]. So even though the Java code modifies the scissor rect directly in the GL context, the ScopedScissorRect and GLContext don't know about this, and so don't think it needs to be restored. [1] http://mxr.mozilla.org/mozilla-central/source/widget/android/nsWindow.cpp?rev=8581ea023552#2267 [2] http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/gfx/LayerRenderer.java?rev=0a020e033338#598 [3] http://mxr.mozilla.org/mozilla-central/source/gfx/gl/GLContext.h?rev=ff07dcb918fd#1157 [4] http://mxr.mozilla.org/mozilla-central/source/gfx/gl/GLContext.h?rev=ff07dcb918fd#1494
Assignee | ||
Comment 1•10 years ago
|
||
Assignee: nobody → bugmail.mozilla
Attachment #8468773 -
Flags: review?(bjacob)
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8468774 -
Flags: review?(bjacob)
Assignee | ||
Comment 3•10 years ago
|
||
try |
Try push at https://tbpl.mozilla.org/?tree=Try&rev=c090fcbdd201 includes the fix patch.
Comment 4•10 years ago
|
||
I find it very scary to have to add this bool flag here, because if we can't assume that we're the only ones making GL calls on this GL context, then many other assumptions made in GLContext are wrong. Why does the GL work in [2] have to be made in java? Can't it be made in C++ code going through GLContext instead?
Flags: needinfo?(bugmail.mozilla)
Comment 5•10 years ago
|
||
Or if GL state changes have to be made direcly in Java, at least restore state locally in that Java code before reverting back to C++ code.
Assignee | ||
Comment 6•10 years ago
|
||
Comment on attachment 8468773 [details] [diff] [review] Patch OK, I'll look at other options here.
Attachment #8468773 -
Flags: review?(bjacob) → review-
Flags: needinfo?(bugmail.mozilla)
Assignee | ||
Updated•10 years ago
|
Attachment #8468774 -
Flags: review?(bjacob)
Assignee | ||
Comment 7•10 years ago
|
||
How about this?
Attachment #8468773 -
Attachment is obsolete: true
Attachment #8468774 -
Attachment is obsolete: true
Attachment #8475165 -
Flags: review?(bjacob)
Assignee | ||
Comment 8•10 years ago
|
||
(Feel free to bounce the review to snorp if you think he's a more appropriate reviewer)
Comment 9•10 years ago
|
||
Comment on attachment 8475165 [details] [diff] [review] Reset GL state in java before returning to c++ Review of attachment 8475165 [details] [diff] [review]: ----------------------------------------------------------------- Yes, snorp may be a more appropriate reviewer for this, since this turned out to be a patch in Android-specific code. Also, I'm totally swamped (just moved to a new house, on top of lots of work).
Attachment #8475165 -
Flags: review?(bjacob) → review?(snorp)
Comment 10•10 years ago
|
||
Comment on attachment 8475165 [details] [diff] [review] Reset GL state in java before returning to c++ Review of attachment 8475165 [details] [diff] [review]: ----------------------------------------------------------------- Ugh. I really wish we could ditch all the Java GL code.
Attachment #8475165 -
Flags: review?(snorp) → review+
Assignee | ||
Comment 11•10 years ago
|
||
Yeah it is kind of annoying. https://hg.mozilla.org/integration/fx-team/rev/d60356c72b78
Comment 12•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d60356c72b78
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in
before you can comment on or make changes to this bug.
Description
•