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
11class MythRenderD3D9;
12
14{
15 friend class VideoOutputD3D;
16 public:
17 explicit MythD3D9Painter(MythRenderD3D9 *render = nullptr);
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(QRect dest, MythImage *im, QRect src,
35 int alpha) override; // MythPainter
36 void DrawRect(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
void SetSwapControl(bool swap)
std::list< MythImage * > m_ImageExpireList
bool SupportsAlpha(void) override
bool SupportsClipping(void) override
bool SupportsAnimation(void) override
std::list< D3D9Image * > m_bitmapDeleteList
void SetTarget(D3D9Image *target)
QMap< MythImage *, D3D9Image * > m_ImageBitmapMap
MythImage * GetFormatImagePriv(void) override
Creates a reference counted image, call DecrRef() to delete.
QString GetName(void) override
virtual void DeleteFormatImagePriv(MythImage *im)=0
virtual void DrawRect(QRect area, const QBrush &fillBrush, const QPen &linePen, int alpha)
virtual void DrawImage(QRect dest, MythImage *im, QRect src, int alpha)=0
virtual void Begin(QPaintDevice *)
Definition: mythpainter.h:54
virtual void End()
Definition: mythpainter.h:55
virtual void Teardown(void)
Definition: mythpainter.cpp:27
virtual void FreeResources(void)
Definition: mythpainter.h:53
MythRenderD3D9 * m_render
Definition: videoout_d3d.h:60
#define MUI_PUBLIC
Definition: mythuiexp.h:9