Closed Bug 1187619 Opened 5 years ago Closed 5 years ago

Graphics corruption when scrolling

Categories

(Core :: Graphics: Layers, defect, major)

42 Branch
x86
Windows 7
defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla42
Tracking Status
firefox41 --- unaffected
firefox42 + fixed

People

(Reporter: jmjjeffery, Assigned: jnicol)

References

Details

(Keywords: regression)

Attachments

(4 files, 1 obsolete file)

Good build:
20150723030207 1f77b78797d6N
Bad build:
20150723030319 ea320711a2e3

I suspect that maybe bug https://bugzilla.mozilla.org/show_bug.cgi?id=1186004 caused the issue.

STR:
1. open http://forums.mozillazine.org/viewforum.php?f=23
2. Scroll to bottom of page
3. put the cursor over the 'blue border edge'
4. Using scroll-wheel quickly scroll upward
5. Note blue flash, which may stick at times, (may have to try to a few times to see the problem.)

Also may be possible that https://bugzilla.mozilla.org/show_bug.cgi?id=1176077 caused the issue, even though that appears to be a 'fennec patch', still its on m-c.

I have not learned to use mozregress for testing, and not having any luck finding the right build to test with on m-i.
turning off HWA seems to work-around the problem.  Not sure that's the best option however since it works up till the bad build.
It definitely makes sense that my commit would have caused this type of problem, but I unfortunately cannot reproduce. By "blue border edge" do you mean the border around the list of forum topics? Would it be possible to attach a screenshot of the corruption so I know what I'm looking for? Just in case I am actually reproducing but not noticing. What about:config setting toggles it on or off - "layers.acceleration.disabled"?
Flags: needinfo?(jmjeffery)
[Tracking Requested - why for this release]: Regression
Severity: normal → major
Attached image fxcorruption.jpg
See attached for corruption that occurs when scrolling.
Flags: needinfo?(jmjeffery)
(In reply to Jamie Nicol [:jnicol] from comment #4)
> It definitely makes sense that my commit would have caused this type of
> problem, but I unfortunately cannot reproduce. By "blue border edge" do you
> mean the border around the list of forum topics? Would it be possible to
> attach a screenshot of the corruption so I know what I'm looking for? Just
> in case I am actually reproducing but not noticing. What about:config
> setting toggles it on or off - "layers.acceleration.disabled"?


Yes, the blue border around the forum topics.  Seems to occur most often if you quickly scroll upward from the bottom of the page. 

I will post again shortly after I test with pref flip...Have to leave for a couple of hours.
I've noticed "missing rectangles" when scrolling comment sections of Reddit or patches (in the 'edit' view) in Bugzilla. These rectangles of missing text have the color of the current background. I haven't seen the problem on Mozillazine or with such a large rectangle, but it sounds like the same problem.

In the case of Reddit and Bugzilla, *selecting* the text in the square makes it show back up, as though it were a spoiler tag.
Oh, and I'm not using e10s. It looks a 'missing tile', though tiling is disabled (I guess any rectangular region would end up looking like a tile though).
Flipping pref "layers.acceleration.disabled" seems to fix the issue.  I'm unable to re-create the corruption with this disabled.
This will occur when the first call to FrameLayerBuilder::DrawPaintedLayer() of a frame isn't passed the full dirty region correctly. This will cause it to incorrectly decide some items are invisible, so it will not paint them on subsequent calls to DrawPaintedLayer(). I don't know why my code calculates the dirty region incorrectly, though.
Emanuel: Does setting "layers.acceleration.disabled" to true also fix the problem for you?
Emanuel and Jim: could you please attach your about:support information? Thanks.
Flags: needinfo?(jmjeffery)
Flags: needinfo?(emanuel.hoogeveen)
Attached file about:support data
(In reply to Jamie Nicol [:jnicol] from comment #12)
> Emanuel: Does setting "layers.acceleration.disabled" to true also fix the
> problem for you?

It seems, to, yes. I haven't seen the problem with that set to false, and I can reproduce it pretty easily otherwise. For example, sections of https://bugzilla.mozilla.org/attachment.cgi?id=8605643&action=edit randomly disappear when I scroll down.

I've attached my about:support data. One thing I also noticed is that the file upload dialogue doesn't draw correctly - it starts off mostly transparent, and elements don't show up until I mouse over them. That may be a different bug though.
Flags: needinfo?(emanuel.hoogeveen)
Attached file about:support info
Flags: needinfo?(jmjeffery)
Tracking for 42 because regression with user impact.
Thank you both for the about:supports. I can reproduce fairly reliably when disabling e10s. I'm still not entirely sure why that is (maybe it just exposes the underlying problem) but I have found the cause of the problem. In RotatedContentBuffer::BorrowDrawTargetForPainting() we call SimplifyOutwardByArea() on the region to be drawn when using Direct2D (explaining why this only affects hardware accelerated Windows). I had already encountered a problem due to this in bug 1176077 - that the quadrant regions became larger than the total region. But my "fix" for that causes the total region to become larger than the sum of the quadrant regions, which is what is causing this bug.

I do not believe this can be fixed. We do not know the backend type of the draw target (and therefore whether or not to simplify the region) until after we have calculated the quadrant region (too late to simplify the region). A bit of ugly code could work around this, but we'd end up drawing needlessly large regions negating any gain from bug 1176077's optimisation in the first place. The optimisation was mainly useful when using tiled layers and drawing progressively. My plan is to disable the optimisation on ClientPaintedLayer and leave it enabled for other layers.
Attached patch Patch v1 (obsolete) — Splinter Review
Try run looks good - https://treeherder.mozilla.org/#/jobs?repo=try&revision=a19d592a57f7

Matt, are you okay to review? Have I done the right thing for ClientSingleTiledLayerBuffer?
Attachment #8641622 - Flags: review?(matt.woodrow)
Assignee: nobody → jnicol
Status: NEW → ASSIGNED
Attachment #8641622 - Flags: review?(matt.woodrow) → review+
Keywords: checkin-needed
(In reply to Jamie Nicol [:jnicol] from comment #17)
> Created attachment 8641622 [details] [diff] [review]
> Patch v1
> 
> Try run looks good -
> https://treeherder.mozilla.org/#/jobs?repo=try&revision=a19d592a57f7
> 
> Matt, are you okay to review? Have I done the right thing for
> ClientSingleTiledLayerBuffer?


Been testing with the 'try build', and I can report that I no longer see the corruption issues when scrolling.  Thanks for the fix.
this failed to apply: patching file gfx/layers/client/SingleTiledContentClient.cpp
Hunk #1 FAILED at 175
1 out of 1 hunks FAILED -- saving rejects to file gfx/layers/client/SingleTiledContentClient.cpp.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working directory
errors during apply, please fix and refresh 0001-Bug-1187619-Only-optmimize-FrameLayerBuilder-visibil.patch

could you take a look?
Flags: needinfo?(jnicol)
Keywords: checkin-needed
Attached patch Patch v2Splinter Review
Unfortunate timing, a context line had changed. Straightforward rebase, the new patch is identical and still works correctly.
Attachment #8641622 - Attachment is obsolete: true
Flags: needinfo?(jnicol)
https://hg.mozilla.org/mozilla-central/rev/1ddb3a3a7255
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
See Also: → 1191183
I haven't seen this issue since updating to a Nightly with the patch. Thanks!
Status: RESOLVED → VERIFIED
SeaMonkey "Bug 1191183 - Quick vertical scroll down with mouse wheel causes gaps in browser page view" seems no longer reproducible with  SeaMonkey en-US 2.39a1 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0 from official download area)  Gecko/20100101  Firefox/42.0  Build 20150806070100  (Classic Theme) on German WIN7 64bit

That matches with fix date.
You need to log in before you can comment on or make changes to this bug.