1. A method of displaying graphics on an electronic device, comprising: displaying an element of a user interface via a graphics layer attached to a software renderer of the electronic device; detaching the graphics layer from the software renderer of the electronic device when an operation on the graphics layer is more efficiently executed in one or more of a plurality of hardware layers of the electronic device than the software renderer of the electronic device; and attaching the graphics layer to the one or more hardware layers of the electronic device, wherein at least two of the hardware layers are dedicated to performing different operations such that the graphics layer is attached to a respective hardware layer based on the operation to be performed on the graphics layer.