MythTV  master
mythpainter_d3d9.h
Go to the documentation of this file.
1 #ifndef MYTHPAINTER_D3D9_H
2 #define MYTHPAINTER_D3D9_H
3 
4 #include <QMap>
5 
6 #include "mythpainter.h"
7 #include "mythimage.h"
8 #include "mythrender_d3d9.h"
9 #include "mythuiexp.h"
10 
11 class MythRenderD3D9;
12 
14 {
15  friend class VideoOutputD3D;
16  public:
17  explicit MythD3D9Painter(MythRenderD3D9 *render = nullptr);
18  ~MythD3D9Painter();
19 
20  void SetTarget(D3D9Image *target) { m_target = target; }
21  void SetSwapControl(bool swap) { m_swap_control = swap; }
22  QString GetName(void) override // MythPainter
23  { return QString("D3D9"); }
24  bool SupportsAnimation(void) override // MythPainter
25  { return true; }
26  bool SupportsAlpha(void) override // MythPainter
27  { return true; }
28  bool SupportsClipping(void) override // MythPainter
29  { return false; }
30  void FreeResources(void) override; // MythPainter
31  void Begin(QPaintDevice *parent) override; // MythPainter
32  void End() override; // MythPainter
33 
34  void DrawImage(const QRect &dest, MythImage *im, const QRect &src,
35  int alpha) override; // MythPainter
36  void DrawRect(const QRect &area, const QBrush &fillBrush,
37  const QPen &linePen, int alpha) override; // MythPainter
38 
39  protected:
40  MythImage* GetFormatImagePriv(void) override // MythPainter
41  { return new MythImage(this); }
42  void DeleteFormatImagePriv(MythImage *im) override; // MythPainter
43  void Teardown(void) override; // MythPainter
44 
45  bool InitD3D9(QPaintDevice *parent);
46  void ClearCache(void);
47  void DeleteBitmaps(void);
48  D3D9Image* GetImageFromCache(MythImage *im);
49 
51  D3D9Image *m_target {nullptr};
52  bool m_swap_control {true};
53  QMap<MythImage *, D3D9Image*> m_ImageBitmapMap;
54  std::list<MythImage *> m_ImageExpireList;
55  std::list<D3D9Image*> m_bitmapDeleteList;
57 };
58 
59 #endif // MYTHPAINTER_D3D9_H
build_compdb.dest
dest
Definition: build_compdb.py:9
MythD3D9Painter::SupportsAlpha
bool SupportsAlpha(void) override
Definition: mythpainter_d3d9.h:26
MUI_PUBLIC
#define MUI_PUBLIC
Definition: mythuiexp.h:9
MythD3D9Painter::m_bitmapDeleteList
std::list< D3D9Image * > m_bitmapDeleteList
Definition: mythpainter_d3d9.h:55
MythD3D9Painter::SupportsClipping
bool SupportsClipping(void) override
Definition: mythpainter_d3d9.h:28
MythD3D9Painter::m_bitmapDeleteLock
QMutex m_bitmapDeleteLock
Definition: mythpainter_d3d9.h:56
VideoOutputD3D::m_render
MythRenderD3D9 * m_render
Definition: videoout_d3d.h:78
MythPainter::DeleteFormatImagePriv
virtual void DeleteFormatImagePriv(MythImage *im)=0
MythD3D9Painter::GetFormatImagePriv
MythImage * GetFormatImagePriv(void) override
Creates a reference counted image, call DecrRef() to delete.
Definition: mythpainter_d3d9.h:40
MythD3D9Painter::m_ImageExpireList
std::list< MythImage * > m_ImageExpireList
Definition: mythpainter_d3d9.h:54
MythD3D9Painter::SupportsAnimation
bool SupportsAnimation(void) override
Definition: mythpainter_d3d9.h:24
D3D9Image
Definition: mythrender_d3d9.h:24
MythPainter::DrawImage
virtual void DrawImage(const QRect &dest, MythImage *im, const QRect &src, int alpha)=0
MythD3D9Painter::SetSwapControl
void SetSwapControl(bool swap)
Definition: mythpainter_d3d9.h:21
MythRenderD3D9
Definition: mythrender_d3d9.h:63
mythpainter.h
MythPainter::FreeResources
virtual void FreeResources(void)
Definition: mythpainter.h:51
MythPainter::End
virtual void End()
Definition: mythpainter.h:53
MythD3D9Painter::SetTarget
void SetTarget(D3D9Image *target)
Definition: mythpainter_d3d9.h:20
MythPainter::DrawRect
virtual void DrawRect(const QRect &area, const QBrush &fillBrush, const QPen &linePen, int alpha)
Definition: mythpainter.cpp:157
mythimage.h
MythD3D9Painter::m_ImageBitmapMap
QMap< MythImage *, D3D9Image * > m_ImageBitmapMap
Definition: mythpainter_d3d9.h:53
MythPainter
Definition: mythpainter.h:33
MythImage
Definition: mythimage.h:37
MythD3D9Painter
Definition: mythpainter_d3d9.h:14
mythrender_d3d9.h
MythPainter::Begin
virtual void Begin(QPaintDevice *parent)
Definition: mythpainter.h:52
VideoOutputD3D
Definition: videoout_d3d.h:16
MythPainter::Teardown
virtual void Teardown(void)
Definition: mythpainter.cpp:28
mythuiexp.h
MythD3D9Painter::GetName
QString GetName(void) override
Definition: mythpainter_d3d9.h:22