Closed Bug 702416 Opened 12 years ago Closed 12 years ago

[layers] Replace homebrew classes with Android ones

Categories

(Firefox for Android Graveyard :: General, defect, P2)

All
Android
defect

Tracking

(firefox11 fixed, fennec11+)

RESOLVED FIXED
Tracking Status
firefox11 --- fixed
fennec 11+ ---

People

(Reporter: kats, Assigned: kats)

Details

Attachments

(4 files)

The IntPoint, FloatPoint, IntRect, and FloatRect classes should be replaced with the Android-provided Point, PointF, Rect, and RectF ones respectively.
Comment on attachment 574397 [details] [diff] [review]
(1/4) Replace intpoint

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

LGTM
Attachment #574397 - Flags: review?(pwalton) → review+
Comment on attachment 574398 [details] [diff] [review]
(2/4) Replace floatpoint

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

r+
Attachment #574398 - Flags: review?(pwalton) → review+
Comment on attachment 574399 [details] [diff] [review]
(3/4) Replace IntRect

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

r=me with comment

::: embedding/android/GeckoApp.java
@@ -748,4 +748,4 @@
> >                  });
> >                  connectGeckoLayerClient();
> >              } else if (event.equals("PanZoom:Ack")) {
> > -                final IntRect rect = new IntRect(message.getJSONObject("rect"));
> > +                Rect rect = RectUtils.create(message.getJSONObject("rect"));

Standard Java style prefers "createInstance", but that's gratuitously long, so let's leave it as create.

::: embedding/android/gfx/TileLayer.java
@@ +58,5 @@
>      private boolean mRepeat;
>      private IntSize mSize;
>      private int[] mTextureIDs;
>  
> +    private Rect mTextureUploadRect;

I'd add a comment here saying that it's not safe to hand this rect out, since it may be mutated (via the union line below) and that would surprise callers.
Attachment #574399 - Flags: review?(pwalton) → review+
Comment on attachment 574400 [details] [diff] [review]
(4/4) Replace FloatRect

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

r=me

::: embedding/android/ui/ViewportController.java
@@ +92,2 @@
>          float zoomFactor = (float)layerPageSize.width / (float)mPageSize.width;
> +        return RectUtils.scale(layerVisibleRect, 1.0f / zoomFactor);

scaleAll() adjusts X and Y as well as width and height. (Note that I'm going to be throwing a lot of this code away, so this doesn't really matter.)
Attachment #574400 - Flags: review?(pwalton) → review+
Priority: -- → P2
tracking-fennec: --- → 11+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.