Closed Bug 737411 Opened 12 years ago Closed 12 years ago

Robocop: SoftwareLayerClient vs LayerClient and GLSurfaceView use

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 14

People

(Reporter: jmaher, Assigned: gbrown)

References

Details

Attachments

(2 files, 3 obsolete files)

we use reflection in robocop to call internal gecko methods:
http://mxr.mozilla.org/mozilla-central/source/build/mobile/robocop/FennecNativeActions.java.in#244

we need to remove the s/Software// to get things running.
Blocks: 723667
Assignee: nobody → gbrown
Attached patch simple name change (obsolete) — Splinter Review
Attachment #607640 - Flags: review?(bugmail.mozilla)
Comment on attachment 607640 [details] [diff] [review]
simple name change

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

You should also:
1) Add comments to the methods/classes referenced via reflection so that this doesn't happen again. There are already comments all over the file that say things like "/** This function is invoked by Gecko via JNI; be careful when modifying signature. */" - do something similar for reflection.
2) Ensure that exceptions that result from this cause the test to fail. Tests that pass on tbpl but aren't testing anything because the exceptions get caught are worse than not having tests at all.
Attachment #607640 - Flags: review?(bugmail.mozilla) → review-
After making this change, I tried to test using testAxisLocking. The original problem was resolved, but another similar issue was found: FennecNativeDriver.getSurfaceView was searching for an instance of GLSurfaceView, which is no longer used.
Summary: s/SoftwareLayerClient/LayerClient breaks robocop as we use that in reflection → Robocop: SoftwareLayerClient vs LayerClient and GLSurfaceView use
Attached patch updated patch (obsolete) — Splinter Review
This patch updates out-dated references to SoftwareLayerClient and GLSurfaceView. 

I have added "be careful/reflection" comments to several methods -- will they do any good? 

I have also added explicit checks for getPaintedSurface failure. The more general issue of Robocop not noticing exceptions / failures is being handled by jmaher in other bugs.


Unfortunately, with this patch, all PixelTests fail for me with:

Pixel at 0, 0 - Color rgba(0,0,0,255) not close enough to expected rgb(0,255,255)

The pixels.map file seems to contain 00ff0000 in every word - maybe getPixels() is also broken?
Attachment #607640 - Attachment is obsolete: true
Attachment #607685 - Flags: review?(bugmail.mozilla)
Comment on attachment 607685 [details] [diff] [review]
updated patch

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

r+ with typo fixed

::: mobile/android/base/gfx/LayerView.java
@@ +62,5 @@
>   *
>   * This view delegates to LayerRenderer to actually do the drawing. Its role is largely that of a
>   * mediator between the LayerRenderer and the LayerController.
> + *
> + * Note that LayerView is accessed by Robocop vi reflection.

s/vi/via/
Attachment #607685 - Flags: review?(bugmail.mozilla) → review+
(In reply to Geoff Brown [:gbrown] from comment #4)
> I have added "be careful/reflection" comments to several methods -- will
> they do any good? 

Looks good. People might still change these functions, but at least they have a better chance of also fixing the associated robocop code.

> 
> I have also added explicit checks for getPaintedSurface failure. The more
> general issue of Robocop not noticing exceptions / failures is being handled
> by jmaher in other bugs.
> 

ok.

> 
> Unfortunately, with this patch, all PixelTests fail for me with:
> 
> Pixel at 0, 0 - Color rgba(0,0,0,255) not close enough to expected
> rgb(0,255,255)
> 
> The pixels.map file seems to contain 00ff0000 in every word - maybe
> getPixels() is also broken?

Yeah, it's quite possible. That code has changed recently, in particular with bug 731603 which just landed yesterday. Robocop was passing when I landed it, but since robocop was already broken it may have not picked up breakage. I can take a look at this; hold off landing this patch until I at least figure out if it's an easy fix or if we should just disable the tests for now.
if we can make a decision today or first thing tomorrow on fixing/disabling the tests, then we can get this patch landed so we can move forward with talos + robocop.
Typo fix only. r=kats
Attachment #607685 - Attachment is obsolete: true
Attachment #607698 - Flags: review+
Bug 737630 may have caused the getPixels() breakage; I just landed a patch to fix it. If you're still seeing getPixels() returning garbage with that patch applied then feel free to disable the tests for now, and assign me a new bug to get them fixed.
https://tbpl.mozilla.org/?tree=Try&rev=979191796ea1 confirms PixelTest failures, as reported in Comment 4. (Patch from bug 737630 was NOT yet applied - checking that tonight.)
Bug 737630 definitely makes a difference, but PixelTest-based tests still fail with that patch. Now the pixels.map has varied, box-like data for the boxes tests, some pixel checks pass, but others fail:

Pixel at 100, 0 - Color rgba(99,255,255,255) not close enough to expected rgb(100,255,245)
https://tbpl.mozilla.org/?tree=Try&rev=b12a718cb1f1 confirms continued PixelTest failures with patch from Bug 737630.
Attached patch Fix pixel tests (obsolete) — Splinter Review
Applying this patch on top of the other one makes all the tests (that are currently enabled) pass locally for me.
Attachment #608342 - Flags: review?(jmaher)
Comment on attachment 608342 [details] [diff] [review]
Fix pixel tests

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

this set of changes works locally for me.  I am still confused by the math conversion.  Can we put a link/comment somewhere that explains the formula for the RGB888/555 conversion?
Attachment #608342 - Flags: review?(jmaher) → review+
Updated comment in robocop_boxes with some more info about the colors. Carrying r+
Attachment #608342 - Attachment is obsolete: true
Attachment #608376 - Flags: review+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: