public void endDraw() {
    // hm, mark pixels as changed, because this will instantly do a full
    // copy of all the pixels to the surface.. so that's kind of a mess.
    // updatePixels();

    if (primarySurface) {
      // don't copy the pixels/data elements of the buffered image directly,
      // since it'll disable the nice speedy pipeline stuff, sending all drawing
      // into a world of suck that's rough 6 trillion times slower.
      synchronized (image) {
        // System.out.println("inside j2d sync");
        image.getGraphics().drawImage(offscreen, 0, 0, null);
      }
    } else {
      // TODO this is probably overkill for most tasks...
      loadPixels();
    }
    modified = true;
  }