]> git.vomp.tv Git - vompclient.git/commitdiff
Remove some dead code, rename some things
authorChris Tallon <chris@vomp.tv>
Mon, 11 May 2020 20:59:38 +0000 (21:59 +0100)
committerChris Tallon <chris@vomp.tv>
Mon, 11 May 2020 20:59:38 +0000 (21:59 +0100)
Remove all Osd::getFD() functions
Rename struct SurfaceCommands to SurfaceInfo
Rename OsdVector::scommands to surfaces
Rename OsdVector::dereferenceSVGCommand to decrementAllRefCounts
Rename OsdVector::referenceSVGCommand to incrementAllRefCounts

13 files changed:
osd.h
osddirectfb.cc
osddirectfb.h
osdopengl.cc
osdopengl.h
osdopenvg.cc
osdopenvg.h
osdvector.cc
osdvector.h
osdwinpixel.cc
osdwinpixel.h
osdwinvector.cc
osdwinvector.h

diff --git a/osd.h b/osd.h
index 89db75e882d14845db5551c33c739b9950b20cd8..003a33d7041fc810052ec63390e4eb751c5ed9e7 100644 (file)
--- a/osd.h
+++ b/osd.h
@@ -39,8 +39,6 @@ class Osd
 
     bool isInitted() { return initted; };
 
-    virtual int getFD()=0;
-
     virtual void screenShot(const char* fileName)=0;
 
     virtual int getFontNames(const char*** /* names */,const char*** /* names_keys */) { return 0; };
index d7980c8df473c3de518080f563e1d54c833798a5..923318c85e8a765e494688cbba23b481eba8012b 100644 (file)
@@ -39,12 +39,6 @@ OsdDirectFB::~OsdDirectFB()
   if (initted) shutdown();
 }
 
-int OsdDirectFB::getFD()
-{
-  if (!initted) return 0;
-  return 0;
-}
-
 int OsdDirectFB::init()
 {
 
index dcdafed23ca8fd050c35578de978de8001b41ef0..48caf7051c1c1d957f0eb3a24be60e62d0bd2553 100644 (file)
@@ -42,8 +42,6 @@ class OsdDirectFB : public Osd
     int init();
     int shutdown();
 
-    int getFD();
-
     void screenShot(char* fileName);
     
     IDirectFB* getDfb() {return dfb;};
index 2ad47c5e6f7736ced9896133b244e24ad36b0dfb..9f0d9a0ec353dcf0d0f1b09dce370d8f862d5ab3 100644 (file)
@@ -59,12 +59,6 @@ OsdOpenGL::~OsdOpenGL()
   glmutex.unlock();
 }
 
-int OsdOpenGL::getFD()
-{
-  if (!initted) return 0;
-  return fdOsd;
-}
-
 Surface * OsdOpenGL::createNewSurface() {
        return (Surface*)new SurfaceOpenGL();
 }
index 82abbae2e4d5e0a162a404df6c05f7a9667b09d7..867956ebc1b2d8f1387653a595557bea6ab26799 100644 (file)
@@ -61,8 +61,6 @@ class OsdOpenGL : public Osd, public Thread_TYPE
     int init();
     int shutdown();
 
-    int getFD();
-
     void screenShot(const char* fileName);
 
     Surface * createNewSurface();
index 321c214556f356152b5bd1760e664a43ef894e60..cc1f7b62b92ce4acda9b35a01bcf2168ea2c28b6 100644 (file)
@@ -639,12 +639,11 @@ void OsdOpenVG::threadMethod()
     return;
   }
 
-  int ts = 0;
+  int ts;
 
   while (true)
   {
     ts = 1;
-    //unsigned int waittime=1;
 
     if (initted)
     {
@@ -1053,7 +1052,7 @@ int  OsdOpenVG::loadFont(bool newfont)
 }
 
 
-void OsdOpenVG::drawSetTrans(SurfaceCommands& sc)
+void OsdOpenVG::drawSetTrans(SurfaceInfo& sc)
 {
   vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
   vgLoadIdentity();
index f62c628113bcf1ecde09031ba33d69464b76ec97..a06182e0aabda39d9f4c36128e53192f4cab8a43 100644 (file)
@@ -121,7 +121,7 @@ class OsdOpenVG : public OsdVector, public Thread_TYPE
     VectorHandle createStyleRef(const DrawStyle& c);
     bool getStaticImageData(unsigned int static_id, UCHAR** userdata, ULONG* length);
 
-    void drawSetTrans(SurfaceCommands& sc);
+    void drawSetTrans(SurfaceInfo& sc);
     void executeDrawCommand(SVGCommand& command);
 
     void initPaths();
index e1eb8454ab87b1510c11f6c902eacc651a1103b1..d4b4ab15fb35ceea3ee70b9cff2ef12e469c1a42 100644 (file)
@@ -123,17 +123,6 @@ OsdVector::OsdVector()
   }
 
   styles_lastit_valid = styles_ref_lastit_valid = false;
-
-}
-
-OsdVector::~OsdVector()
-{
-}
-
-
-int OsdVector::getFD()
-{
-  return 0;
 }
 
 void OsdVector::screenShot(const char* fileName)
@@ -186,9 +175,9 @@ int OsdVector::restore()
   surfaces_mutex.lock();
 
   //Now go through all surfaces and draw them
-  std::list<SurfaceCommands>::iterator curdraw = scommands.begin();
+  std::list<SurfaceInfo>::iterator curdraw = surfaces.begin();
 
-  while (curdraw != scommands.end())
+  while (curdraw != surfaces.end())
   {
     (*curdraw).commands.clear();
     (*curdraw).commands.reserve(2048);
@@ -217,19 +206,19 @@ int OsdVector::restore()
 void OsdVector::drawSurfaces()
 {
   surfaces_mutex.lock();
-  std::list<SurfaceCommands*> todraw; //First figure out if a surfaces is below another surface
-  std::list<SurfaceCommands>::iterator itty1 = scommands.begin();
+  std::list<SurfaceInfo*> todraw; //First figure out if a surfaces is below another surface
+  std::list<SurfaceInfo>::iterator itty1 = surfaces.begin();
 
-  while (itty1 != scommands.end())
+  while (itty1 != surfaces.end())
   {
-    std::list<SurfaceCommands>::iterator itty2 = itty1;
+    std::list<SurfaceInfo>::iterator itty2 = itty1;
     itty2++;
     bool hidden = false;
 
-    while (itty2 != scommands.end())
+    while (itty2 != surfaces.end())
     {
-      SurfaceCommands& ref1 = *itty1;
-      SurfaceCommands& ref2 = *itty2;
+      SurfaceInfo& ref1 = *itty1;
+      SurfaceInfo& ref2 = *itty2;
 
       if (ref1.x >= ref2.x && ref1.y >= ref2.y
           && (ref1.x + ref1.w) <= (ref2.x + ref2.w)
@@ -253,7 +242,7 @@ void OsdVector::drawSurfaces()
   int swidth, sheight;
   getScreenSize(swidth, sheight);
   //Now go through all surfaces and draw them
-  std::list<SurfaceCommands*>::iterator curdraw = todraw.begin();
+  std::list<SurfaceInfo*>::iterator curdraw = todraw.begin();
 
   while (curdraw != todraw.end())
   {
@@ -298,14 +287,14 @@ void OsdVector::updateOrAddSurface(const SurfaceVector* surf, float x, float y,
 {
   surfaces_mutex.lock();
   //First determine it is already in our system
-  std::list<SurfaceCommands>::iterator itty = scommands.begin();
+  std::list<SurfaceInfo>::iterator itty = surfaces.begin();
 
-  while (itty != scommands.end())
+  while (itty != surfaces.end())
   {
     if ((*itty).surf == surf)
     {
       //decrease the references
-      dereferenceSVGCommand((*itty).commands);
+      decrementAllRefCounts((*itty).commands);
       break;
     }
 
@@ -313,15 +302,15 @@ void OsdVector::updateOrAddSurface(const SurfaceVector* surf, float x, float y,
   }
 
   // if not insert it
-  if (itty == scommands.end())
+  if (itty == surfaces.end())
   {
-    SurfaceCommands new_sc;
+    SurfaceInfo new_sc;
     new_sc.surf = surf;
     new_sc.x = x;
     new_sc.y = y;
     new_sc.w = width;
     new_sc.h = height;
-    itty = scommands.insert(itty, new_sc);
+    itty = surfaces.insert(itty, new_sc);
   }
 
   // update any images loaded in the mean time
@@ -351,7 +340,7 @@ void OsdVector::updateOrAddSurface(const SurfaceVector* surf, float x, float y,
   (*itty).commands.clear();
   (*itty).commands = commands;
   //increase the references
-  referenceSVGCommand((*itty).commands);
+  incrementAllRefCounts((*itty).commands);
   cleanupOrphanedRefs();
 
   surfaces_mutex.unlock();
@@ -361,15 +350,15 @@ void OsdVector::removeSurface(const SurfaceVector* surf)
 {
   surfaces_mutex.lock();
   //First determine it is already in our system
-  std::list<SurfaceCommands>::iterator itty = scommands.begin();
+  std::list<SurfaceInfo>::iterator itty = surfaces.begin();
 
-  while (itty != scommands.end())
+  while (itty != surfaces.end())
   {
     if ((*itty).surf == surf)
     {
-      dereferenceSVGCommand((*itty).commands);
+      decrementAllRefCounts((*itty).commands);
       (*itty).commands.clear();
-      scommands.erase(itty);
+      surfaces.erase(itty);
       break;
     }
 
@@ -380,7 +369,7 @@ void OsdVector::removeSurface(const SurfaceVector* surf)
 
 }
 
-void OsdVector::dereferenceSVGCommand(std::vector<SVGCommand>& commands )
+void OsdVector::decrementAllRefCounts(std::vector<SVGCommand>& commands )
 {
 
   std::vector<SVGCommand>::iterator sitty = commands.begin();
@@ -400,7 +389,7 @@ void OsdVector::dereferenceSVGCommand(std::vector<SVGCommand>& commands )
   }
 }
 
-void OsdVector::referenceSVGCommand(std::vector<SVGCommand>& commands )
+void OsdVector::incrementAllRefCounts(std::vector<SVGCommand>& commands )
 {
   std::vector<SVGCommand>::iterator sitty = commands.begin();
 
@@ -712,27 +701,6 @@ VectorHandle OsdVector::getStyleRef(const DrawStyle& c)
   return style_handle;
 }
 
-
-
-int OsdVector::getStyleRef(VectorHandle index)
-{
-  if (!styles_ref_lastit_valid || (*styles_ref_lastit).first != index)
-  {
-    styles_ref_lastit_valid = false;
-    styles_ref_lastit = styles_ref.find(index);
-  }
-
-  if (styles_ref_lastit == styles_ref.end())
-  {
-    return -1;
-  }
-  else
-  {
-    styles_ref_lastit_valid = true;
-    return (*styles_ref_lastit).second;
-  }
-}
-
 LoadIndex OsdVector::getTVMediaRef(TVMediaInfo& tvmedia, ImageIndex& image)
 {
   ImageIndex image_handle = 0;
index 7d4585b22e2d8dde8b07e4f8396183f6faeee65a..73962d45908daa2c994c4b26477635391bedde61 100644 (file)
@@ -204,7 +204,7 @@ class SVGCommand
 class SurfaceVector;
 class VDR_ResponsePacket;
 
-struct SurfaceCommands
+struct SurfaceInfo
 {
   const SurfaceVector* surf;
   std::vector<SVGCommand> commands;
@@ -216,13 +216,9 @@ class OsdVector : public Osd
 {
   public:
     OsdVector();
-    virtual ~OsdVector();
-
 
     int restore();
 
-    int getFD();
-
     void screenShot(const char* fileName);
     virtual bool screenShot(void* buffer, int width, int height, bool osd /*include osd*/) = 0;
 
@@ -390,7 +386,6 @@ class OsdVector : public Osd
 
 
     void incStyleRef(VectorHandle index);
-    int getStyleRef(VectorHandle index);
     virtual void destroyStyleRef(VectorHandle index) = 0;
 
 
@@ -403,17 +398,17 @@ class OsdVector : public Osd
 
     virtual VectorHandle createStyleRef(const DrawStyle& c) = 0;
 
-    void dereferenceSVGCommand(std::vector<SVGCommand>& commands );
-    void referenceSVGCommand(std::vector<SVGCommand>& commands );
+    void decrementAllRefCounts(std::vector<SVGCommand>& commands );
+    void incrementAllRefCounts(std::vector<SVGCommand>& commands );
     void cleanupOrphanedRefs();
 
 
 
-    virtual void drawSetTrans(SurfaceCommands& sc) = 0;
+    virtual void drawSetTrans(SurfaceInfo& sc) = 0;
     virtual void executeDrawCommand(SVGCommand& command) = 0;
 
 
-    std::list<SurfaceCommands> scommands;
+    std::list<SurfaceInfo> surfaces;
 
     std::mutex surfaces_mutex;
 
index 2b6977831e2e15dceb96083a61dad8e84d0154f7..e4cc117a6fcf5968fdf6dbee074baa8a6ffd5dbb 100644 (file)
@@ -48,12 +48,6 @@ OsdWinPixel::~OsdWinPixel()
   }
 }
 
-int OsdWinPixel::getFD()
-{
-  if (!initted) return 0;
-  return fdOsd;
-}
-
 Surface * OsdWinPixel::createNewSurface(){
        return (Surface*)new SurfaceWin();
 }
index 8ad2cc659bf35da7ffd17eac18d66993fa809edc..caf332196dc73f6f723d20950cedd3aeddc272ba 100644 (file)
@@ -41,8 +41,6 @@ class OsdWinPixel : public Osd, public WindowsOsd
 
        bool isInitialized() { return initted; }
 
-    int getFD();
-
     void screenShot(const char* fileName);
 
     Surface * createNewSurface();
index 9839817f9462846e180db10c1d2cd29a30dcec1f..64bcd397825579175e39924b05988a553b325a1c 100644 (file)
@@ -810,7 +810,7 @@ void OsdWinVector::setFont(const char * fontname) {
 
 
 
-void OsdWinVector::drawSetTrans(SurfaceCommands & sc)
+void OsdWinVector::drawSetTrans(SurfaceInfo & sc)
 {
        D2D1::Matrix3x2F trans = D2D1::Matrix3x2F::Identity();
 
index 923882a8eccc856a45bfcf3ec80af2c532e8f2b1..e56622dd93ef87b65946d1ac2c081148de9f776d 100644 (file)
@@ -106,7 +106,7 @@ protected:
 
 
        void executeDrawCommand(SVGCommand & command);
-       void drawSetTrans(SurfaceCommands & sc);
+       void drawSetTrans(SurfaceInfo & sc);
 
        typedef struct {
                LPDIRECT3DTEXTURE9 surf9;