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 ()
 
virtual ~MythPainter ()=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 *parent)
 
virtual void End ()
 
virtual void SetClipRect (const QRect &clipRect)
 
virtual void SetClipRegion (const QRegion &clipRegion)
 
virtual void Clear (QPaintDevice *device, const QRegion &region)
 
QPaintDevice * GetParent (void)
 
virtual void DrawImage (const QRect &dest, MythImage *im, const QRect &src, int alpha)=0
 
void DrawImage (int x, int y, MythImage *im, int alpha)
 
void DrawImage (const QPoint &topLeft, MythImage *im, int alph)
 
virtual void DrawText (const QRect &r, const QString &msg, int flags, const MythFontProperties &font, int alpha, const QRect &boundRect)
 
virtual void DrawTextLayout (const QRect &canvasRect, const LayoutVector &layouts, const FormatVector &formats, const MythFontProperties &font, int alpha, const QRect &destRect)
 
virtual void DrawRect (const QRect &area, const QBrush &fillBrush, const QPen &linePen, int alpha)
 
virtual void DrawRoundRect (const QRect &area, int cornerRadius, const QBrush &fillBrush, const QPen &linePen, int alpha)
 
virtual void DrawEllipse (const 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)
 
bool ShowTypeNames (void)
 
void SetMaximumCacheSizes (int hardware, int software)
 

Protected Member Functions

MythImageGetImageFromString (const QString &msg, int flags, const QRect &r, const MythFontProperties &font)
 
MythImageGetImageFromTextLayout (const LayoutVector &layouts, const FormatVector &formats, const MythFontProperties &font, QRect &canvas, QRect &dest)
 
MythImageGetImageFromRect (const 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, const QRect &r, const MythFontProperties &font)
 
static void DrawRectPriv (MythImage *im, const QRect &area, int radius, int ellipse, const QBrush &fillBrush, const QPen &linePen)
 

Protected Attributes

QPaintDevice * m_Parent {nullptr}
 
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 22 of file mythpainter.cpp.

◆ ~MythPainter()

virtual MythPainter::~MythPainter ( )
virtualdefault

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

Reimplemented in MythOpenGLPainter, and MythD3D9Painter.

Definition at line 49 of file mythpainter.h.

Referenced by TV::customEvent(), and VideoOutputD3D::Init().

◆ Begin()

virtual void MythPainter::Begin ( QPaintDevice *  parent)
inlinevirtual

◆ End()

virtual void MythPainter::End ( void  )
inlinevirtual

◆ SetClipRect()

void MythPainter::SetClipRect ( const QRect &  clipRect)
virtual

Reimplemented in MythQImagePainter, and MythQtPainter.

Definition at line 48 of file mythpainter.cpp.

Referenced by MythMainWindow::draw().

◆ SetClipRegion()

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

Reimplemented in MythQImagePainter.

Definition at line 52 of file mythpainter.cpp.

◆ Clear()

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

Reimplemented in MythQImagePainter.

Definition at line 56 of file mythpainter.cpp.

◆ GetParent()

QPaintDevice* MythPainter::GetParent ( void  )
inline

Definition at line 57 of file mythpainter.h.

◆ DrawImage() [1/3]

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

◆ DrawImage() [2/3]

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

Definition at line 60 of file mythpainter.cpp.

◆ DrawImage() [3/3]

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

Definition at line 73 of file mythpainter.cpp.

◆ DrawText()

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

Reimplemented in MythQImagePainter.

Definition at line 78 of file mythpainter.cpp.

Referenced by MythQImagePainter::DrawText().

◆ DrawTextLayout()

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

Definition at line 125 of file mythpainter.cpp.

◆ DrawRect()

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

◆ DrawRoundRect()

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

◆ DrawEllipse()

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

Reimplemented in MythQImagePainter.

Definition at line 182 of file mythpainter.cpp.

Referenced by MythQImagePainter::DrawEllipse().

◆ PushTransformation()

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

Reimplemented in MythOpenGLPainter.

Definition at line 193 of file mythpainter.cpp.

◆ PopTransformation()

virtual void MythPainter::PopTransformation ( void  )
inlinevirtual

Reimplemented in MythOpenGLPainter.

Definition at line 82 of file mythpainter.h.

◆ GetFormatImage()

MythImage * MythPainter::GetFormatImage ( void  )

◆ DeleteFormatImage()

void MythPainter::DeleteFormatImage ( MythImage im)

Definition at line 548 of file mythpainter.cpp.

Referenced by MythImage::~MythImage().

◆ SetDebugMode()

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

Definition at line 90 of file mythpainter.h.

◆ ShowBorders()

bool MythPainter::ShowBorders ( void  )
inline

Definition at line 96 of file mythpainter.h.

◆ ShowTypeNames()

bool MythPainter::ShowTypeNames ( void  )
inline

Definition at line 97 of file mythpainter.h.

◆ SetMaximumCacheSizes()

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

Definition at line 607 of file mythpainter.cpp.

Referenced by MythPainter().

◆ DrawTextPriv()

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

Definition at line 199 of file mythpainter.cpp.

Referenced by GetImageFromString().

◆ DrawRectPriv()

void MythPainter::DrawRectPriv ( MythImage im,
const 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,
const 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 ( const QRect &  area,
int  radius,
int  ellipse,
const QBrush &  fillBrush,
const QPen &  linePen 
)
protected

Definition at line 474 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, MythQImagePainter, MythD3D9Painter, and MythQtPainter.

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_Parent

QPaintDevice* MythPainter::m_Parent {nullptr}
protected

Definition at line 128 of file mythpainter.h.

◆ 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 136 of file mythpainter.h.

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

◆ m_allocatedImages

QSet<MythImage*> MythPainter::m_allocatedImages
private

Definition at line 137 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 142 of file mythpainter.h.

◆ m_showNames

bool MythPainter::m_showNames {false}
private

Definition at line 143 of file mythpainter.h.


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