Closed Bug 748088 Opened 12 years ago Closed 12 years ago

Native android reftest are not testing OMTC+OGL

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: BenWa, Assigned: ajuma)

References

Details

Attachments

(3 files, 8 obsolete files)

2.69 KB, patch
ajuma
: review+
Details | Diff | Splinter Review
6.44 KB, patch
ajuma
: review+
Details | Diff | Splinter Review
14.27 KB, patch
jmaher
: review+
Details | Diff | Splinter Review
I took a quick look and the reftest are testing some OMTC/IPC hybrid running on the main thread or something of the sort. They don't appear to be running OMTC with OGL on a compositing thread.
Would this be the cause for the canvas tests not working (I believe they don't render) when we remove the browserIsRemote flag internally?  Currently on android native tests we run with browserIsRemote=True, but we don't have e10s enabled on the build.  I have been working on turning that off, but a lot of tests fail.

I am not a graphics expert, but if you offer some suggestions to the reftest harness, I would be happy to work on making that work and pushing through reviews, testing, landing.
Right, I discussed it with the GFX team and that was their theory as well. We should switch all test to use browserIsRemote and flag failure appropriately. We also need a long term plan for fixing the reftest on android.
So the goal is to run all Android tests with browserIsRemote = true ?  Right now I have failures on android XUL, but the same test passes on android Native.  That needs to get resolved in the real short term.

I think in Wednesday's mobile testing meeting we should figure out a strategy going forward for mobile reftests.
Depends on: 732498
(In reply to Benoit Girard (:BenWa) from comment #2)
> Right, I discussed it with the GFX team and that was their theory as well.
> We should switch all test to use browserIsRemote and flag failure
> appropriately. We also need a long term plan for fixing the reftest on
> android.

browserIsRemote=false*
When we run reftests with OMTC and browser.tabs.remote=false, the DrawWindow calls made by the reftest harness are actually getting the result of the widget's (content-side) BasicLayerManager drawing to a surface, but what we really want is the result of the compositor's (shadow-side) LayerManagerOGL drawing to a surface, since we want the reftest harness to "see" what's being drawn to the screen.

Here's how we can fix this. When a BasicLayerManager that has a ShadowManager gets an EndTransaction where a non-default target was set by the corresponding BeginTransactionWithTarget (that is, when mTarget != mDefaultTarget), it should send a sync IPC message to the ShadowManager asking it to draw into a shared memory buffer. The BasicLayerManager can then copy the contents of this buffer to the target it was given.

(Incidentally, the reason the reftest harness is currently seeing blank output for most tests when browser.tabs.remote=false is that BasicTiledThebesLayer, which always expects to have a shadow, quite rightly ignores the provided gfxContext in PaintThebes rather than painting to it.)
Assignee: nobody → ajuma
What browserIsRemote reports is meaningless in the context of native-fennec.  It doesn't affect what Gecko code runs during tests.  It does result in two optimizations in the reftest harness itself not being used, but that's pretty much it.  The results should be the same.
(In reply to Chris Jones [:cjones] [:warhammer] from comment #6)
> What browserIsRemote reports is meaningless in the context of native-fennec.
> It doesn't affect what Gecko code runs during tests.  It does result in two
> optimizations in the reftest harness itself not being used, but that's
> pretty much it.  The results should be the same.

Here's what I found, running reftests on a Tegra board:

-With browser.tabs.remote=true, a content process is created and used by the reftests. A CompositorParent/CompositorChild pair is also created, as usual, but this is not used by the reftests, and only a blank page is shown on screen during the reftests.

-With browser.tabs.remote=false, no content process is created. The reftests use the CompositorParent/CompositorChild, and are shown on screen. However, the DrawWindow calls made by the reftest harness read back from the CompositorChild's BasicLayerManager, not from the CompositorParent's LayerManagerOGL.
Wow, that is incredibly broken and not how I thought things worked at all!

This is actually testing the configuration we'll have for b2g ...
Together with Part 1, this implements the fix described in Comment 5.
Un-bitrotted.
Attachment #622518 - Attachment is obsolete: true
Patch updated to fix Linux crashes in reftest-ipc and crashtest-ipc.
Attachment #622521 - Attachment is obsolete: true
Attachment #622729 - Flags: review?(bgirard)
Attachment #623230 - Flags: review?(bgirard)
Comment on attachment 622729 [details] [diff] [review]
Part 1: Add a DrawToSurface message to PLayers.

Patch looks fine. Let's keep PLayers.ipdl documented.
Attachment #622729 - Flags: review?(bgirard) → review-
Patch updated to address review comments.
Attachment #622729 - Attachment is obsolete: true
Attachment #623686 - Flags: review?(bgirard)
Comment on attachment 623230 [details] [diff] [review]
Part 2: Drawing to a non-default target should happen on the shadow side, not the shadowable side, v2

Review of attachment 623230 [details] [diff] [review]:
-----------------------------------------------------------------

Great patch overall, r+ with these small improvements.

::: gfx/layers/basic/BasicLayers.cpp
@@ +3546,2 @@
>    }
>    BasicLayerManager::BeginTransactionWithTarget(aTarget);

You should clear mShadowTarget here...

@@ +3555,5 @@
>    BasicLayerManager::EndTransaction(aCallback, aCallbackData, aFlags);
>    ForwardTransaction();
> +  if (mShadowTarget) {
> +    ShadowLayerForwarder::ShadowDrawToTarget(mShadowTarget);
> +    mShadowTarget = nsnull;

... instead of here.

::: gfx/layers/ipc/ShadowLayers.cpp
@@ +388,5 @@
> +  nsRefPtr<gfxASurface> surface = OpenDescriptor(descriptorOut);
> +  aTarget->SetOperator(gfxContext::OPERATOR_SOURCE);
> +  aTarget->DrawSurface(surface, surface->GetSize());
> +
> +  DestroySharedSurface(&descriptorOut);

Nit: I feel like it's cleaner to do 'surface = nsnull' before this so we don't hold a surface to something that destroyed even if it's not used.
Attachment #623230 - Flags: review?(bgirard) → review+
Attachment #623686 - Flags: review?(bgirard) → review+
(In reply to Benoit Girard (:BenWa) from comment #15)
> Comment on attachment 623230 [details] [diff] [review]
> Part 2: Drawing to a non-default target should happen on the shadow side,
> not the shadowable side, v2
> 
> Review of attachment 623230 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Great patch overall, r+ with these small improvements.
> 
> ::: gfx/layers/basic/BasicLayers.cpp
> @@ +3546,2 @@
> >    }
> >    BasicLayerManager::BeginTransactionWithTarget(aTarget);
> 
> You should clear mShadowTarget here...
> 
> @@ +3555,5 @@
> >    BasicLayerManager::EndTransaction(aCallback, aCallbackData, aFlags);
> >    ForwardTransaction();
> > +  if (mShadowTarget) {
> > +    ShadowLayerForwarder::ShadowDrawToTarget(mShadowTarget);
> > +    mShadowTarget = nsnull;
> 
> ... instead of here.
> 
Actually I read this too quickly. This is fine and also similar to what we do elsewhere.
Depends on: 755452
Patch updated to address review comments. Carrying forward r=BenWa.
Attachment #623230 - Attachment is obsolete: true
Attachment #624157 - Flags: review+
Patch rebased.
Attachment #623686 - Attachment is obsolete: true
Attachment #628014 - Flags: review+
this is a working patch.  I still need to go through all other bugs out there and update or file new bugs to match this current set of 29 tests.
Attachment #628415 - Flags: review?(ajuma)
Comment on attachment 628415 [details] [diff] [review]
adjust reftest manifests to get green r1-3 with browser.tabs.remote=false (1.0)

Looks good to me. It's great to see that we're marking more tests as passing (18) than as failing (10).
Attachment #628415 - Flags: review?(ajuma) → review+
No longer depends on: 739708
allow for crashtests to pass, there were 3 different scenarios that required manifest hacking.
Attachment #628415 - Attachment is obsolete: true
Attachment #628480 - Flags: review?(ajuma)
Attachment #628480 - Flags: review?(ajuma) → review+
added 2 more test cases as well as documented with bug numbers.
Attachment #628480 - Attachment is obsolete: true
Attachment #628900 - Flags: review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: