1. A method for executing a non-native web application in a mobile device, comprising: loading a validated native code module associated with the non-native web application into a secure runtime environment; transmitting rendering commands from the validated native code module to a trusted code module; and rendering an image for use by the non-native web application by executing the rendering commands read by the trusted code module using a graphics-processing unit (GPU) of the mobile device directly or via an interface with a rendering engine, wherein the trusted code module executes outside the secure runtime environment.