diff options
Diffstat (limited to 'android/source/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java')
-rw-r--r-- | android/source/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/android/source/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java b/android/source/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java new file mode 100644 index 000000000..ea95c032e --- /dev/null +++ b/android/source/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java @@ -0,0 +1,30 @@ +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(); + return inflate(roundToTileSize(rect, tileSize), getInflateFactor()); + } + + @Override + protected float getZoom(ImmutableViewportMetrics viewportMetrics) { + return viewportMetrics.zoomFactor; + } + + @Override + protected int getTilePriority() { + return 0; + } + + private IntSize getInflateFactor() { + return new IntSize(tileSize.width*2, tileSize.height*4); + } +} |