Go to the documentation of this file.
5 #include <QCoreApplication>
20 LOG(VB_GENERAL, LOG_ERR,
"OpenGL painter has no render device");
74 LOG(VB_GENERAL, LOG_INFO,
"Clearing OpenGL painter cache.");
93 LOG(VB_GENERAL, LOG_ERR,
"FATAL ERROR: No render device in 'Begin'");
102 [&]() { return m_render->CreateVBO(static_cast<int>(MythRenderOpenGL::kVertexSize)); });
105 QSize currentsize =
m_parent->size();
113 static const int s_onehd = 1920 * 1080;
114 static const int s_basesize = 64;
117 int cpu = qMax(
static_cast<int>(hdscreens * s_basesize), s_basesize);
118 int gpu = cpu * 3 / 2;
150 LOG(VB_GENERAL, LOG_ERR,
"FATAL ERROR: No render device in 'End'");
175 if (!
Image->IsChanged())
184 Image->SetChanged(
false);
188 while (texture ==
nullptr)
191 if (texture !=
nullptr)
197 LOG(VB_GENERAL, LOG_ERR,
"Failed to create OpenGL texture.");
203 LOG(VB_GENERAL, LOG_NOTICE, QString(
"Shrinking UIPainterMaxCacheHW to %1KB")
238 const QRect
Source,
int Alpha)
242 qreal pixelratio = 1.0;
246 QRect
dest = QRect(
static_cast<int>(Dest.left() * pixelratio),
247 static_cast<int>(Dest.top() * pixelratio),
248 static_cast<int>(Dest.width() * pixelratio),
249 static_cast<int>(Dest.height() * pixelratio));
257 QOpenGLBuffer *vbo = texture->
m_vbo;
262 texture->
m_vbo = vbo;
284 const QPen &LinePen,
int Alpha)
286 if ((FillBrush.style() == Qt::SolidPattern ||
296 const QBrush &FillBrush,
297 const QPen &LinePen,
int Alpha)
299 if ((FillBrush.style() == Qt::SolidPattern ||
std::list< MythImage * > m_imageExpireList
MythMainWindow * m_parent
void DeleteTextures(void)
void SetBackground(uint8_t Red, uint8_t Green, uint8_t Blue, uint8_t Alpha)
void ClearFramebuffer(void)
QMutex m_textureDeleteLock
void Begin(QPaintDevice *Parent) override
void SetMaximumCacheSizes(int hardware, int software)
MythOpenGLPainter(MythRenderOpenGL *Render, MythMainWindow *Parent)
void DrawRect(QRect Area, const QBrush &FillBrush, const QPen &LinePen, int Alpha) override
Draw a rectangle.
void logDebugMarker(const QString &Message)
void FreeResources(void) override
arg(title).arg(filename).arg(doDelete))
void PushTransformation(const UIEffects &Fx, QPointF &Center)
size_t m_mappedBufferPoolIdx
void DrawBitmap(MythGLTexture *Texture, QOpenGLFramebufferObject *Target, QRect Source, QRect Destination, QOpenGLShaderProgram *Program, int Alpha=255, qreal Scale=1.0)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythGLTexture * GetTextureFromCache(MythImage *Image)
virtual void DrawRect(QRect area, const QBrush &fillBrush, const QPen &linePen, int alpha)
int m_maxHardwareCacheSize
ViewControls m_viewControl
static int GetTextureDataSize(MythGLTexture *Texture)
void PushTransformation(const UIEffects &Fx, QPointF Center=QPointF()) override
MythGLTexture * CreateTextureFromQImage(QImage *Image)
void DrawRect(QOpenGLFramebufferObject *Target, QRect Area, const QBrush &FillBrush, const QPen &LinePen, int Alpha)
MythRenderOpenGL * m_render
void PopTransformation(void)
bool m_mappedBufferPoolReady
void DeleteTexture(MythGLTexture *Texture)
void DeleteFormatImagePriv(MythImage *Image) override
std::array< QOpenGLBuffer *, MAX_BUFFER_POOL > m_mappedBufferPool
void DrawRoundRect(QOpenGLFramebufferObject *Target, QRect Area, int CornerRadius, const QBrush &FillBrush, const QPen &LinePen, int Alpha)
void PopTransformation(void) override
virtual void FreeResources(void)
#define VERBOSE_LEVEL_CHECK(_MASK_, _LEVEL_)
void BindFramebuffer(QOpenGLFramebufferObject *Framebuffer)
QVector< MythGLTexture * > m_mappedTextures
void SetViewPort(QRect Rect, bool ViewportOnly=false) override
~MythOpenGLPainter() override
virtual void Teardown(void)
void CheckFormatImage(MythImage *im)
void DrawRoundRect(QRect Area, int CornerRadius, const QBrush &FillBrush, const QPen &LinePen, int Alpha) override
void DrawImage(QRect Dest, MythImage *Image, QRect Source, int Alpha) override
virtual void Begin(QPaintDevice *)
virtual void DrawRoundRect(QRect area, int cornerRadius, const QBrush &fillBrush, const QPen &linePen, int alpha)
QMap< MythImage *, MythGLTexture * > m_imageToTextureMap
std::list< MythGLTexture * > m_textureDeleteList