1 /****************************************************************************
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
40 ****************************************************************************/
42 #ifndef QSGPAINTERNODE_P_H
43 #define QSGPAINTERNODE_P_H
46 #include "qsgtexturematerial.h"
47 #include "qsgtexture_p.h"
48 #include "qsgpainteditem.h"
54 QT_MODULE(Declarative)
56 class QGLFramebufferObject;
58 class Q_DECLARATIVE_EXPORT QSGPainterTexture : public QSGPlainTexture
63 void setDirtyRect(const QRect &rect) { m_dirty_rect = rect; }
71 class Q_DECLARATIVE_EXPORT QSGPainterNode : public QSGGeometryNode
74 QSGPainterNode(QSGPaintedItem *item);
75 virtual ~QSGPainterNode();
77 void setPreferredRenderTarget(QSGPaintedItem::RenderTarget target);
79 void setSize(const QSize &size);
80 QSize size() const { return m_size; }
82 void setDirty(bool d, const QRect &dirtyRect = QRect());
84 void setOpaquePainting(bool opaque);
85 bool opaquePainting() const { return m_opaquePainting; }
87 void setLinearFiltering(bool linearFiltering);
88 bool linearFiltering() const { return m_linear_filtering; }
90 void setSmoothPainting(bool s);
91 bool smoothPainting() const { return m_smoothPainting; }
93 void setFillColor(const QColor &c);
94 QColor fillColor() const { return m_fillColor; }
101 void updateTexture();
102 void updateGeometry();
103 void updateRenderTarget();
104 void updateFBOSize();
106 QSGPaintedItem::RenderTarget m_preferredRenderTarget;
107 QSGPaintedItem::RenderTarget m_actualRenderTarget;
109 QSGPaintedItem *m_item;
111 QGLFramebufferObject *m_fbo;
112 QGLFramebufferObject *m_multisampledFbo;
115 QSGTextureMaterial m_material;
116 QSGTextureMaterialWithOpacity m_materialO;
117 QSGGeometry m_geometry;
118 QSGPainterTexture *m_texture;
122 bool m_dirtyContents;
124 bool m_opaquePainting;
125 bool m_linear_filtering;
126 bool m_smoothPainting;
127 bool m_extensionsChecked;
128 bool m_multisamplingSupported;
131 bool m_dirtyGeometry;
132 bool m_dirtyRenderTarget;
140 #endif // QSGPAINTERNODE_P_H