aboutsummaryrefslogtreecommitdiffstats
path: root/softwarecontext/pixmaptexture.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-08-07 15:15:38 +0200
committerLars Knoll <lars.knoll@digia.com>2014-08-08 15:56:55 +0300
commitda54d17352dfc4070eb6fa105ce853e3d35490ef (patch)
tree1076956f67cb0355c3b525e271c17a24f36906a5 /softwarecontext/pixmaptexture.h
parent78a6d2d7340fbfdc5b5dbfd9974435714bb786fb (diff)
First implementation of images and rectangles
Change-Id: Ia905d6dfe3d9922ef820085fedc5195be8ace1da Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'softwarecontext/pixmaptexture.h')
-rw-r--r--softwarecontext/pixmaptexture.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/softwarecontext/pixmaptexture.h b/softwarecontext/pixmaptexture.h
new file mode 100644
index 0000000000..314005f82a
--- /dev/null
+++ b/softwarecontext/pixmaptexture.h
@@ -0,0 +1,24 @@
+#ifndef PIXMAPTEXTURE_H
+#define PIXMAPTEXTURE_H
+
+#include <private/qsgtexture_p.h>
+
+class PixmapTexture : public QSGTexture
+{
+ Q_OBJECT
+public:
+ PixmapTexture(const QImage &image);
+
+ virtual int textureId() const;
+ virtual QSize textureSize() const;
+ virtual bool hasAlphaChannel() const;
+ virtual bool hasMipmaps() const;
+ virtual void bind();
+
+ QPixmap pixmap() const { return m_pixmap; }
+
+private:
+ QPixmap m_pixmap;
+};
+
+#endif // PIXMAPTEXTURE_H