12#define LOC QString("D3D9 Painter: ")
31 QWidget *real_parent = (QWidget*)parent;
39 if (
m_render->
Create(real_parent->size(), (HWND)real_parent->winId()))
75 LOG(VB_GENERAL, LOG_ERR,
"Failed to create D3D9 render.");
89 LOG(VB_GENERAL, LOG_ERR,
"Failed to enable offscreen buffer.");
117 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Clearing D3D9 painter cache.");
143 const QRect src,
int alpha)
154 const QPen &linePen,
int alpha)
156 int style = fillBrush.style();
157 if (style == Qt::SolidPattern || style == Qt::NoBrush)
162 if (style != Qt::NoBrush)
165 if (linePen.style() != Qt::NoPen)
167 int lineWidth = linePen.width();
168 QRect top(QPoint(area.x(), area.y()),
169 QSize(area.width(), lineWidth));
170 QRect bot(QPoint(area.x(), area.y() + area.height() - lineWidth),
171 QSize(area.width(), lineWidth));
172 QRect left(QPoint(area.x(), area.y()),
173 QSize(lineWidth, area.height()));
174 QRect right(QPoint(area.x() + area.width() - lineWidth, area.y()),
175 QSize(lineWidth, area.height()));
219 if (newimage && newimage->
IsValid())
237 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to create D3D9 UI bitmap.");
bool UpdateImage(IDirect3DSurface9 *surface)
bool UpdateVertices(const QRect &dvr, const QRect &vr, int alpha=255, bool video=false)
int GetDataSize(void) const
bool SetAsRenderTarget(void)
void DrawRect(QRect area, const QBrush &fillBrush, const QPen &linePen, int alpha) override
std::list< MythImage * > m_ImageExpireList
bool InitD3D9(QPaintDevice *parent)
void FreeResources(void) override
void Teardown(void) override
std::list< D3D9Image * > m_bitmapDeleteList
MythD3D9Painter(MythRenderD3D9 *render=nullptr)
MythRenderD3D9 * m_render
void DeleteFormatImagePriv(MythImage *im) override
QMutex m_bitmapDeleteLock
void DrawImage(QRect dest, MythImage *im, QRect src, int alpha) override
QMap< MythImage *, D3D9Image * > m_ImageBitmapMap
D3D9Image * GetImageFromCache(MythImage *im)
void Begin(QPaintDevice *parent) override
virtual void SetChanged(bool change=true)
virtual void DrawRect(QRect area, const QBrush &fillBrush, const QPen &linePen, int alpha)
void CheckFormatImage(MythImage *im)
virtual void Begin(QPaintDevice *)
int m_maxHardwareCacheSize
virtual void Teardown(void)
void DrawRect(const QRect &rect, const QColor &color, int alpha)
bool SetRenderTarget(IDirect3DTexture9 *texture)
bool Create(QSize size, HWND window)
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
virtual int IncrRef(void)
Increments reference count.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)