aboutsummaryrefslogtreecommitdiffstats
path: root/softwarecontext/imagenode.h
blob: 956e4f75d8f06854e997d86383135ea0330b4a1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef IMAGENODE_H
#define IMAGENODE_H

#include <private/qsgadaptationlayer_p.h>
#include <private/qsgtexturematerial_p.h>

class ImageNode : public QSGImageNode
{
public:
    ImageNode();

    virtual void setTargetRect(const QRectF &rect);
    virtual void setInnerTargetRect(const QRectF &rect);
    virtual void setInnerSourceRect(const QRectF &rect);
    virtual void setSubSourceRect(const QRectF &rect);
    virtual void setTexture(QSGTexture *texture);
    virtual void setMirror(bool mirror);
    virtual void setMipmapFiltering(QSGTexture::Filtering filtering);
    virtual void setFiltering(QSGTexture::Filtering filtering);
    virtual void setHorizontalWrapMode(QSGTexture::WrapMode wrapMode);
    virtual void setVerticalWrapMode(QSGTexture::WrapMode wrapMode);
    virtual void update();

    virtual void paint(QPainter *painter);

private:
    QRectF m_targetRect;
    QRectF m_innerTargetRect;
    QRectF m_innerSourceRect;
    QRectF m_subSourceRect;

    QPixmap m_pixmap;
};

#endif // IMAGENODE_H