MythTV master
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
MythRenderD3D9 Class Reference

#include <libmythui/mythrender_d3d9.h>

Inheritance diagram for MythRenderD3D9:
[legend]
Collaboration diagram for MythRenderD3D9:
[legend]

Public Member Functions

 MythRenderD3D9 ()
 
bool Create (QSize size, HWND window)
 
bool Test (bool &reset)
 
bool ClearBuffer (void)
 
bool Begin (void)
 
bool End (void)
 
void CopyFrame (void *surface, D3D9Image *img)
 
bool StretchRect (IDirect3DTexture9 *texture, IDirect3DSurface9 *surface, bool known_surface=true)
 
bool DrawTexturedQuad (IDirect3DVertexBuffer9 *vertexbuffer)
 
void DrawRect (const QRect &rect, const QColor &color, int alpha)
 
bool Present (HWND win)
 
bool HardwareYUVConversion (void)
 
QRect GetRect (IDirect3DVertexBuffer9 *vertexbuffer)
 
bool SetRenderTarget (IDirect3DTexture9 *texture)
 
IDirect3DTexture9 * CreateTexture (const QSize &size)
 
void DeleteTexture (IDirect3DTexture9 *texture)
 
IDirect3DVertexBuffer9 * CreateVertexBuffer (IDirect3DTexture9 *texture=nullptr)
 
bool UpdateVertexBuffer (IDirect3DVertexBuffer9 *vertexbuffer, const QRect &dvr, const QRect &vr, int alpha=255, bool video=false)
 
void DeleteVertexBuffer (IDirect3DVertexBuffer9 *vertexbuffer)
 
IDirect3DSurface9 * CreateSurface (const QSize &size, bool video=false)
 
bool UpdateSurface (IDirect3DSurface9 *surface, const MythImage *image)
 
void DeleteSurface (IDirect3DSurface9 *surface)
 
uint8_t * GetBuffer (IDirect3DSurface9 *surface, uint &pitch)
 
void ReleaseBuffer (IDirect3DSurface9 *surface)
 
IDirect3DDevice9 * AcquireDevice (void)
 
void ReleaseDevice (void)
 
IDirect3DDeviceManager9GetDeviceManager (void)
 
- Public Member Functions inherited from MythRender
 MythRender (RenderType type)
 
bool IsShared (void) const
 Warning: The reference count can be decremented between the call to this function and the use of it's value. More...
 
RenderType Type (void) const
 
bool IsErrored (void) const
 
QSize GetSize (void) const
 
virtual QStringList GetDescription ()
 
virtual void SetViewPort (const QRect, bool=false)
 
- Public Member Functions inherited from ReferenceCounter
 ReferenceCounter (const QString &debugName, bool logDebug=true)
 Creates reference counter with an initial value of 1. More...
 
virtual int IncrRef (void)
 Increments reference count. More...
 
virtual int DecrRef (void)
 Decrements reference count and deletes on 0. More...
 

Static Public Member Functions

static void * ResolveAddress (const char *lib, const char *proc)
 
- Static Public Member Functions inherited from ReferenceCounter
static void PrintDebug (void)
 Print out any leaks if that level of debugging is enabled. More...
 

Private Member Functions

virtual ~MythRenderD3D9 ()
 
bool SetTexture (IDirect3DDevice9 *dev, IDirect3DTexture9 *texture, int num=0)
 
void DeleteTextures (void)
 
void DeleteVertexBuffers (void)
 
void DeleteSurfaces (void)
 
void Init2DState (void)
 
void EnableBlending (IDirect3DDevice9 *dev, bool enable)
 
void MultiTexturing (IDirect3DDevice9 *dev, bool enable, IDirect3DTexture9 *texture=nullptr)
 
void SetTextureVertices (IDirect3DDevice9 *dev, bool enable)
 
void CreateDeviceManager (void)
 
void DestroyDeviceManager (void)
 

Private Attributes

QMap< IDirect3DTexture9 *, QSize > m_textures
 
QMap< IDirect3DVertexBuffer9 *, MythD3DVertexBufferm_vertexbuffers
 
QMap< IDirect3DSurface9 *, MythD3DSurfacem_surfaces
 
IDirect3D9 * m_d3d {nullptr}
 
IDirect3DDevice9 * m_rootD3DDevice {nullptr}
 
D3DFORMAT m_adaptor_fmt {D3DFMT_UNKNOWN}
 
D3DFORMAT m_videosurface_fmt {D3DFMT_UNKNOWN}
 
D3DFORMAT m_surface_fmt {D3DFMT_UNKNOWN}
 
D3DFORMAT m_texture_fmt {D3DFMT_UNKNOWN}
 
IDirect3DVertexBuffer9 * m_rect_vertexbuffer {nullptr}
 
IDirect3DSurface9 * m_default_surface {nullptr}
 
IDirect3DSurface9 * m_current_surface {nullptr}
 
QRecursiveMutex m_lock
 
bool m_blend {true}
 
bool m_multi_texturing {true}
 
bool m_texture_vertices {true}
 
IDirect3DDeviceManager9m_deviceManager {nullptr}
 
HANDLE m_deviceHandle {nullptr}
 
uint m_deviceManagerToken {0}
 

Additional Inherited Members

- Protected Member Functions inherited from MythRender
 ~MythRender () override=default
 
virtual void ReleaseResources (void)
 
- Protected Member Functions inherited from ReferenceCounter
virtual ~ReferenceCounter (void)
 Called on destruction, will warn if object deleted with references in place. More...
 
- Protected Attributes inherited from MythRender
RenderType m_type
 
QSize m_size
 
bool m_errored
 
- Protected Attributes inherited from ReferenceCounter
bool m_logDebug
 This is used to suppress creating LoggingItem classes for LoggingItem reference count changes. More...
 
QAtomicInt m_referenceCount {1}
 

Detailed Description

Definition at line 96 of file mythrender_d3d9.h.

Constructor & Destructor Documentation

◆ MythRenderD3D9()

MythRenderD3D9::MythRenderD3D9 ( )
inline

Definition at line 101 of file mythrender_d3d9.h.

◆ ~MythRenderD3D9()

MythRenderD3D9::~MythRenderD3D9 ( void  )
privatevirtual

Definition at line 158 of file mythrender_d3d9.cpp.

Member Function Documentation

◆ AcquireDevice()

IDirect3DDevice9 * MythRenderD3D9::AcquireDevice ( void  )

Definition at line 1117 of file mythrender_d3d9.cpp.

Referenced by D3D9Locker::Acquire(), and Init2DState().

◆ Begin()

bool MythRenderD3D9::Begin ( void  )

Definition at line 440 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::Begin(), and VideoOutputD3D::RenderFrame().

◆ ClearBuffer()

bool MythRenderD3D9::ClearBuffer ( void  )

Definition at line 423 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::Begin(), and VideoOutputD3D::RenderFrame().

◆ CopyFrame()

void MythRenderD3D9::CopyFrame ( void *  surface,
D3D9Image img 
)

Definition at line 472 of file mythrender_d3d9.cpp.

Referenced by VideoOutputD3D::PrepareFrame().

◆ Create()

bool MythRenderD3D9::Create ( QSize  size,
HWND  window 
)

Definition at line 222 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::InitD3D9(), and VideoOutputD3D::SetupContext().

◆ CreateDeviceManager()

void MythRenderD3D9::CreateDeviceManager ( void  )
private

Definition at line 1167 of file mythrender_d3d9.cpp.

Referenced by Create().

◆ CreateSurface()

IDirect3DSurface9 * MythRenderD3D9::CreateSurface ( const QSize &  size,
bool  video = false 
)

Definition at line 800 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::D3D9Image().

◆ CreateTexture()

IDirect3DTexture9 * MythRenderD3D9::CreateTexture ( const QSize &  size)

Definition at line 759 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::D3D9Image().

◆ CreateVertexBuffer()

IDirect3DVertexBuffer9 * MythRenderD3D9::CreateVertexBuffer ( IDirect3DTexture9 *  texture = nullptr)

Definition at line 922 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::D3D9Image().

◆ DeleteSurface()

void MythRenderD3D9::DeleteSurface ( IDirect3DSurface9 *  surface)

Definition at line 881 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::~D3D9Image().

◆ DeleteSurfaces()

void MythRenderD3D9::DeleteSurfaces ( void  )
private

Definition at line 873 of file mythrender_d3d9.cpp.

Referenced by ~MythRenderD3D9().

◆ DeleteTexture()

void MythRenderD3D9::DeleteTexture ( IDirect3DTexture9 *  texture)

Definition at line 790 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::~D3D9Image().

◆ DeleteTextures()

void MythRenderD3D9::DeleteTextures ( void  )
private

Definition at line 782 of file mythrender_d3d9.cpp.

Referenced by ~MythRenderD3D9().

◆ DeleteVertexBuffer()

void MythRenderD3D9::DeleteVertexBuffer ( IDirect3DVertexBuffer9 *  vertexbuffer)

Definition at line 959 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::~D3D9Image().

◆ DeleteVertexBuffers()

void MythRenderD3D9::DeleteVertexBuffers ( void  )
private

Definition at line 948 of file mythrender_d3d9.cpp.

Referenced by ~MythRenderD3D9().

◆ DestroyDeviceManager()

void MythRenderD3D9::DestroyDeviceManager ( void  )
private

Definition at line 1210 of file mythrender_d3d9.cpp.

Referenced by ~MythRenderD3D9().

◆ DrawRect()

void MythRenderD3D9::DrawRect ( const QRect &  rect,
const QColor &  color,
int  alpha 
)

Definition at line 547 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::DrawRect().

◆ DrawTexturedQuad()

bool MythRenderD3D9::DrawTexturedQuad ( IDirect3DVertexBuffer9 *  vertexbuffer)

Definition at line 510 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::Draw().

◆ EnableBlending()

void MythRenderD3D9::EnableBlending ( IDirect3DDevice9 *  dev,
bool  enable 
)
private

Definition at line 1097 of file mythrender_d3d9.cpp.

Referenced by DrawRect(), DrawTexturedQuad(), and Init2DState().

◆ End()

bool MythRenderD3D9::End ( void  )

Definition at line 456 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::End(), and VideoOutputD3D::RenderEnd().

◆ GetBuffer()

uint8_t * MythRenderD3D9::GetBuffer ( IDirect3DSurface9 *  surface,
uint pitch 
)

Definition at line 891 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::GetBuffer(), and UpdateSurface().

◆ GetDeviceManager()

IDirect3DDeviceManager9 * MythRenderD3D9::GetDeviceManager ( void  )
inline

Definition at line 172 of file mythrender_d3d9.h.

Referenced by DXVA2Decoder::CreateVideoService().

◆ GetRect()

QRect MythRenderD3D9::GetRect ( IDirect3DVertexBuffer9 *  vertexbuffer)

Definition at line 682 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::GetRect().

◆ HardwareYUVConversion()

bool MythRenderD3D9::HardwareYUVConversion ( void  )

Definition at line 375 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::GetBuffer().

◆ Init2DState()

void MythRenderD3D9::Init2DState ( void  )
private

Definition at line 1067 of file mythrender_d3d9.cpp.

Referenced by Create().

◆ MultiTexturing()

void MythRenderD3D9::MultiTexturing ( IDirect3DDevice9 *  dev,
bool  enable,
IDirect3DTexture9 *  texture = nullptr 
)
private

Definition at line 629 of file mythrender_d3d9.cpp.

Referenced by DrawRect(), DrawTexturedQuad(), and Init2DState().

◆ Present()

bool MythRenderD3D9::Present ( HWND  win)

Definition at line 665 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::End(), and VideoOutputD3D::EndFrame().

◆ ReleaseBuffer()

void MythRenderD3D9::ReleaseBuffer ( IDirect3DSurface9 *  surface)

Definition at line 911 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::ReleaseBuffer(), and UpdateSurface().

◆ ReleaseDevice()

void MythRenderD3D9::ReleaseDevice ( void  )

Definition at line 1149 of file mythrender_d3d9.cpp.

Referenced by Init2DState(), and D3D9Locker::~D3D9Locker().

◆ ResolveAddress()

void * MythRenderD3D9::ResolveAddress ( const char *  lib,
const char *  proc 
)
static

◆ SetRenderTarget()

bool MythRenderD3D9::SetRenderTarget ( IDirect3DTexture9 *  texture)

Definition at line 689 of file mythrender_d3d9.cpp.

Referenced by MythD3D9Painter::End(), and D3D9Image::SetAsRenderTarget().

◆ SetTexture()

bool MythRenderD3D9::SetTexture ( IDirect3DDevice9 *  dev,
IDirect3DTexture9 *  texture,
int  num = 0 
)
private

Definition at line 744 of file mythrender_d3d9.cpp.

Referenced by DrawRect(), DrawTexturedQuad(), and MultiTexturing().

◆ SetTextureVertices()

void MythRenderD3D9::SetTextureVertices ( IDirect3DDevice9 *  dev,
bool  enable 
)
private

Definition at line 1107 of file mythrender_d3d9.cpp.

Referenced by DrawRect(), DrawTexturedQuad(), and Init2DState().

◆ StretchRect()

bool MythRenderD3D9::StretchRect ( IDirect3DTexture9 *  texture,
IDirect3DSurface9 *  surface,
bool  known_surface = true 
)

Definition at line 478 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::ReleaseBuffer(), and D3D9Image::UpdateImage().

◆ Test()

bool MythRenderD3D9::Test ( bool &  reset)

◆ UpdateSurface()

bool MythRenderD3D9::UpdateSurface ( IDirect3DSurface9 *  surface,
const MythImage image 
)

Definition at line 827 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::UpdateImage().

◆ UpdateVertexBuffer()

bool MythRenderD3D9::UpdateVertexBuffer ( IDirect3DVertexBuffer9 *  vertexbuffer,
const QRect &  dvr,
const QRect &  vr,
int  alpha = 255,
bool  video = false 
)

Definition at line 969 of file mythrender_d3d9.cpp.

Referenced by D3D9Image::UpdateVertices().

Member Data Documentation

◆ m_adaptor_fmt

D3DFORMAT MythRenderD3D9::m_adaptor_fmt {D3DFMT_UNKNOWN}
private

Definition at line 156 of file mythrender_d3d9.h.

Referenced by Create().

◆ m_blend

bool MythRenderD3D9::m_blend {true}
private

Definition at line 165 of file mythrender_d3d9.h.

Referenced by EnableBlending().

◆ m_current_surface

IDirect3DSurface9* MythRenderD3D9::m_current_surface {nullptr}
private

Definition at line 162 of file mythrender_d3d9.h.

Referenced by SetRenderTarget(), and ~MythRenderD3D9().

◆ m_d3d

IDirect3D9* MythRenderD3D9::m_d3d {nullptr}
private

Definition at line 154 of file mythrender_d3d9.h.

Referenced by Create(), and ~MythRenderD3D9().

◆ m_default_surface

IDirect3DSurface9* MythRenderD3D9::m_default_surface {nullptr}
private

Definition at line 161 of file mythrender_d3d9.h.

Referenced by SetRenderTarget(), and ~MythRenderD3D9().

◆ m_deviceHandle

HANDLE MythRenderD3D9::m_deviceHandle {nullptr}
private

◆ m_deviceManager

IDirect3DDeviceManager9* MythRenderD3D9::m_deviceManager {nullptr}
private

◆ m_deviceManagerToken

uint MythRenderD3D9::m_deviceManagerToken {0}
private

Definition at line 181 of file mythrender_d3d9.h.

Referenced by CreateDeviceManager().

◆ m_lock

QRecursiveMutex MythRenderD3D9::m_lock
private

◆ m_multi_texturing

bool MythRenderD3D9::m_multi_texturing {true}
private

Definition at line 166 of file mythrender_d3d9.h.

Referenced by MultiTexturing().

◆ m_rect_vertexbuffer

IDirect3DVertexBuffer9* MythRenderD3D9::m_rect_vertexbuffer {nullptr}
private

Definition at line 160 of file mythrender_d3d9.h.

Referenced by DrawRect(), and ~MythRenderD3D9().

◆ m_rootD3DDevice

IDirect3DDevice9* MythRenderD3D9::m_rootD3DDevice {nullptr}
private

Definition at line 155 of file mythrender_d3d9.h.

Referenced by AcquireDevice(), Create(), CreateDeviceManager(), and ~MythRenderD3D9().

◆ m_surface_fmt

D3DFORMAT MythRenderD3D9::m_surface_fmt {D3DFMT_UNKNOWN}
private

Definition at line 158 of file mythrender_d3d9.h.

Referenced by Create(), and CreateSurface().

◆ m_surfaces

QMap<IDirect3DSurface9*, MythD3DSurface> MythRenderD3D9::m_surfaces
private

◆ m_texture_fmt

D3DFORMAT MythRenderD3D9::m_texture_fmt {D3DFMT_UNKNOWN}
private

Definition at line 159 of file mythrender_d3d9.h.

Referenced by Create(), and CreateTexture().

◆ m_texture_vertices

bool MythRenderD3D9::m_texture_vertices {true}
private

Definition at line 167 of file mythrender_d3d9.h.

Referenced by SetTextureVertices().

◆ m_textures

QMap<IDirect3DTexture9*, QSize> MythRenderD3D9::m_textures
private

◆ m_vertexbuffers

QMap<IDirect3DVertexBuffer9*, MythD3DVertexBuffer> MythRenderD3D9::m_vertexbuffers
private

◆ m_videosurface_fmt

D3DFORMAT MythRenderD3D9::m_videosurface_fmt {D3DFMT_UNKNOWN}
private

Definition at line 157 of file mythrender_d3d9.h.

Referenced by Create(), CreateSurface(), and HardwareYUVConversion().


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