00001 #ifndef MYTHPAINTER_D3D9_H 00002 #define MYTHPAINTER_D3D9_H 00003 00004 #include <QMap> 00005 00006 #include "mythpainter.h" 00007 #include "mythimage.h" 00008 #include "mythrender_d3d9.h" 00009 #include "mythuiexp.h" 00010 00011 class MythRenderD3D9; 00012 00013 class MUI_PUBLIC MythD3D9Painter : public MythPainter 00014 { 00015 public: 00016 MythD3D9Painter(MythRenderD3D9 *render = NULL); 00017 ~MythD3D9Painter(); 00018 00019 void SetTarget(D3D9Image *target) { m_target = target; } 00020 void SetSwapControl(bool swap) { m_swap_control = swap; } 00021 virtual QString GetName(void) { return QString("D3D9"); } 00022 virtual bool SupportsAnimation(void) { return true; } 00023 virtual bool SupportsAlpha(void) { return true; } 00024 virtual bool SupportsClipping(void) { return false; } 00025 virtual void FreeResources(void); 00026 virtual void Begin(QPaintDevice *parent); 00027 virtual void End(); 00028 00029 virtual void DrawImage(const QRect &dest, MythImage *im, const QRect &src, 00030 int alpha); 00031 virtual void DrawRect(const QRect &area, const QBrush &fillBrush, 00032 const QPen &linePen, int alpha); 00033 00034 protected: 00035 virtual MythImage* GetFormatImagePriv(void) { return new MythImage(this); } 00036 virtual void DeleteFormatImagePriv(MythImage *im); 00037 bool InitD3D9(QPaintDevice *parent); 00038 void Teardown(void); 00039 void ClearCache(void); 00040 void DeleteBitmaps(void); 00041 D3D9Image* GetImageFromCache(MythImage *im); 00042 00043 MythRenderD3D9 *m_render; 00044 bool m_created_render; 00045 D3D9Image *m_target; 00046 bool m_swap_control; 00047 QMap<MythImage *, D3D9Image*> m_ImageBitmapMap; 00048 std::list<MythImage *> m_ImageExpireList; 00049 std::list<D3D9Image*> m_bitmapDeleteList; 00050 QMutex m_bitmapDeleteLock; 00051 }; 00052 00053 #endif // MYTHPAINTER_D3D9_H
1.6.3