示例#1
0
  protected void drawIconsInBatch(DrawContext dc, OrderedIcon uIcon) {
    this.drawIcon(dc, uIcon);

    // Draw as many as we can in a batch to save ogl state switching.
    Object nextItem = dc.peekOrderedRenderables();
    while (nextItem != null && nextItem instanceof OrderedIcon) {
      OrderedIcon oi = (OrderedIcon) nextItem;
      if (oi.getRenderer() != this) return;

      dc.pollOrderedRenderables(); // take it off the queue
      this.drawIcon(dc, oi);

      nextItem = dc.peekOrderedRenderables();
    }
  }
示例#2
0
  protected void pickIconsInBatch(DrawContext dc, OrderedIcon uIcon) {
    this.drawIcon(dc, uIcon);

    // Draw as many as we can in a batch to save ogl state switching.
    // Note that there's a further qualification here than in render(): only items associated with
    // the
    // same layer can be batched because the pick resolution step at the end of batch rendering
    // associates the item's layer with the resolved picked object.
    Object nextItem = dc.peekOrderedRenderables();
    while (nextItem != null
        && nextItem instanceof OrderedIcon
        && ((OrderedIcon) nextItem).layer == uIcon.layer) {
      OrderedIcon oi = (OrderedIcon) nextItem;
      if (oi.getRenderer() != this) return;

      dc.pollOrderedRenderables(); // take it off the queue
      this.drawIcon(dc, oi);

      nextItem = dc.peekOrderedRenderables();
    }
  }