Closed Bug 532106 Opened 11 years ago Closed 10 years ago

[d2d] Background shows through when switching tabs with direct2d

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- -

People

(Reporter: jrmuizel, Unassigned)

References

Details

Attachments

(4 files)

When I switch between tabs I momentarily see the background from behind the window. This is using a NVIDIA GeForce 8600M GT on windows 7 RC.
Blocks: 527707
I do not see any problems when bringing up a context menu. However I did notice that bringing up menus from the menu bar is noticeably slower than with a GDI build.
No longer blocks: 527707
(In reply to comment #1)
> I do not see any problems when bringing up a context menu. However I did notice
> that bringing up menus from the menu bar is noticeably slower than with a GDI
> build.

Yeah, that's somewhat expected actually (although I find it hard to tell the speed difference on my machine). Bringing up a context menu essentially creates an HWND, which means a hardware surface is created for it. It could possibly be optimized a bit but I never really considered it a priority. (i.e. it's not a slowness that bothers me when clicking a menu bar item, atleast on my machine)
The background shows for about a tenth of a second. I could easily see it when I had only two tabs:
1. Minefield start page
2. Blank

When I replaced the blank page with a CNN tab I would see the problem when switching in one direction but not the other.

When I added a slashdot tab, I didn't see the problem between any of the tabs. However, it flashed white instead.

(In reply to comment #2)
> (In reply to comment #1)
> > I do not see any problems when bringing up a context menu. However I did notice
> > that bringing up menus from the menu bar is noticeably slower than with a GDI
> > build.
> 
> Yeah, that's somewhat expected actually (although I find it hard to tell the
> speed difference on my machine). Bringing up a context menu essentially creates
> an HWND, which means a hardware surface is created for it. It could possibly be
> optimized a bit but I never really considered it a priority. (i.e. it's not a
> slowness that bothers me when clicking a menu bar item, atleast on my machine)

For me it was pretty bad. I could see the menu shadow before the menu showed up.
On Mac I see something similar, but the flash is white, not transparent:

 1. Open the same page in two tabs, make one of these tabs the foreground tab.
 2. Resize the window.
 3. Activate the other tab.

This is caused by the delayed view resize stuff that happens in nsViewManager::DispatchEvent (search for didResize) - when there's a pending resize on a view, nothing will be painted. See also bug 425958.

I'm curious - does the build that you tested contain the new patch from
bug 498340?
Blocks: 527707
In the browser I'm currently running it flashes to an ad or previous tab that I had open. i.e. if I have only 2 tabs open, switching between them shows a 3rd page for a half a second or so.
This is still broken with the 20091213 build.
Hrm, I wonder if this was a bug in the RC? Sounds unlikely, but hey.
No longer blocks: 527707
(In reply to comment #7)
> Hrm, I wonder if this was a bug in the RC? Sounds unlikely, but hey.

I'm also currently using NVIDIA GeForce 7150 on windows 7 RC and I see this bug with a recent m-c nightly with DW and D2D enabled.
Bas, I also filed this bug with a screenshot.  Bug 548965

You can dupe it if you'd like.
Could everyone that experiences this issue please list their hardware. I'd like to try and find a correlation.
NVIDIA GeForce 7150M / nForce 630M
Drivers: 7.15.11.7967

I wonder if this is related to bug 535212, which I filed way before direct2D landed.
(In reply to comment #8)
> (In reply to comment #7)
> > Hrm, I wonder if this was a bug in the RC? Sounds unlikely, but hey.
> 
> I'm also currently using NVIDIA GeForce 7150 on windows 7 RC and I see this bug
> with a recent m-c nightly with DW and D2D enabled.

Correction, make that:

NVIDIA GeForce 7050 / nForce 610i. 
Drivers: 8.17.11.9621
Win 7 RC.
Its also more than just showing the background or the app or desktop below, but if you have had a plugin running on a tab you closed, you will see the plugin when switching to tabs instead of the previous tab you switched from.  Which sort of feels like a back buffer is showing.

I also see this when adding or removing bookmarks toolbar.  It feels like some sort of context switch occurs during this.
Here is what I see with the plugins showing..
It even happens when you reload a page, or post something, right before it finishes the throbber and shows the favicon the screen jumps..
Duplicate of this bug: 548965
Attached image Screenshot of desktop
I'm not seeing this on my system. Latest nightly, Win 7 Pro x64, Core i7-920
(3.2ghz), 6GB DDR3, ATI 5870 Video Card, latest drivers, etc.
Attached file Test case
Test case that loads flash (from ingdirect), page redirects to google after three seconds.  During the redirect you can clearly see the orange ball, click on images.google.com link and you will still see the ball from now on during every single page load and when switching tabs.
Blocks: 527707
Summary: Background shows through when switching tabs with direct2d → [d2d] Background shows through when switching tabs with direct2d
Version: unspecified → Trunk
Kurt, I just tried your test case. I don't see the ball when I click on images.google.com or any point after that.
(In reply to comment #20)
> Kurt, I just tried your test case. I don't see the ball when I click on
> images.google.com or any point after that.

(In reply to comment #18)
> I'm not seeing this on my system. Latest nightly, Win 7 Pro x64, Core i7-920
> (3.2ghz), 6GB DDR3, ATI 5870 Video Card, latest drivers, etc.

Brian, do you have the ability to check against a Nvidia card with this?
This is certainly starting to look like an Nvidia issue, as I cannot repo using the test case.  Video is HD3200 latest drives, on-board chip, 512meg ram.

latest hourly build:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a3pre) Gecko/20100306 Minefield/3.7a3pre Firefox/3.6 ID:20100306111944
FWIW, I see the same issue with my ATI X1300/X1500.
Works for me, I'm not seeing this behavior.

Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.3a3pre) Gecko/20100306 Minefield/3.7a3pre (.NET CLR 3.5.30729) ID:20100306035513

Vista Home Premium 32-bit
nVidia GeForce 7300
ForceWare version 156.16
Wanted to add to my previous comment, that I do see lots of old flash content on a gray background while switching. Sometimes this stays until I switch tabs again and sometimes the new page will be rendered on top of it and it disappears.
(In reply to comment #25)
> Wanted to add to my previous comment, that I do see lots of old flash content
> on a gray background while switching. Sometimes this stays until I switch tabs
> again and sometimes the new page will be rendered on top of it and it
> disappears.

That is exactly the bug we're describing, so it looks like your seeing it too.  Sometimes its just a gray background, sometimes its your desktop, sometimes its an app below and if a plugin like flash was used, its that.
Duplicate of this bug: 548987
I see this on the windows 7 RC as well. Is there anyone who has seen this that's not using the windows 7 RC?
I'm using Windows 7 Pro, the release version.
Vista 32-bit here, updated driver to 179.48 but still experiencing the bug.
Here's some info on what seems to be happening:

- We call nsWindow::Show() on the old tab to hide it.
 - This calls ::ShowWindow() after which the contents of the tab are solid black
- We then call nsWindow::Show() on the new tab.
 - This calls ::SetWindowPos(HWND_TOP, SWP_SHOWWINDOW | SW_NOMOVE | SWP_NOSIZE) to bring the new tab window to the front and show it.

After the call to ::SetWindowPos the bad content is there and remains until we complete our Paint event.
The problem also seems to go away if you disable aero glass.
(In reply to comment #32)
> The problem also seems to go away if you disable aero glass.

Confirmed but that also seems to cause all kind of other problems for me when running Windows 7 in Basic mode.  Pages on half load until I switch tabs and then back.  I know that is for another bug report though.
Jim, do you have any idea's what might be happening here?
(In reply to comment #34)
> Jim, do you have any idea's what might be happening here?

Not sure but I can easily reproduce it.

Initially for me it was the live desktop under the app. Then after minimizing and playing with tab previews, it changed to displaying one of my tabs. Will play around and see if I can get a good STR. cc'ing rob, since tab previews seemed to play a role changing the behavior.
BTW - ATI Radeon X1300/X1550 series, version 8.56.1.15
(In reply to comment #35)
> (In reply to comment #34)
> > Jim, do you have any idea's what might be happening here?
> 
> Not sure but I can easily reproduce it.
> 
> Initially for me it was the live desktop under the app. Then after minimizing
> and playing with tab previews, it changed to displaying one of my tabs. Will
> play around and see if I can get a good STR. cc'ing rob, since tab previews
> seemed to play a role changing the behavior.

I'm seeing this all the time too but I don't use tab previews. I'm wondering if bug 130078 would fix this. I also have an ATI card (X1400 mobility). Like Jim, this is also a D3D9 card.

(In reply to comment #32)
> The problem also seems to go away if you disable aero glass.
This disables the DWM so perhaps it's a Microsoft bug?
I tried to reproduce this problem in a standalone app and wasn't able to. The app tries to do basically the same thing that firefox does: hiding and showing child windows that draw with direct2d. I was unable to reproduce the phenomenon.

I also tried reworking the direct2d backend to use gdi interop as data point. But I haven't been able to get that working yet.

Some more info:
Until the WM_PAINT happens the new tab area will be completely transparent. i.e. if you ignore the WM_PAINT event you can drag the firefox window around and it's as though there is a big whole in it. If you try to highlight the transparent window with Spy++ it gets painted white and seems to never be transparent again.
Any new information on this bug?, it has been 2 weeks since the last message already.

Still seeing it with: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.3a4pre) Gecko/20100323 Minefield/3.7a4pre (.NET CLR 3.5.30729) ID:20100323040126
I simply gave up testing the D2D rendering because of the bug #548987 (marked as a duplicate of this one), since the browser is unusable.
(In reply to comment #40)
> I simply gave up testing the D2D rendering because of the bug #548987 (marked
> as a duplicate of this one), since the browser is unusable.

Could you confirm you are also on DirectX 9 hardware?
Sorry, it's actually Direct3D 10.1:

ATI Radeon 3870 512MiB
Catalyst 10.2 drivers
Vista SP2 w/ platform update, Aero on

Minefield 3.7pre4 works fine with DirectWrite, but doesn't with Direct2D.  I get the problem described in this bug, and also the page doesn't show until the window loses and then regain focus.  Sometimes I also got artifacts when another windows is minimized in front of the Minefield window, it leaves an "imprint" of all the frames of the animation.  I tried to get a screenshot, but the window redraws before the capture.

The IE9 preview works fine, and I guess it is using DWrite and D2D.

If you want more details, or even more specific tests, please ask.
(In reply to comment #42)
> Sorry, it's actually Direct3D 10.1:
> 
> ATI Radeon 3870 512MiB
> Catalyst 10.2 drivers
> Vista SP2 w/ platform update, Aero on
> 
> Minefield 3.7pre4 works fine with DirectWrite, but doesn't with Direct2D.  I
> get the problem described in this bug, and also the page doesn't show until the
> window loses and then regain focus.  Sometimes I also got artifacts when
> another windows is minimized in front of the Minefield window, it leaves an
> "imprint" of all the frames of the animation.  I tried to get a screenshot, but
> the window redraws before the capture.
> 
> The IE9 preview works fine, and I guess it is using DWrite and D2D.
> 
> If you want more details, or even more specific tests, please ask.

Hrm, so not DX9 only then. Well, we have someone with the hardware to reproduce. So hopefully we'll find a fix relatively soon.

I suspect it's something fairly simple and can be fixed by flushing somewhere or making sure we present a buffer somewhere or something of the likes. But sadly I don't have any hardware that repro's myself.
Duplicate of this bug: 558632
Not sure whether my Bug 558632 is really a dupe of this here,
anyway - I found a (poor) workaround to solve my D2D issues:

Set "Disable visual themes" and "Disable desktop composing"
for firefox.exe (File properties -> Compatibility)
blocking2.0: --- → ?
(In reply to comment #36)
> BTW - ATI Radeon X1300/X1550 series, version 8.56.1.15

FWIW, I've upgraded to a new system and now can't reproduce. 

Operating System:	Windows 7 Professional, 64-bit
DirectX version:	11.0 
GPU processor:		Quadro NVS 295
Driver version:		190.38
Similar bug 561167 - Various plugin artifacts on tab switching. Win7 x64, two video cards NVidia Quadro FX 570 and FX 1700 (3 screen, all have identical behavior). Holding down Ctrl+TAB, the artifacts stay visible for as long as I hold.
I have a standalone test case that reproduces this problem now.
I've put up a stand-alone test case at http://people.mozilla.com/~jmuizelaar/windowtest.zip. Next, I'll see if I can reproduce the problem only using D3D.
I get this pretty much every time (99%) switching tabs.

Vista SP2 x86 using a Geforce 8800 GTS with 197.45 drivers.
(In reply to comment #50)
> I get this pretty much every time (99%) switching tabs.
> 
> Vista SP2 x86 using a Geforce 8800 GTS with 197.45 drivers.

Forgotten to mention I can no longer test with this card as it died on me. :(
If we can't fix this bug, we should just blacklist the drivers in question.
blocking2.0: ? → -
Either way, don't you think we should block on a resolution?
(In reply to comment #52)
> If we can't fix this bug, we should just blacklist the drivers in question.

That appears it would be a lot of drivers for both ATI and nvidia cards.
I think we now that we have a stand alone test case on a machine showing the problem we should be able to get a handle on it.
I seem to be hitting this issue too, though it is quite hard to pin down and determine an exact method for reproduction. Seems to happen when quickly switching a tab that is loading.
This looks like its mostly fixed if bug 513162 stays in the tree.
I see this now with a recently hourly, I don't think its fixed.  I do get a grey background now everytime I switch tabs and the flash ad shows through, but I don't really see other stuff.
Bas, confirming I still see the app window showing through when I switch tabs.
I put a further reduced version of the test program up at http://people.mozilla.org/~jmuizelaar/windowtest.exe

"tabs" are switched using the 's' key or the "switch" menu item. If you see a white flash in between color changes then you have the bug.

I've been able to reproduce on two different d3d9 machines. I'm interested in hearing about any d3d9 machines that don't have the problem and especially in any d3d10 machines that do.
I have a d3d10 machine and I see the white Flash!

Widows Vista w/ Platform Update
Radeon 3870, 10.6 drivers
Aero Desktop

Let me know if you need more info.
The test program does indeed show a white flash between the color changes, for me.

Windows Vista (Aero enabled)
NVIDIA Quadro FX 570M
All updates and drivers applied
The program seems to give Avast Antivirus some trouble, CPU usage spikes and the program fails to run. If I disable Avast the program crashes immediately.

Running WinXP/SP1
ATI Catalyst 9.3
DirectX 9 card
Perhaps Bug 550756 Comment 12 is of interest, too. The bug itself is probably a dupe of this bug, which I didn't realize when I made the post.
For what it's worth this may just be fixed with bug 130078
The test program shows a white "flash" (lasting a second) before switching to the new color) here on on Vista with a Ati Radeon HD 3400 Series (DirectX 10.1 card) and Catalyst 10.7 drivers.
Duplicate of this bug: 583447
(In reply to comment #60)

White flash seen on:

        Card name: NVIDIA GeForce 8400M GS    
   Driver Version: 8.17.0012.5896 (English)
Device Identifier: {D7B71E3E-4767-11CF-F560-3DE01FC2C535}
        Vendor ID: 0x10DE
        Device ID: 0x0427
        SubSys ID: 0xC031144D
      Revision ID: 0x00A1
Why doesn't this block the final release? Releasing Firefox 4 with an issue like this might scare a lot of users away.
Because we don't have Direct2D enabled by default yet. If we do enable it by default, then this will be reconsidered.
The other major reason is that bug 130078 blocks release. Fixing 130078 will also fix this issue though.
This is being reported a lot in the nightly tester forums, is there any temporary patch that can be done here until bug 130078 is fixed?
(In reply to comment #72)
> This is being reported a lot in the nightly tester forums, is there any
> temporary patch that can be done here until bug 130078 is fixed?

I don't know of any options for a temporary patch.
(In reply to comment #73)
> (In reply to comment #72)
> > This is being reported a lot in the nightly tester forums, is there any
> > temporary patch that can be done here until bug 130078 is fixed?
> 
> I don't know of any options for a temporary patch.

That's a shame but since D2D has been disabled by default again this shouldn't be so much of an issue now anyway.
(In reply to comment #74)
> (In reply to comment #73)
> > (In reply to comment #72)
> > > This is being reported a lot in the nightly tester forums, is there any
> > > temporary patch that can be done here until bug 130078 is fixed?
> > 
> > I don't know of any options for a temporary patch.
> 
> That's a shame but since D2D has been disabled by default again this shouldn't
> be so much of an issue now anyway.

But surely we can't ship 4.0 Final with D2D disabled by default? That's one of the major changes.
Bug 130078 is blocking beta5. Relax.
(In reply to comment #75)
> But surely we can't ship 4.0 Final with D2D disabled by default? That's one of
> the major changes.

Once bug bug 130078 is fixed this should be fixed according to Bas. And since bug 130078 is scheduled to be fixed for beta 5 - this will be fixed before the final.
Is anyone seeing this on Windows 7? (Not the RC), it's possible this is a Vista only bug. If this is true we can consider disabling D2D by default on Vista.
It seems Ted Mielczarek does, see comment 23 and comment 29. Otherwise, though, it would seem as Vista users are running in to this issue more often, judging by the comments here.
I been on Windows 7 RTM for awhile now, so I've been seeing it, even up till 8-10 as my D2D been busted since then.
I was seeing this on Windows 7 final when I had D2D enabled.
Now I see grey box about the height of my toolbars above the status bar on every tab switch too with D2D.
I am seeing what appears to be a combination of this bug and Bug 550684 still, using Mozilla/5.0 (Windows NT 6.0; rv:2.0b5pre) Gecko/20100820 Minefield/4.0b5pre on a Vista x86 laptop with a NVIDIA GeForce 8400M GS (Vendor ID: 0x10DE,Device ID: 0x0427, SubSys ID: 0xC031144D, Revision ID: 0x00A1, Revision ID: 0x00A1) with driver v258.96.

Sometimes on refreshing a page I'll be left with a bit of a mess (this is what the screenshot shows) , or just a blank white page that require a minimize and restore to get the page to display. When switching through tabs the page mess described above may show for a split second before the correct content displays.

I'm half inclined to think it's duff drivers.
I notice this behavior from Direct2D apps other than Firefox - such as IE9 preview. I'm not sure this is a bug in Firefox at all.

Windows 7 x64, the latest IE9 preview, latest nVidia drivers at the time of this post.

I also see this in Photoshop CS5 on occasion. I don't know if they are using Direct2D, or D3D or what, but it does happen in there - especially when switching from another app.
Blocks: d2d-beta
Depends on: 130078
This bug looks fixed as I cannot reproduce the testcase or nor seeing backgrounds between tab switching in today's nightly with 130078 fixed.

Mozilla/5.0 (Windows NT 6.1; rv:2.0b5pre) Gecko/20100828 Firefox/4.0b5pre
Jeff, I this this makes sense to mark fixed now due to bug 130078 took care of it.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
I'm not convinced this is fixed. I never saw this issue on my ATI card, but I had to downgrade to a GeForce 7950GT and I'm still catching glimpses of my desktop background when switching tabs and opening new tabs. It's brief, I mean if you blink while it happens, you won't know it's happening, but I know it is still happening.
Are you seeing it on also with the testcase attachment 430855 [details]?  What about with just D2D still or with D2D & D3D9 on or D2D & D3D10?

I've been testing on my Nvidia 7050 with drivers from both June and just recently Oct.  I haven't been seeing it ever, I used to see it, but since I updated to latest drivers, Its possible I seen it if I try and run D2D with D3D10 which I know probably will not matter much anyway since my device and I believe yours too is not a DX10 part.
I've never seen it with the testcase. Now I will say that I am seeing my desktop background flash briefly when I archive/delete an email message in my Gmail app tab. I don't know if it is related to this or a completely separate bug.

Here is the output from about:support. The driver installed is the driver that Nvidia gives me to download when I put in my card information. I suppose I could update to the latest, but if Nvidia doesn't suggest the latest, what's the point?

Adapter Description NVIDIA GeForce 7950 GT
Vendor ID 10de
Device ID 0295
Adapter RAM 256
Adapter Drivers nvd3dumx,nvd3dum
Driver Version 8.17.12.6099
Driver Date 10-16-2010 
Direct2D Enabled false
DirectWrite Enabled false
GPU Accelerated Windows 1/1 Direct3D 9
I was trying the new drivers to see if some of my Nvidia bugs would disappear :)  It looks like you would have to do what I do if you want to enable D2D.
set pref: gfx.direct2d.force-enabled;true to see this bug with the testcase mentioned.  

I guess if you have never had that testcase work for you, then I would say it looks like you are possibly seeing a different manifestation, maybe with layers?  Maybe worth filing another bug specific to that with D3D9?  I dunno, maybe Jeff or Bas has a better idea as this one started way before almost a year ago.
That sounds like a separate bug, yes - I'd file one. This had to do with switching tabs specifically.
You need to log in before you can comment on or make changes to this bug.