Class RenderNode

java.lang.Object
icyllis.modernui.graphics.RenderProperties
icyllis.modernui.graphics.RenderNode

public final class RenderNode extends RenderProperties
  • Field Details

  • Constructor Details

    • RenderNode

      public RenderNode()
      Creates a new RenderNode that can be used to record batches of drawing operations, and store / apply render properties when drawn.
  • Method Details

    • beginRecording

      @Nonnull public Canvas beginRecording(int width, int height)
      Starts recording a display list for the render node. All operations performed on the returned canvas are recorded and stored in this display list.

      endRecording() must be called when the recording is finished in order to apply the updated display list. Failing to call endRecording() will result in an IllegalStateException if this method is called again.

      Parameters:
      width - The width of the recording viewport. This will not alter the width of the RenderNode itself, that must be set with RenderProperties.setPosition(Rect).
      height - The height of the recording viewport. This will not alter the height of the RenderNode itself, that must be set with RenderProperties.setPosition(Rect).
      Returns:
      A canvas to record drawing operations.
      Throws:
      IllegalStateException - If a recording is already in progress. That is, the previous call to this method did not call endRecording() first.
      See Also:
    • endRecording

      public void endRecording()
      Ends the recording for this display list. Calling this method marks the display list valid and
      invalid reference
      #hasDisplayList()
      will return true.
      See Also: