Kaydet (Commit) 7cb282b0 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Miklos Vajna

android: provide context to ComposedTileLayer

Change-Id: If42dc9487fe11e2950becaf6b9ec857496dc6669
üst a5e2c361
package org.mozilla.gecko.gfx;
import android.content.Context;
import android.graphics.RectF;
import android.graphics.Region;
import android.util.Log;
......@@ -23,14 +24,10 @@ public abstract class ComposedTileLayer extends Layer {
protected RectF currentViewport = new RectF();
protected float currentZoom;
public ComposedTileLayer() {
public ComposedTileLayer(Context context) {
this.tileSize = new IntSize(256, 256);
}
public ComposedTileLayer(IntSize tileSize) {
this.tileSize = tileSize;
}
public void invalidate() {
for (SubTile tile : tiles) {
tile.invalidate();
......
package org.mozilla.gecko.gfx;
import android.content.Context;
import android.graphics.RectF;
public class DynamicTileLayer extends ComposedTileLayer {
public DynamicTileLayer(Context context) {
super(context);
}
@Override
protected RectF getViewPort(ImmutableViewportMetrics viewportMetrics) {
RectF rect = viewportMetrics.getViewport();
......
package org.mozilla.gecko.gfx;
import android.content.Context;
import android.graphics.RectF;
public class FixedZoomTileLayer extends ComposedTileLayer {
public FixedZoomTileLayer(Context context) {
super(context);
}
@Override
protected RectF getViewPort(ImmutableViewportMetrics viewportMetrics) {
float zoom = getZoom(viewportMetrics);
......
......@@ -108,8 +108,8 @@ public class GeckoLayerClient implements PanZoomTarget, LayerView.Listener {
public void notifyReady() {
mGeckoIsReady = true;
mRootLayer = new DynamicTileLayer();
mLowResLayer = new FixedZoomTileLayer();
mRootLayer = new DynamicTileLayer(mContext);
mLowResLayer = new FixedZoomTileLayer(mContext);
mLayerRenderer = new LayerRenderer(mView);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment