MythTV  master
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Attributes | List of all members
MythPainter Class Referenceabstract

#include <mythpainter.h>

Inheritance diagram for MythPainter:
Inheritance graph
[legend]
Collaboration diagram for MythPainter:
Collaboration graph
[legend]

Public Member Functions

 MythPainter ()
 
 ~MythPainter () override=default
 MythPainter destructor. More...
 
virtual QString GetName (void)=0
 
virtual bool SupportsAnimation (void)=0
 
virtual bool SupportsAlpha (void)=0
 
virtual bool SupportsClipping (void)=0
 
virtual void FreeResources (void)
 
virtual void Begin (QPaintDevice *)
 
virtual void End ()
 
virtual void SetClipRect (QRect clipRect)
 
virtual void SetClipRegion (const QRegion &clipRegion)
 
virtual void Clear (QPaintDevice *device, const QRegion &region)
 
virtual void DrawImage (QRect dest, MythImage *im, QRect src, int alpha)=0
 
void DrawImage (int x, int y, MythImage *im, int alpha)
 
void DrawImage (QPoint topLeft, MythImage *im, int alph)
 
virtual void DrawText (QRect r, const QString &msg, int flags, const MythFontProperties &font, int alpha, QRect boundRect)
 
virtual void DrawTextLayout (QRect canvasRect, const LayoutVector &layouts, const FormatVector &formats, const MythFontProperties &font, int alpha, QRect destRect)
 
virtual void DrawRect (QRect area, const QBrush &fillBrush, const QPen &linePen, int alpha)
 
virtual void DrawRoundRect (QRect area, int cornerRadius, const QBrush &fillBrush, const QPen &linePen, int alpha)
 
virtual void DrawEllipse (QRect area, const QBrush &fillBrush, const QPen &linePen, int alpha)
 
virtual void PushTransformation (const UIEffects &zoom, QPointF center=QPointF())
 
virtual void PopTransformation (void)
 
MythImageGetFormatImage ()
 Returns a blank reference counted image in the format required for the Draw functions for this painter. More...
 
void DeleteFormatImage (MythImage *im)
 
void SetDebugMode (bool showBorders, bool showNames)
 
bool ShowBorders (void) const
 
bool ShowTypeNames (void) const
 
void SetMaximumCacheSizes (int hardware, int software)
 

Protected Member Functions

MythImageGetImageFromString (const QString &msg, int flags, QRect r, const MythFontProperties &font)
 
MythImageGetImageFromTextLayout (const LayoutVector &layouts, const FormatVector &formats, const MythFontProperties &font, QRect &canvas, QRect &dest)
 
MythImageGetImageFromRect (QRect area, int radius, int ellipse, const QBrush &fillBrush, const QPen &linePen)
 
virtual MythImageGetFormatImagePriv (void)=0
 Creates a reference counted image, call DecrRef() to delete. More...
 
virtual void DeleteFormatImagePriv (MythImage *im)=0
 
void ExpireImages (int64_t max=0)
 
virtual void Teardown (void)
 
void CheckFormatImage (MythImage *im)
 

Static Protected Member Functions

static void DrawTextPriv (MythImage *im, const QString &msg, int flags, QRect r, const MythFontProperties &font)
 
static void DrawRectPriv (MythImage *im, QRect area, int radius, int ellipse, const QBrush &fillBrush, const QPen &linePen)
 

Protected Attributes

int m_hardwareCacheSize { 0 }
 
int m_maxHardwareCacheSize { 0 }
 

Private Attributes

int64_t m_softwareCacheSize {0}
 
int64_t m_maxSoftwareCacheSize {1024 * 1024 * 48}
 
QMutex m_allocationLock
 
QSet< MythImage * > m_allocatedImages
 
QMap< QString, MythImage * > m_stringToImageMap
 
std::list< QString > m_stringExpireList
 
bool m_showBorders {false}
 
bool m_showNames {false}
 

Detailed Description

Definition at line 32 of file mythpainter.h.

Constructor & Destructor Documentation

◆ MythPainter()

MythPainter::MythPainter ( )

Definition at line 23 of file mythpainter.cpp.

◆ ~MythPainter()

MythPainter::~MythPainter ( )
overridedefault

MythPainter destructor.

The MythPainter destructor does not cleanup, it is unsafe to do cleanup in the MythPainter destructor because DeleteImagePriv() is a pure virtual in this class. Instead children should call MythPainter::Teardown() for cleanup.

Member Function Documentation

◆ GetName()

virtual QString MythPainter::GetName ( void  )
pure virtual

◆ SupportsAnimation()

virtual bool MythPainter::SupportsAnimation ( void  )
pure virtual

◆ SupportsAlpha()

virtual bool MythPainter::SupportsAlpha ( void  )
pure virtual

◆ SupportsClipping()

virtual bool MythPainter::SupportsClipping ( void  )
pure virtual

◆ FreeResources()

virtual void MythPainter::FreeResources ( void  )
inlinevirtual

◆ Begin()

virtual void MythPainter::Begin ( QPaintDevice *  )
inlinevirtual

◆ End()

virtual void MythPainter::End ( void  )
inlinevirtual

◆ SetClipRect()

void MythPainter::SetClipRect ( QRect  clipRect)
virtual

Reimplemented in MythQtPainter.

Definition at line 46 of file mythpainter.cpp.

Referenced by MythMainWindow::Draw().

◆ SetClipRegion()

void MythPainter::SetClipRegion ( const QRegion &  clipRegion)
virtual

Definition at line 50 of file mythpainter.cpp.

◆ Clear()

void MythPainter::Clear ( QPaintDevice *  device,
const QRegion &  region 
)
virtual

Definition at line 54 of file mythpainter.cpp.

◆ DrawImage() [1/3]

virtual void MythPainter::DrawImage ( QRect  dest,
MythImage im,
QRect  src,
int  alpha 
)
pure virtual

◆ DrawImage() [2/3]

void MythPainter::DrawImage ( int  x,
int  y,
MythImage im,
int  alpha 
)

Definition at line 58 of file mythpainter.cpp.

◆ DrawImage() [3/3]

void MythPainter::DrawImage ( QPoint  topLeft,
MythImage im,
int  alph 
)

Definition at line 71 of file mythpainter.cpp.

◆ DrawText()

void MythPainter::DrawText ( QRect  r,
const QString &  msg,
int  flags,
const MythFontProperties font,
int  alpha,
QRect  boundRect 
)
virtual

Definition at line 76 of file mythpainter.cpp.

◆ DrawTextLayout()

void MythPainter::DrawTextLayout ( QRect  canvasRect,
const LayoutVector layouts,
const FormatVector formats,
const MythFontProperties font,
int  alpha,
QRect  destRect 
)
virtual

Definition at line 123 of file mythpainter.cpp.

◆ DrawRect()

void MythPainter::DrawRect ( QRect  area,
const QBrush &  fillBrush,
const QPen &  linePen,
int  alpha 
)
virtual

◆ DrawRoundRect()

void MythPainter::DrawRoundRect ( QRect  area,
int  cornerRadius,
const QBrush &  fillBrush,
const QPen &  linePen,
int  alpha 
)
virtual

Reimplemented in MythOpenGLPainter.

Definition at line 168 of file mythpainter.cpp.

Referenced by VideoVisualCircles::DrawPriv(), and MythOpenGLPainter::DrawRoundRect().

◆ DrawEllipse()

void MythPainter::DrawEllipse ( QRect  area,
const QBrush &  fillBrush,
const QPen &  linePen,
int  alpha 
)
virtual

Definition at line 180 of file mythpainter.cpp.

◆ PushTransformation()

void MythPainter::PushTransformation ( const UIEffects zoom,
QPointF  center = QPointF() 
)
virtual

Reimplemented in MythPainterVulkan, and MythOpenGLPainter.

Definition at line 191 of file mythpainter.cpp.

◆ PopTransformation()

virtual void MythPainter::PopTransformation ( void  )
inlinevirtual

Reimplemented in MythOpenGLPainter, and MythPainterVulkan.

Definition at line 81 of file mythpainter.h.

◆ GetFormatImage()

MythImage * MythPainter::GetFormatImage ( void  )

◆ DeleteFormatImage()

void MythPainter::DeleteFormatImage ( MythImage im)

Definition at line 549 of file mythpainter.cpp.

Referenced by MythImage::~MythImage().

◆ SetDebugMode()

void MythPainter::SetDebugMode ( bool  showBorders,
bool  showNames 
)
inline

Definition at line 89 of file mythpainter.h.

Referenced by setDebugShowBorders(), and setDebugShowNames().

◆ ShowBorders()

bool MythPainter::ShowBorders ( void  ) const
inline

Definition at line 95 of file mythpainter.h.

Referenced by setDebugShowBorders(), and setDebugShowNames().

◆ ShowTypeNames()

bool MythPainter::ShowTypeNames ( void  ) const
inline

Definition at line 96 of file mythpainter.h.

Referenced by setDebugShowBorders(), and setDebugShowNames().

◆ SetMaximumCacheSizes()

void MythPainter::SetMaximumCacheSizes ( int  hardware,
int  software 
)

◆ DrawTextPriv()

void MythPainter::DrawTextPriv ( MythImage im,
const QString &  msg,
int  flags,
QRect  r,
const MythFontProperties font 
)
staticprotected

Definition at line 197 of file mythpainter.cpp.

Referenced by GetImageFromString().

◆ DrawRectPriv()

void MythPainter::DrawRectPriv ( MythImage im,
QRect  area,
int  radius,
int  ellipse,
const QBrush &  fillBrush,
const QPen &  linePen 
)
staticprotected

Definition at line 312 of file mythpainter.cpp.

Referenced by GetImageFromRect().

◆ GetImageFromString()

MythImage * MythPainter::GetImageFromString ( const QString &  msg,
int  flags,
QRect  r,
const MythFontProperties font 
)
protected

Definition at line 347 of file mythpainter.cpp.

Referenced by DrawText().

◆ GetImageFromTextLayout()

MythImage * MythPainter::GetImageFromTextLayout ( const LayoutVector layouts,
const FormatVector formats,
const MythFontProperties font,
QRect &  canvas,
QRect &  dest 
)
protected

Definition at line 380 of file mythpainter.cpp.

Referenced by DrawTextLayout().

◆ GetImageFromRect()

MythImage * MythPainter::GetImageFromRect ( QRect  area,
int  radius,
int  ellipse,
const QBrush &  fillBrush,
const QPen &  linePen 
)
protected

Definition at line 472 of file mythpainter.cpp.

Referenced by DrawEllipse(), DrawRect(), and DrawRoundRect().

◆ GetFormatImagePriv()

virtual MythImage* MythPainter::GetFormatImagePriv ( void  )
protectedpure virtual

Creates a reference counted image, call DecrRef() to delete.

Implemented in MythOpenGLPainter, MythQtPainter, MythD3D9Painter, and MythPainterVulkan.

Referenced by GetFormatImage().

◆ DeleteFormatImagePriv()

virtual void MythPainter::DeleteFormatImagePriv ( MythImage im)
protectedpure virtual

◆ ExpireImages()

void MythPainter::ExpireImages ( int64_t  max = 0)
protected

◆ Teardown()

void MythPainter::Teardown ( void  )
protectedvirtual

◆ CheckFormatImage()

void MythPainter::CheckFormatImage ( MythImage im)
protected

Member Data Documentation

◆ m_hardwareCacheSize

int MythPainter::m_hardwareCacheSize { 0 }
protected

◆ m_maxHardwareCacheSize

int MythPainter::m_maxHardwareCacheSize { 0 }
protected

◆ m_softwareCacheSize

int64_t MythPainter::m_softwareCacheSize {0}
private

◆ m_maxSoftwareCacheSize

int64_t MythPainter::m_maxSoftwareCacheSize {1024 * 1024 * 48}
private

◆ m_allocationLock

QMutex MythPainter::m_allocationLock
private

Definition at line 134 of file mythpainter.h.

Referenced by CheckFormatImage(), DeleteFormatImage(), GetFormatImage(), and Teardown().

◆ m_allocatedImages

QSet<MythImage*> MythPainter::m_allocatedImages
private

Definition at line 135 of file mythpainter.h.

Referenced by CheckFormatImage(), DeleteFormatImage(), GetFormatImage(), and Teardown().

◆ m_stringToImageMap

QMap<QString, MythImage *> MythPainter::m_stringToImageMap
private

◆ m_stringExpireList

std::list<QString> MythPainter::m_stringExpireList
private

◆ m_showBorders

bool MythPainter::m_showBorders {false}
private

Definition at line 140 of file mythpainter.h.

◆ m_showNames

bool MythPainter::m_showNames {false}
private

Definition at line 141 of file mythpainter.h.


The documentation for this class was generated from the following files: