void pushLayer(CanvasLayer newLayer) { allLayers.add(newLayer); LayerRenderNode layerRenderNode = LayerRenderNode.obtain(this, newLayer); layersStack.add(layerRenderNode); currentLayer.add(layerRenderNode); currentLayer = layerRenderNode; lastSimple = null; }
void render(GlContext glContext) { for (RenderNode node : nodes) { if (node instanceof LayerRenderNode) { ((LayerRenderNode) node).render(glContext); } } startLayer(); glContext.render(getCalls()); calls.clear(); endLayer(); for (RenderNode node : nodes) { if (node instanceof LayerRenderNode) { ((LayerRenderNode) node).resetBuffer(); } } }
static LayerRenderNode obtain(RenderGraph graph, CanvasLayer layer) { LayerRenderNode command = Pools.obtain(LayerRenderNode.class); command.graph = graph; command.layer = layer; return command; }