Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6328478

OGL: improve performance of simple primitives

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • client-libs
    • 2d
    • b56
    • generic
    • solaris_9

      With a few minor changes, we could improve performance of simple primitives like
      drawLine() and drawRect() for the OGL pipeline:

      1) OGLRenderer_DrawLine() currently has a special case for rectilinear lines using
      GL_QUADS so that they render consistently according to our spec. With some careful
      tweaking, we could use GL_LINES just as we do for diagonal lines. This would improve
      our batching potential since we will be rendering all lines with GL_LINES, instead
      of bouncing back and forth between GL_LINES and GL_QUADS. Also, GL_LINES requires
      half the glVertex() calls and also typically renders as fast as, or faster than
      quads on most hardware. (This should also help batching with the drawGeneralPath()
      changes from 6322584.)

      2) OGLRenderer_DrawRect() currently uses GL_QUADS for the same reasons above. We
      could apply the techniques above to cut the number of glVertex() calls in half,
      improve performance, and increase batching potential.

      3) With 6322584, we have a new operation called DRAW_SCANLINE, which uses GL_LINES
      to issue one line at a time. With some minor tweaks to BufferedRenderPipe, we could
      probably batch those vertices into one DRAW_SCANLINES operation (similar to
      FILL_SPANS), and therefore pass all scanlines as a single vertex array, which
      should eliminate method call overhead and improve performance.

            campbell Christopher Campbell (Inactive)
            campbell Christopher Campbell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: