1. A method comprising: loading a web application in a web browser; responsive to loading the web application, retrieving, by the web browser and over a network, a plugin from a remote server; obtaining a rendering request for a user interface (UI) element from the web application; generating, by a native code module of the plugin retrieved over the network from the remote server, a graphics-processing unit (GPU) command stream corresponding to the UI element based on the rendering request, wherein the native code module executes in a secure runtime environment; sending, by the native code module of the plugin, the GPU command stream to a trusted code module of the plugin that executes outside of the secure runtime environment; and providing, by the trusted code module, the GPU command stream to the GPU.