Closed Bug 902330 Opened 12 years ago Closed 12 years ago

Fix shmem texture clients for D3D9 and 11 compositors

Categories

(Core :: Graphics: Layers, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: nrc, Assigned: nrc)

References

Details

Attachments

(4 files, 2 obsolete files)

No description provided.
SupportsAzureContent is a total nightmare, it is rarely safe to use. This patch adds a safer alternative and fixes up a bunch of its uses
Attachment #786762 - Flags: review?(matt.woodrow)
Comment on attachment 786762 [details] [diff] [review] fix SupportsAzureContent Review of attachment 786762 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/layers/client/CompositableClient.cpp @@ +127,1 @@ > } Don't comment this out.
Attachment #786762 - Flags: review?(matt.woodrow) → review+
Comment on attachment 786763 [details] [diff] [review] Clear the non-opaque surfaces on creation for shmem texture clients and other minor fixups Review of attachment 786763 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/layers/client/TextureClient.cpp @@ +327,5 @@ > + nsRefPtr<gfxContext> context = new gfxContext(GetSurface()); > + context->SetColor(gfxRGBA(0, 0, 0, 0)); > + context->SetOperator(gfxContext::OPERATOR_SOURCE); > + context->Paint(); > + } Why do we need to do this? Normally we rely on the ContentClient's BeginPaint function to do any clearing that might be required.
(In reply to Matt Woodrow (:mattwoodrow) from comment #4) > Comment on attachment 786763 [details] [diff] [review] > Clear the non-opaque surfaces on creation for shmem texture clients and > other minor fixups > > Review of attachment 786763 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: gfx/layers/client/TextureClient.cpp > @@ +327,5 @@ > > + nsRefPtr<gfxContext> context = new gfxContext(GetSurface()); > > + context->SetColor(gfxRGBA(0, 0, 0, 0)); > > + context->SetOperator(gfxContext::OPERATOR_SOURCE); > > + context->Paint(); > > + } > > Why do we need to do this? Normally we rely on the ContentClient's > BeginPaint function to do any clearing that might be required. Do you mean ThebesLayerBuffer::BeingPaint? ContentClient does nothing to clear. TLB::BeginPaint only clears buffers we've used before, not new buffers. If we have a new buffer then it assumes we don't need to clear it. This patch clears new buffers to make them actually zero, rather than uninitialised data.
Attachment #786763 - Flags: review?(matt.woodrow) → review+
Attachment #786763 - Flags: review+ → review-
Changed my mind. We manage to get away without doing this on some platforms, right? B2G, android should be hitting this? We should try figure out what conditions give us actual clear surfaces, and what ones don't, rather than just always clearing.
I think we may also be hitting this with BasicCompositor. I noticed that some tests end up rendering some blocks that should be a solid color but end up being random garbage.
(In reply to Matt Woodrow (:mattwoodrow) from comment #6) > Changed my mind. > > We manage to get away without doing this on some platforms, right? B2G, > android should be hitting this? > > We should try figure out what conditions give us actual clear surfaces, and > what ones don't, rather than just always clearing. My theory is that we just don't notice on these platforms. The only reason I noticed on windows is that there is a great big chunk of transparent thebes layer over the title bar. I never saw this with web content. I guess it is pretty hard to come up with a case to repro this, its not covered by our tests and no-one has noticed on mobile/mac.
I'll try to come up with a test case.
OK, I made a test case and it is broken on Android and on Windows only with OMTC. Could you test on mac too please? (Coming soon...)
Attached file test case
I'll make this into a ref test somehow later - gradients are really bad for ref tests. Anyway, if this passes, then you should see a very pale pink square with a subtle gradient (that is it should be 50% opaque and you should see the gradient coming through). If it fails you should see an opaque or nearly opaque (on windows, alpha = 0xcd, different on Android) white or grey square. On Android the test becomes correct when you zoom in. I haven't checked if these patches fix android or not.
Passes just fine on mac, because we always clear in ContentClientIncremental. You should get rid of that clear if you're going to add this one :)
Attachment #786763 - Flags: review- → review+
(In reply to Matt Woodrow (:mattwoodrow) from comment #12) > Passes just fine on mac, because we always clear in ContentClientIncremental. > > You should get rid of that clear if you're going to add this one :) Filed bug 903129 for that because it might get a bit big if we have to clear in other texture clients.
Attached patch reftest (obsolete) — Splinter Review
Attachment #793337 - Flags: review?(matt.woodrow)
Attached patch reftest (obsolete) — Splinter Review
apparently canvas and content do integer division differently :-p
Attachment #793337 - Attachment is obsolete: true
Attachment #793337 - Flags: review?(matt.woodrow)
Attachment #793377 - Flags: review?(matt.woodrow)
Attachment #793377 - Flags: review?(matt.woodrow) → review+
Whiteboard: [leave open]
Attached patch reftestSplinter Review
Reftest with fuzz, because no-one can seem to agree on how to divide by two. Sigh. Carrying r=mattwoodrow (since it was he suggested fuzzing on irc).
Attachment #793377 - Attachment is obsolete: true
Attachment #793810 - Flags: review+
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Blocks: 902591
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: