2018-10-04 16:15:42 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
|
|
|
* This file may be used under the terms of the QSkinny License, Version 1.0
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef QSK_TEXTURE_RENDERER_H
|
|
|
|
#define QSK_TEXTURE_RENDERER_H
|
|
|
|
|
|
|
|
#include "QskGlobal.h"
|
2018-11-25 16:47:27 +01:00
|
|
|
#include <qnamespace.h>
|
2018-10-04 16:15:42 +02:00
|
|
|
|
|
|
|
class QskGraphic;
|
|
|
|
class QskColorFilter;
|
|
|
|
|
|
|
|
class QPainter;
|
|
|
|
class QSize;
|
2020-11-01 10:43:16 +01:00
|
|
|
class QSGTexture;
|
|
|
|
class QQuickWindow;
|
2018-10-04 16:15:42 +02:00
|
|
|
|
|
|
|
namespace QskTextureRenderer
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
Raster usually provides a better antialiasing and is less buggy,
|
|
|
|
while OpenGL might be faster - depending on the content that has
|
|
|
|
to be painted.
|
|
|
|
|
|
|
|
Since Qt 5.10 X11 is back and could be an interesting option
|
|
|
|
with good quality and hardware accelerated performance. TODO ...
|
|
|
|
*/
|
|
|
|
enum RenderMode
|
|
|
|
{
|
|
|
|
AutoDetect, // depends on QskSetup::controlFlags()
|
|
|
|
|
|
|
|
Raster,
|
|
|
|
OpenGL
|
|
|
|
};
|
|
|
|
|
|
|
|
class QSK_EXPORT PaintHelper
|
|
|
|
{
|
|
|
|
public:
|
2022-03-24 17:12:34 +01:00
|
|
|
PaintHelper() = default;
|
|
|
|
virtual ~PaintHelper() = default;
|
|
|
|
|
2018-10-04 16:15:42 +02:00
|
|
|
virtual void paint( QPainter*, const QSize& ) = 0;
|
2022-03-24 17:12:34 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY( PaintHelper )
|
2018-10-04 16:15:42 +02:00
|
|
|
};
|
|
|
|
|
2021-12-13 16:43:34 +01:00
|
|
|
QSK_EXPORT uint createTexture(
|
|
|
|
QQuickWindow*, RenderMode, const QSize&, PaintHelper* );
|
2018-10-04 16:15:42 +02:00
|
|
|
|
|
|
|
QSK_EXPORT uint createTextureFromGraphic(
|
2021-12-13 16:43:34 +01:00
|
|
|
QQuickWindow*, RenderMode, const QSize&, const QskGraphic&,
|
2018-11-25 16:47:27 +01:00
|
|
|
const QskColorFilter&, Qt::AspectRatioMode );
|
2019-10-27 08:11:47 +01:00
|
|
|
|
2020-11-01 10:43:16 +01:00
|
|
|
QSK_EXPORT QSGTexture* textureFromId(
|
|
|
|
QQuickWindow*, uint textureId, const QSize& );
|
2018-10-04 16:15:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|