Closed
Bug 768400
Opened 13 years ago
Closed 13 years ago
Re-opening a transparent panel sometimes renders outdated content for a split second
Categories
(Core :: Widget: Win32, defect)
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: dao, Assigned: jimm)
References
Details
(Keywords: testcase)
Attachments
(2 files)
873 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
2.73 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #684534 +++
We've worked around this at least twice, in bug 684534 and here: http://hg.mozilla.org/mozilla-central/annotate/74e503bfa575/browser/base/content/browser-tabPreviews.js#l134
I think this doesn't affect all panels, but it's not clear yet what's needed to trigger this.
Reporter | ||
Comment 1•13 years ago
|
||
Reporter | ||
Updated•13 years ago
|
Keywords: testcase-wanted → testcase
Comment 2•13 years ago
|
||
Don't see any issue on my windows 7 machine with this testcase.
Reporter | ||
Comment 3•13 years ago
|
||
Do you see the images in the panel?
Comment 4•13 years ago
|
||
Yes, I see the panel opening and closing, alternating between the sun and clouds images. There is no flickering of the previous image when opening.
Reporter | ||
Comment 5•13 years ago
|
||
Is this on a fast desktop machine? Maybe it depends on the image decoding time or something.
Also, it doesn't flicker every time. With this test case it seems to happen with something like a 50% chance over here.
Comment 6•13 years ago
|
||
I can reproduce in a Windows XP VM.
Comment 7•13 years ago
|
||
Timothy, do you want to investigate this bug?
Comment 8•13 years ago
|
||
Sure, I'll take a look.
Comment 9•13 years ago
|
||
So I think the problem is that transparent windows are drawn differently from opaque ones. Opaque ones we use InvalidateRect, go back to the event loop and get a paint event then we paint. The panel will be blank until this happens. With transparent windows we keep a drawing context in memory around, and I guess it keeps the contents of what was in the panel before it was hidden. We use InvalidateRect to give us a paint event and then once we get back to the event loop and process that resulting paint event we update the contents of that memory drawing context, but until then we Windows uses the old contents to draw to the screen. Does that sound reasonable?
Perhaps we should just draw transparent black to the memory DC when we hide a transparent window so that it is invisible the next time we show it and then shows the new contents when we actually draw them?
Component: XUL → Widget: Win32
Reporter | ||
Comment 10•13 years ago
|
||
(In reply to Timothy Nikkel (:tn) from comment #9)
> Does that sound reasonable?
At least, it very much matches what I see.
> Perhaps we should just draw transparent black to the memory DC when we hide
> a transparent window so that it is invisible the next time we show it and
> then shows the new contents when we actually draw them?
Sounds good from my front-end perspective.
Summary: Re-opening a panel sometimes renders outdated content for a split second → Re-opening a transparent panel sometimes renders outdated content for a split second
![]() |
Assignee | |
Comment 11•13 years ago
|
||
This patch seems to fix the problem. Pushed to try w/reporting.
Assignee: nobody → jmathies
![]() |
Assignee | |
Comment 12•13 years ago
|
||
Comment on attachment 641008 [details] [diff] [review]
patch
Clear transparent windows before we hide them to eliminate old content ghosting when they are shown.
This passed try fine.
Attachment #641008 -
Flags: review?(roc)
Comment on attachment 641008 [details] [diff] [review]
patch
Review of attachment 641008 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with those two lines removed
::: widget/windows/nsWindow.cpp
@@ +7462,5 @@
> +void nsWindow::ClearTranslucentWindow()
> +{
> + if (mTransparentSurface) {
> + nsRefPtr<gfxContext> thebesContext = new gfxContext(mTransparentSurface);
> + thebesContext->ResetClip();
There can't be a clip set on thebesContext yet, so this seems pointless.
@@ +7465,5 @@
> + nsRefPtr<gfxContext> thebesContext = new gfxContext(mTransparentSurface);
> + thebesContext->ResetClip();
> + thebesContext->SetOperator(gfxContext::OPERATOR_CLEAR);
> + thebesContext->Paint();
> + thebesContext->SetOperator(gfxContext::OPERATOR_OVER);
This SetOperator is unnecessary since the context is not used again.
Attachment #641008 -
Flags: review?(roc) → review+
![]() |
Assignee | |
Comment 14•13 years ago
|
||
Comment 15•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in
before you can comment on or make changes to this bug.
Description
•