PolygonLayer: use temporary area style array
This commit is contained in:
parent
8f0c51675d
commit
1b09774413
@ -126,7 +126,7 @@ public final class PolygonLayer extends RenderElement {
|
|||||||
|
|
||||||
private static final float FADE_START = 1.3f;
|
private static final float FADE_START = 1.3f;
|
||||||
|
|
||||||
private static PolygonLayer[] mFillPolys;
|
private static AreaStyle[] mAreaFills;
|
||||||
|
|
||||||
private static int numShaders = 2;
|
private static int numShaders = 2;
|
||||||
private static int polyShader = 0;
|
private static int polyShader = 0;
|
||||||
@ -168,7 +168,7 @@ public final class PolygonLayer extends RenderElement {
|
|||||||
hPolygonVertexPosition[i] = GL.glGetAttribLocation(polygonProgram[i], "a_pos");
|
hPolygonVertexPosition[i] = GL.glGetAttribLocation(polygonProgram[i], "a_pos");
|
||||||
}
|
}
|
||||||
|
|
||||||
mFillPolys = new PolygonLayer[STENCIL_BITS];
|
mAreaFills = new AreaStyle[STENCIL_BITS];
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -184,7 +184,7 @@ public final class PolygonLayer extends RenderElement {
|
|||||||
int shader = polyShader;
|
int shader = polyShader;
|
||||||
|
|
||||||
for (int c = start; c < end; c++) {
|
for (int c = start; c < end; c++) {
|
||||||
AreaStyle a = (AreaStyle) mFillPolys[c].area.getCurrent();
|
AreaStyle a = mAreaFills[c].current();
|
||||||
|
|
||||||
if (enableTexture && a.texture != null) {
|
if (enableTexture && a.texture != null) {
|
||||||
shader = texShader;
|
shader = texShader;
|
||||||
@ -316,7 +316,7 @@ public final class PolygonLayer extends RenderElement {
|
|||||||
GL.glStencilOp(GL20.GL_KEEP, GL20.GL_KEEP, GL20.GL_INVERT);
|
GL.glStencilOp(GL20.GL_KEEP, GL20.GL_KEEP, GL20.GL_INVERT);
|
||||||
}
|
}
|
||||||
|
|
||||||
mFillPolys[cur] = pl;
|
mAreaFills[cur] = pl.area.current();
|
||||||
|
|
||||||
// set stencil mask to draw to
|
// set stencil mask to draw to
|
||||||
GL.glStencilMask(1 << cur++);
|
GL.glStencilMask(1 << cur++);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user