diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-07-02 16:56:26 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-07-29 17:54:43 +0200 |
commit | 9c67029ee5aca18ae02e740afbf6d0f883799ebd (patch) | |
tree | 76479e72ce3b9b0f993ddbc8a11c0d02775cbcc6 /src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h | |
parent | 4c58d2a83736545f473559cb3e04133343b6194a (diff) |
Move QSGRenderer::updateStencilClip down to QSGBatchRenderer
This convenience method is currently only used by the batch renderer.
Moving it allows removing the QOpenGLFunction inheritance of
QSGRenderer and unbinding it slightly from the rendering implementation.
Change-Id: I4322952f843de8d950ced32885feee8d6c4a2730
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h index 89a33cb8c4..574c6df810 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h @@ -406,7 +406,7 @@ public: QSGRenderContext *context; }; -class Q_QUICK_PRIVATE_EXPORT Renderer : public QSGRenderer +class Q_QUICK_PRIVATE_EXPORT Renderer : public QSGRenderer, public QOpenGLFunctions { public: Renderer(QSGRenderContext *); @@ -426,6 +426,14 @@ protected: void render(); private: + enum ClipTypeBit + { + NoClip = 0x00, + ScissorClip = 0x01, + StencilClip = 0x02 + }; + Q_DECLARE_FLAGS(ClipType, ClipTypeBit) + enum RebuildFlag { BuildRenderListsForTaggedRoots = 0x0001, BuildRenderLists = 0x0002, @@ -457,6 +465,7 @@ private: void renderBatches(); void renderMergedBatch(const Batch *batch); void renderUnmergedBatch(const Batch *batch); + ClipType updateStencilClip(const QSGClipNode *clip); void updateClip(const QSGClipNode *clipList, const Batch *batch); const QMatrix4x4 &matrixForRoot(Node *node); void renderRenderNode(Batch *batch); @@ -518,6 +527,11 @@ private: QSGMaterial *m_currentMaterial; QSGMaterialShader *m_currentProgram; ShaderManager::Shader *m_currentShader; + + QRect m_currentScissorRect; + int m_currentStencilValue; + QOpenGLShaderProgram m_clipProgram; + int m_clipMatrixId; const QSGClipNode *m_currentClip; ClipType m_currentClipType; |