1. At a computer system including one or more processors and system memory, the computer system also including a graphics processing unit (GPU), a method for using primitive composition to render a user interface for a program, the method comprising: a user interface (UI) thread walking a user interface hierarchy for the program, the user interface hierarchy describing one or more user interface elements of a user interface of the program; based on the UI thread walking the user interface hierarchy, the UI thread directly generating one or more static GPU data structures representing at least a portion of the user interface hierarchy; the UI thread passing the one or more static GPU data structures to a composition thread, the composition thread storing the one or more static GPU data structures such that the one or more static GPU data structures can be reused during the generation of a plurality of video frames corresponding to the user interface; and the composition thread generating the plurality of video frames corresponding to the user interface, including the composition thread sending GPU data and GPU commands derived from the one or more static GPU data structures to the GPU for each of the plurality of video frames, such that, during multiple executions of the composition thread, the composition thread reuses when rendering the plurality of video frames corresponding to the user interface the one or more static GPU data structures received from the UI thread.