# OpenGL Renderer Drawing Performance

**URL:** <https://forum.juce.com/t/opengl-renderer-drawing-performance/14486>\
**Category:** General JUCE discussion\
**Created:** [March 18, 2015, 7:38pm UTC](https://forum.juce.com/t/opengl-renderer-drawing-performance/14486 "2015-03-18T19:38:49Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 20, 2015, 11:59am UTC](https://forum.juce.com/t/opengl-renderer-drawing-performance/14486/3 "2015-03-20T11:59:38Z")

</div>

..ok.. It _does_&nbsp;already use an optimisation here. If you draw a big rectangle, it'll use at most 8 triangles to draw it.

There are a few exceptions: Perhaps you're rendering into a target where the clip-region is not a simple rectangle? Or have you rotated or skewed the context?

The place to look at what's going on is juce\_RenderingHelpers.h - when your fillRect call goes in there, it'll do different things depending on the type of clipping involved. For simple clip rects, it should use the code in&nbsp;RectangleListRegion::fillRectWithColour, which is optimised to use a minimal number of triangles. If it ends up in one of the more complex clip classes, then it may have to use a line-by-line rendering method.

---

_[View the full topic](https://forum.juce.com/t/opengl-renderer-drawing-performance/14486)._
