PathLayer Task (regular): final variables + minor refactor
This commit is contained in:
parent
512383892c
commit
cb36cfc983
@ -244,17 +244,17 @@ public class PathLayer extends Layer implements GestureListener {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* keep position to render relative to current state */
|
/* keep position to render relative to current state */
|
||||||
mMapPosition.copy(t.pos);
|
mMapPosition.copy(t.position);
|
||||||
|
|
||||||
/* compile new layers */
|
/* compile new layers */
|
||||||
buckets.set(t.bucket.get());
|
buckets.set(t.buckets.get());
|
||||||
compile();
|
compile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final static class Task {
|
final static class Task {
|
||||||
RenderBuckets bucket = new RenderBuckets();
|
final RenderBuckets buckets = new RenderBuckets();
|
||||||
MapPosition pos = new MapPosition();
|
final MapPosition position = new MapPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
final class Worker extends SimpleWorker<Task> {
|
final class Worker extends SimpleWorker<Task> {
|
||||||
@ -320,8 +320,8 @@ public class PathLayer extends Layer implements GestureListener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
if (task.bucket.get() != null) {
|
if (task.buckets.get() != null) {
|
||||||
task.bucket.clear();
|
task.buckets.clear();
|
||||||
mMap.render();
|
mMap.render();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -330,22 +330,22 @@ public class PathLayer extends Layer implements GestureListener {
|
|||||||
LineBucket ll;
|
LineBucket ll;
|
||||||
|
|
||||||
if (mLineStyle.stipple == 0 && mLineStyle.texture == null)
|
if (mLineStyle.stipple == 0 && mLineStyle.texture == null)
|
||||||
ll = task.bucket.getLineBucket(0);
|
ll = task.buckets.getLineBucket(0);
|
||||||
else
|
else
|
||||||
ll = task.bucket.getLineTexBucket(0);
|
ll = task.buckets.getLineTexBucket(0);
|
||||||
|
|
||||||
ll.line = mLineStyle;
|
ll.line = mLineStyle;
|
||||||
|
|
||||||
//ll.scale = ll.line.width;
|
//ll.scale = ll.line.width;
|
||||||
|
|
||||||
mMap.getMapPosition(task.pos);
|
mMap.getMapPosition(task.position);
|
||||||
|
|
||||||
int zoomlevel = task.pos.zoomLevel;
|
int zoomlevel = task.position.zoomLevel;
|
||||||
task.pos.scale = 1 << zoomlevel;
|
task.position.scale = 1 << zoomlevel;
|
||||||
|
|
||||||
double mx = task.pos.x;
|
double mx = task.position.x;
|
||||||
double my = task.pos.y;
|
double my = task.position.y;
|
||||||
double scale = Tile.SIZE * task.pos.scale;
|
double scale = Tile.SIZE * task.position.scale;
|
||||||
|
|
||||||
// flip around dateline
|
// flip around dateline
|
||||||
int flip = 0;
|
int flip = 0;
|
||||||
@ -437,7 +437,7 @@ public class PathLayer extends Layer implements GestureListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cleanup(Task task) {
|
public void cleanup(Task task) {
|
||||||
task.bucket.clear();
|
task.buckets.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int addPoint(float[] points, int i, int x, int y) {
|
private int addPoint(float[] points, int i, int x, int y) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user