MythTV  master
Public Slots | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
MythPainterVulkan Class Reference

#include <mythpaintervulkan.h>

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

Public Slots

void DoFreeResources ()
 Free resources before the render device is released. More...
 
- Public Slots inherited from MythPainterGPU
void CurrentDPIChanged (qreal DPI)
 

Public Member Functions

 MythPainterVulkan (MythRenderVulkan *VulkanRender, MythMainWindow *Parent)
 
 ~MythPainterVulkan () override
 
QString GetName () override
 
bool SupportsAnimation () override
 
bool SupportsAlpha () override
 
bool SupportsClipping () override
 
void FreeResources () override
 
void Begin (QPaintDevice *) override
 Begin painting. More...
 
void End () override
 
void DrawImage (QRect Dest, MythImage *Image, QRect Source, int Alpha) override
 
void PushTransformation (const UIEffects &Fx, QPointF Center=QPointF()) override
 
void PopTransformation () override
 
void DeleteTextures ()
 
- Public Member Functions inherited from MythPainterGPU
 MythPainterGPU (MythMainWindow *Parent)
 
 ~MythPainterGPU () override=default
 
void SetViewControl (ViewControls Control)
 
- Public Member Functions inherited from MythPainter
 MythPainter ()
 
 ~MythPainter () override=default
 MythPainter destructor. More...
 
virtual void SetClipRect (QRect clipRect)
 
virtual void SetClipRegion (const QRegion &clipRegion)
 
virtual void Clear (QPaintDevice *device, const QRegion &region)
 
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)
 
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

MythImageGetFormatImagePriv () override
 Creates a reference counted image, call DecrRef() to delete. More...
 
void DeleteFormatImagePriv (MythImage *Image) override
 
- Protected Member Functions inherited from MythPainter
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)
 
void ExpireImages (int64_t max=0)
 
virtual void Teardown (void)
 
void CheckFormatImage (MythImage *im)
 

Private Member Functions

bool Ready ()
 
void ClearCache ()
 
MythTextureVulkanGetTextureFromCache (MythImage *Image)
 

Private Attributes

bool m_ready { false }
 
MythVulkanObjectm_vulkan { nullptr }
 
VkDescriptorPool m_projectionDescriptorPool { MYTH_NULL_DISPATCH }
 
VkDescriptorSet m_projectionDescriptor { MYTH_NULL_DISPATCH }
 
MythUniformBufferVulkanm_projectionUniform { nullptr }
 
VkSampler m_textureSampler { MYTH_NULL_DISPATCH }
 
MythShaderVulkanm_textureShader { nullptr }
 
VkPipeline m_texturePipeline { MYTH_NULL_DISPATCH }
 
VkDescriptorPool m_textureDescriptorPool { MYTH_NULL_DISPATCH }
 
bool m_textureDescriptorsCreated { false }
 
std::vector< VkDescriptorSet > m_availableTextureDescriptors
 
VkCommandBuffer m_textureUploadCmd { nullptr }
 
bool m_frameStarted { false }
 
std::vector< MythTextureVulkan * > m_stagedTextures
 
std::vector< MythTextureVulkan * > m_queuedTextures
 
QMap< MythImage *, MythTextureVulkan * > m_imageToTextureMap
 
std::list< MythImage * > m_imageExpire
 
QVector< MythTextureVulkan * > m_texturesToDelete
 
QMatrix4x4 m_projection
 
QStack< QMatrix4x4 > m_transforms
 

Additional Inherited Members

- Public Types inherited from MythPainterGPU
enum  ViewControl { None = 0x00, Viewport = 0x01, Framebuffer = 0x02 }
 
- Static Protected Member Functions inherited from MythPainter
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 inherited from MythPainterGPU
MythMainWindowm_parent { nullptr }
 
ViewControls m_viewControl { Viewport | Framebuffer }
 
qreal m_pixelRatio { 1.0 }
 
bool m_usingHighDPI { false }
 
QSize m_lastSize
 
- Protected Attributes inherited from MythPainter
int m_hardwareCacheSize { 0 }
 
int m_maxHardwareCacheSize { 0 }
 

Detailed Description

Definition at line 19 of file mythpaintervulkan.h.

Constructor & Destructor Documentation

◆ MythPainterVulkan()

MythPainterVulkan::MythPainterVulkan ( MythRenderVulkan VulkanRender,
MythMainWindow Parent 
)

Definition at line 17 of file mythpaintervulkan.cpp.

◆ ~MythPainterVulkan()

MythPainterVulkan::~MythPainterVulkan ( )
override

Definition at line 24 of file mythpaintervulkan.cpp.

Member Function Documentation

◆ GetName()

QString MythPainterVulkan::GetName ( )
overridevirtual

Implements MythPainter.

Definition at line 84 of file mythpaintervulkan.cpp.

◆ SupportsAnimation()

bool MythPainterVulkan::SupportsAnimation ( )
overridevirtual

Implements MythPainter.

Definition at line 94 of file mythpaintervulkan.cpp.

◆ SupportsAlpha()

bool MythPainterVulkan::SupportsAlpha ( )
overridevirtual

Implements MythPainter.

Definition at line 89 of file mythpaintervulkan.cpp.

◆ SupportsClipping()

bool MythPainterVulkan::SupportsClipping ( )
overridevirtual

Implements MythPainter.

Definition at line 99 of file mythpaintervulkan.cpp.

◆ FreeResources()

void MythPainterVulkan::FreeResources ( )
overridevirtual

Reimplemented from MythPainter.

Definition at line 34 of file mythpaintervulkan.cpp.

Referenced by ~MythPainterVulkan().

◆ Begin()

void MythPainterVulkan::Begin ( QPaintDevice *  )
overridevirtual

Begin painting.

Note
MythRenderVulkan must render between calls to startNextFrame and the call to QVulkanWindow::frameReady - this guarantees that the underlying QVulkanWindowRenderer is ready. startNextFrame is triggered by a call to MythWindowVulkan::requestUpdate.

Reimplemented from MythPainter.

Definition at line 267 of file mythpaintervulkan.cpp.

◆ End()

void MythPainterVulkan::End ( )
overridevirtual

Reimplemented from MythPainter.

Definition at line 298 of file mythpaintervulkan.cpp.

◆ DrawImage()

void MythPainterVulkan::DrawImage ( QRect  Dest,
MythImage Image,
QRect  Source,
int  Alpha 
)
overridevirtual

Implements MythPainter.

Definition at line 366 of file mythpaintervulkan.cpp.

◆ PushTransformation()

void MythPainterVulkan::PushTransformation ( const UIEffects Fx,
QPointF  Center = QPointF() 
)
overridevirtual

Reimplemented from MythPainter.

Definition at line 104 of file mythpaintervulkan.cpp.

◆ PopTransformation()

void MythPainterVulkan::PopTransformation ( )
overridevirtual

Reimplemented from MythPainter.

Definition at line 117 of file mythpaintervulkan.cpp.

◆ DeleteTextures()

void MythPainterVulkan::DeleteTextures ( )

Definition at line 522 of file mythpaintervulkan.cpp.

Referenced by Begin(), FreeResources(), and GetTextureFromCache().

◆ DoFreeResources

void MythPainterVulkan::DoFreeResources ( )
slot

Free resources before the render device is released.

Definition at line 42 of file mythpaintervulkan.cpp.

Referenced by MythPainterVulkan(), and ~MythPainterVulkan().

◆ GetFormatImagePriv()

MythImage * MythPainterVulkan::GetFormatImagePriv ( )
overrideprotectedvirtual

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

Implements MythPainter.

Definition at line 381 of file mythpaintervulkan.cpp.

◆ DeleteFormatImagePriv()

void MythPainterVulkan::DeleteFormatImagePriv ( MythImage Image)
overrideprotectedvirtual

Implements MythPainter.

Definition at line 386 of file mythpaintervulkan.cpp.

Referenced by GetTextureFromCache().

◆ Ready()

bool MythPainterVulkan::Ready ( )
private

Definition at line 122 of file mythpaintervulkan.cpp.

Referenced by Begin(), DeleteTextures(), End(), and GetTextureFromCache().

◆ ClearCache()

void MythPainterVulkan::ClearCache ( )
private

Definition at line 396 of file mythpaintervulkan.cpp.

Referenced by FreeResources().

◆ GetTextureFromCache()

MythTextureVulkan * MythPainterVulkan::GetTextureFromCache ( MythImage Image)
private

Definition at line 410 of file mythpaintervulkan.cpp.

Referenced by DrawImage().

Member Data Documentation

◆ m_ready

bool MythPainterVulkan::m_ready { false }
private

Definition at line 54 of file mythpaintervulkan.h.

Referenced by DoFreeResources(), and Ready().

◆ m_vulkan

MythVulkanObject* MythPainterVulkan::m_vulkan { nullptr }
private

◆ m_projectionDescriptorPool

VkDescriptorPool MythPainterVulkan::m_projectionDescriptorPool { MYTH_NULL_DISPATCH }
private

Definition at line 57 of file mythpaintervulkan.h.

Referenced by DoFreeResources(), and Ready().

◆ m_projectionDescriptor

VkDescriptorSet MythPainterVulkan::m_projectionDescriptor { MYTH_NULL_DISPATCH }
private

Definition at line 58 of file mythpaintervulkan.h.

Referenced by DoFreeResources(), End(), and Ready().

◆ m_projectionUniform

MythUniformBufferVulkan* MythPainterVulkan::m_projectionUniform { nullptr }
private

Definition at line 59 of file mythpaintervulkan.h.

Referenced by DoFreeResources(), and Ready().

◆ m_textureSampler

VkSampler MythPainterVulkan::m_textureSampler { MYTH_NULL_DISPATCH }
private

Definition at line 60 of file mythpaintervulkan.h.

Referenced by DoFreeResources(), and GetTextureFromCache().

◆ m_textureShader

MythShaderVulkan* MythPainterVulkan::m_textureShader { nullptr }
private

Definition at line 61 of file mythpaintervulkan.h.

Referenced by DoFreeResources(), End(), and Ready().

◆ m_texturePipeline

VkPipeline MythPainterVulkan::m_texturePipeline { MYTH_NULL_DISPATCH }
private

Definition at line 62 of file mythpaintervulkan.h.

Referenced by DoFreeResources(), End(), and Ready().

◆ m_textureDescriptorPool

VkDescriptorPool MythPainterVulkan::m_textureDescriptorPool { MYTH_NULL_DISPATCH }
private

Definition at line 63 of file mythpaintervulkan.h.

Referenced by DoFreeResources(), GetTextureFromCache(), and Ready().

◆ m_textureDescriptorsCreated

bool MythPainterVulkan::m_textureDescriptorsCreated { false }
private

Definition at line 64 of file mythpaintervulkan.h.

Referenced by DoFreeResources().

◆ m_availableTextureDescriptors

std::vector<VkDescriptorSet> MythPainterVulkan::m_availableTextureDescriptors
private

Definition at line 65 of file mythpaintervulkan.h.

Referenced by DeleteTextures(), DoFreeResources(), and GetTextureFromCache().

◆ m_textureUploadCmd

VkCommandBuffer MythPainterVulkan::m_textureUploadCmd { nullptr }
private

Definition at line 66 of file mythpaintervulkan.h.

Referenced by DoFreeResources(), End(), and GetTextureFromCache().

◆ m_frameStarted

bool MythPainterVulkan::m_frameStarted { false }
private

Definition at line 67 of file mythpaintervulkan.h.

Referenced by Begin(), DoFreeResources(), DrawImage(), and End().

◆ m_stagedTextures

std::vector<MythTextureVulkan*> MythPainterVulkan::m_stagedTextures
private

Definition at line 69 of file mythpaintervulkan.h.

Referenced by End(), and GetTextureFromCache().

◆ m_queuedTextures

std::vector<MythTextureVulkan*> MythPainterVulkan::m_queuedTextures
private

Definition at line 70 of file mythpaintervulkan.h.

Referenced by DrawImage(), and End().

◆ m_imageToTextureMap

QMap<MythImage*, MythTextureVulkan*> MythPainterVulkan::m_imageToTextureMap
private

Definition at line 71 of file mythpaintervulkan.h.

Referenced by ClearCache(), DeleteFormatImagePriv(), and GetTextureFromCache().

◆ m_imageExpire

std::list<MythImage*> MythPainterVulkan::m_imageExpire
private

Definition at line 72 of file mythpaintervulkan.h.

Referenced by ClearCache(), DeleteFormatImagePriv(), and GetTextureFromCache().

◆ m_texturesToDelete

QVector<MythTextureVulkan*> MythPainterVulkan::m_texturesToDelete
private

Definition at line 73 of file mythpaintervulkan.h.

Referenced by Begin(), ClearCache(), DeleteFormatImagePriv(), and DeleteTextures().

◆ m_projection

QMatrix4x4 MythPainterVulkan::m_projection
private

Definition at line 75 of file mythpaintervulkan.h.

Referenced by Ready().

◆ m_transforms

QStack<QMatrix4x4> MythPainterVulkan::m_transforms
private

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