diff options
author | Wieland Hagen <wieland.hagen@kdab.com> | 2016-04-14 20:18:51 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-04-16 12:22:25 +0000 |
commit | 99c62b0d7e723857d2387e7c22777710434cba02 (patch) | |
tree | 503767eb38473ece5a4e19353f453ef2bca02060 /src/render/graphicshelpers/graphicscontext_p.h | |
parent | a91cbabb6447fb1a9f5702118eb3aa98f175918c (diff) |
Simplify renderer code
Move some caching functionality into GraphicsContext, as this
has nothing to do with Rendering logic, but only reduces
amount of OpenGL calls.
Change-Id: I5a3c858e893da1498cb4bace9a212fec6b1de93e
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/graphicshelpers/graphicscontext_p.h')
-rw-r--r-- | src/render/graphicshelpers/graphicscontext_p.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/render/graphicshelpers/graphicscontext_p.h b/src/render/graphicshelpers/graphicscontext_p.h index c3ab61215..d61679ec2 100644 --- a/src/render/graphicshelpers/graphicscontext_p.h +++ b/src/render/graphicshelpers/graphicscontext_p.h @@ -106,7 +106,7 @@ public: int id() const; // unique, small integer ID of this context - bool beginDrawing(QSurface *surface, const QColor &color); + bool beginDrawing(QSurface *surface); void clearBackBuffer(QClearBuffers::BufferType buffers); void endDrawing(bool swapBuffers); @@ -255,6 +255,11 @@ private: QBitArray m_pinnedTextureUnits; QVector<TextureScope> m_textureScopes; + // cache some current state, to make sure we don't issue unnecessary GL calls + int m_currClearStencilValue; + float m_currClearDepthValue; + QColor m_currClearColorValue; + // recency score for all render-textures we've seen. Higher scores // mean more recently used. QHash<uint, int> m_textureScores; |