# OpenGL ES Draw Unit (/integration/embedded_linux/draw_units/draw_opengl)



Overview [#overview]

The OpenGL ES draw unit renders widgets in software, caches the result as an OpenGL texture, and composites
those textures on the GPU. Whenever a later frame asks for something already in the cache, the texture is
reused instead of redrawn, which is most of the screen, most of the time, in a typical UI.

That makes it fast for static and slowly-changing content, and slower than software rendering for content
that changes every frame.

<Callout type="info" title="Prefer NanoVG">
  [NanoVG](/integration/embedded_linux/draw_units/draw_nanovg) is the recommended GPU renderer on Linux: it
  performs better and supports more LVGL features. Reach for this draw unit when you specifically want the
  texture cache, or when NanoVG's limitations do not suit you.
</Callout>

Requirements [#requirements]

* OpenGL ES 2.0 or newer
* An OpenGL context, created by one of the display drivers listed in
  [OpenGL Overview](/integration/embedded_linux/opengl) or by your own code

Configuration [#configuration]

Enable <ApiLink name="LV_USE_DRAW_OPENGLES" />

Options [#options]

| Symbol                                 | Default | Meaning                                                                                    |
| -------------------------------------- | ------- | ------------------------------------------------------------------------------------------ |
| `LV_DRAW_OPENGLES_TEXTURE_CACHE_COUNT` | `64`    | Number of textures kept in the cache. More entries mean fewer redraws but more GPU memory. |

Limitations [#limitations]

* **No gain without cache hits.** Performance is worse when drawn areas are never found
  in the cache, e.g. widgets whose color or shape changes every frame
* **Layer transparency.** Layers that have both transparent pixels and an overall layer opacity do not blend
  correctly
* **No layer rotation.** Rotated layers are unsupported. Rotated *images* are fine.

[NanoVG](/integration/embedded_linux/draw_units/draw_nanovg) has none of these limitations.

See Also [#see-also]

* [NanoVG Draw Unit](/integration/embedded_linux/draw_units/draw_nanovg) - the recommended GPU renderer
* [OpenGL Overview](/integration/embedded_linux/opengl) - how drivers and draw units fit together
* [OpenGL Driver](/integration/embedded_linux/drivers/opengl_driver) - texture-only driver for an existing context
* [EGL](/integration/embedded_linux/drivers/egl) - context creation on embedded targets
