]> git.vomp.tv Git - vompclient.git/commitdiff
Some more renaming
authorChris Tallon <chris@vomp.tv>
Fri, 15 May 2020 20:19:45 +0000 (21:19 +0100)
committerChris Tallon <chris@vomp.tv>
Fri, 15 May 2020 20:19:45 +0000 (21:19 +0100)
SVGCommand::reference to handle
SVGCommand::getRef to getHandle

osdopenvg.cc
osdvector.cc
osdvector.h
osdwinvector.cc
surfacevector.cc

index faa4c436e4a53e2e8063729af3db2559caf4d56f..757704b393d64e2eb41c84e596629deb5cf986e0 100644 (file)
@@ -1085,13 +1085,13 @@ void OsdOpenVG::executeDrawCommand(SVGCommand& command)
     {
       vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
       //       VGuint rgba;
-      //       rgba = vgGetColor((VGPaint) command.reference);
-      //Log::getInstance()->log("OSD", Log::DEBUG, "Draw Path %d %x %g %g %g %g",command.reference,command.target.path_index,command.x,command.y,command.w,command.h);
+      //       rgba = vgGetColor((VGPaint) command.handle);
+      //Log::getInstance()->log("OSD", Log::DEBUG, "Draw Path %d %x %g %g %g %g",command.handle,command.target.path_index,command.x,command.y,command.w,command.h);
       //vgSeti(VG_FILL_RULE,);
 
       vgGetMatrix(save_matrix);
-      vgSetPaint((VGPaint) command.reference, VG_FILL_PATH);
-      vgSetPaint((VGPaint) command.reference, VG_STROKE_PATH);
+      vgSetPaint((VGPaint) command.handle, VG_FILL_PATH);
+      vgSetPaint((VGPaint) command.handle, VG_STROKE_PATH);
       vgTranslate(command.x, command.y);
       vgScale(command.w, command.h);
       vgDrawPath(std_paths[command.target.path_index], VG_FILL_PATH);
@@ -1108,11 +1108,11 @@ void OsdOpenVG::executeDrawCommand(SVGCommand& command)
 
       //vgScale(command.w,command.h);
 
-      if (command.reference)   //special behaviout for bw images they act as a mask on the current paint
+      if (command.handle)   //special behaviout for bw images they act as a mask on the current paint
       {
         vgTranslate(command.x, command.y);
-        vgSetPaint((VGPaint) command.reference, VG_FILL_PATH);
-        vgSetPaint((VGPaint) command.reference, VG_STROKE_PATH);
+        vgSetPaint((VGPaint) command.handle, VG_FILL_PATH);
+        vgSetPaint((VGPaint) command.handle, VG_STROKE_PATH);
         vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_STENCIL);
         vgSeti(VG_BLEND_MODE, VG_BLEND_SRC_OVER);
         vgScale(aspect_correction, 1.f);
@@ -1196,9 +1196,9 @@ void OsdOpenVG::executeDrawCommand(SVGCommand& command)
 
       vgDrawImage((VGImage) command.target.image);
 
-      //Log::getInstance()->log("OSD", Log::DEBUG, "Draw Image %d %x %g %g %g %g %x",command.reference,command.target.image,command.x,command.y,command.w,command.h,
+      //Log::getInstance()->log("OSD", Log::DEBUG, "Draw Image %d %x %g %g %g %g %x",command.handle,command.target.image,command.x,command.y,command.w,command.h,
       //               vgGetError());
-      if (command.reference)
+      if (command.handle)
       {
         vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_NORMAL);
         vgSeti(VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER);
@@ -1215,8 +1215,8 @@ void OsdOpenVG::executeDrawCommand(SVGCommand& command)
     {
       vgSeti(VG_MATRIX_MODE, VG_MATRIX_GLYPH_USER_TO_SURFACE);
       vgGetMatrix(save_matrix);
-      vgSetPaint((VGPaint) command.reference, VG_FILL_PATH);
-      vgSetPaint((VGPaint) command.reference, VG_STROKE_PATH);
+      vgSetPaint((VGPaint) command.handle, VG_FILL_PATH);
+      vgSetPaint((VGPaint) command.handle, VG_STROKE_PATH);
       vgTranslate(command.x, command.y);
       vgSeti(VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER);
       vgGetMatrix(save_matrix2);
@@ -1230,7 +1230,7 @@ void OsdOpenVG::executeDrawCommand(SVGCommand& command)
 
       vgDrawGlyph(vgfont, glyph_index, VG_FILL_PATH, VG_FALSE);
       //vgDrawPath(std_paths[Rectangle],VG_FILL_PATH);
-      /*       Log::getInstance()->log("OSD", Log::DEBUG, "Draw Glyph %d %c %d %g %g %x",command.reference,command.target.textchar,glyph_index,command.x,command.y,
+      /*       Log::getInstance()->log("OSD", Log::DEBUG, "Draw Glyph %d %c %d %g %g %x",command.handle,command.target.textchar,glyph_index,command.x,command.y,
                                        vgGetError());*/
       vgSeti(VG_MATRIX_MODE, VG_MATRIX_GLYPH_USER_TO_SURFACE);
       vgLoadMatrix(save_matrix);
index 2994fa82f73e6d0894c36ee28485d0485b69ea43..237f056d127199e170740539fce7d4470619e0eb 100644 (file)
@@ -344,7 +344,7 @@ void OsdVector::decrementAllRefCounts(std::vector<SVGCommand>& commands)
 {
   for (SVGCommand& command : commands)
   {
-    decrementDrawStyleHandleRefCount(command.getRef()); // FIXME BUG BUG BUG
+    decrementDrawStyleHandleRefCount(command.getHandle()); // FIXME BUG BUG BUG
 
     ImageIndex ii = command.getImageIndex();
     if (ii) removeImageRef(ii);
@@ -358,7 +358,7 @@ void OsdVector::incrementAllRefCounts(std::vector<SVGCommand>& commands)
 {
   for (SVGCommand& command : commands)
   {
-    incrementDrawStyleHandleRefCount(command.getRef()); // FIXME BUG BUG BUG
+    incrementDrawStyleHandleRefCount(command.getHandle()); // FIXME BUG BUG BUG
 
     ImageIndex ii = command.getImageIndex();
     if (ii) incImageRef(ii);
index ef0ae1e1367fa0213b92d55af838c30129cbe3d5..1797c257046c585a619eb044de4f575a8b8321a5 100644 (file)
@@ -81,11 +81,11 @@ class SVGCommand
       nc.w = iw;
       nc.h = ih;
       nc.target.path_index = path;
-      nc.reference = ref;
+      nc.handle = ref; // always a valid DrawStyle handle
       return nc;
     };
 
-    inline static SVGCommand PaintImageLoading(LoadIndex load_in, float ix, float iy, float iw, float ih, VectorHandle ref, Corner corner = TopLeft)
+    inline static SVGCommand PaintImageLoading(LoadIndex load_in, float ix, float iy, float iw, float ih, Corner corner = TopLeft)
     {
       SVGCommand nc;
       nc.instr = DrawImageLoading;
@@ -94,7 +94,7 @@ class SVGCommand
       nc.w = iw;
       nc.h = ih;
       nc.target.loadindex = load_in;
-      nc.reference = ref;
+      nc.handle = 0; // not valid for PaintImageLoading
       nc.corner = corner;
       return nc;
     };
@@ -108,7 +108,7 @@ class SVGCommand
       nc.w = iw;
       nc.h = ih;
       nc.target.image = image_in;
-      nc.reference = ref;
+      nc.handle = ref; // can be 0 (no handle) or can be an Drawstyle nandle
       nc.corner = corner;
       return nc;
     };
@@ -121,7 +121,7 @@ class SVGCommand
       nc.y = iy;
       nc.w = iw;
       nc.h = ih;
-      nc.reference = 0;
+      nc.handle = 0; // not valid for PaintTTchar
       nc.target.ttchar = ttchar_in;
       nc.corner = TopLeft;
       return nc;
@@ -135,7 +135,7 @@ class SVGCommand
       nc.y = iy;
       nc.w = iw;
       nc.h = ih;
-      nc.reference = 0;
+      nc.handle = 0; // not valid for PaintClipping
       nc.target.ttchar = 0;
       return nc;
     };
@@ -147,7 +147,7 @@ class SVGCommand
       nc.y = iy;
       nc.w = 0;
       nc.h = 0;
-      nc.reference = ref;
+      nc.handle = ref; // always a valid DrawStyle handle
       nc.target.textchar = char_in;
     };
 
@@ -166,9 +166,9 @@ class SVGCommand
       return ((x + w) < tx) || ((y + h) < ty) || ((tx + tw) < x) || ((ty + th) < y);
     }
 
-    VectorHandle getRef()
+    VectorHandle getHandle()
     {
-      return reference;
+      return handle;
     };
 
     ImageIndex getImageIndex()
@@ -186,7 +186,7 @@ class SVGCommand
     SVGCommandInstr instr{DrawNoop};
     Corner corner;
     float x{}, y{}, w{}, h{};
-    VectorHandle reference{VECTOR_HANDLE_INIT};
+    VectorHandle handle{VECTOR_HANDLE_INIT};
     union
     {
       PathIndex path_index;
index 9a0292b950863d6e237cdde807b5bbaba2895ad5..612d4d768d067b9fc76b35f718c0ac5ae94ebece 100644 (file)
@@ -838,7 +838,7 @@ void OsdWinVector::executeDrawCommand(SVGCommand & command)
                        D2D1::Matrix3x2F::Scale(command.w, command.h)*D2D1::Matrix3x2F::Translation(command.x, command.y)*save_matrix;
                currentosd_backbuffer.rendtarget2D->SetTransform(matrix);
                currentosd_backbuffer.rendtarget2D->FillGeometry(std_paths[command.target.path_index], 
-                       (ID2D1Brush*)command.reference);
+                       (ID2D1Brush*)command.handle);
 
                currentosd_backbuffer.rendtarget2D->SetTransform(save_matrix);
 
@@ -852,7 +852,7 @@ void OsdWinVector::executeDrawCommand(SVGCommand & command)
                                                D2D1::Matrix3x2F matrix;
                                                
 
-                                               if (command.reference) { //special behaviour for bw images they act as a mask on the current paint
+                                               if (command.handle) { //special behaviour for bw images they act as a mask on the current paint
                                                        matrix =
                                                                D2D1::Matrix3x2F::Scale(1.f*aspect_correction, 1.f)
                                                                *D2D1::Matrix3x2F::Translation(command.x, command.y)*save_matrix;
@@ -914,8 +914,8 @@ void OsdWinVector::executeDrawCommand(SVGCommand & command)
 
                                                currentosd_backbuffer.rendtarget2D->SetTransform(matrix);
 
-                                               if (command.reference) {
-                                                       currentosd_backbuffer.rendtarget2D->FillOpacityMask(bitmap, (ID2D1Brush*)command.reference, D2D1_OPACITY_MASK_CONTENT_GRAPHICS);
+                                               if (command.handle) {
+                                                       currentosd_backbuffer.rendtarget2D->FillOpacityMask(bitmap, (ID2D1Brush*)command.handle, D2D1_OPACITY_MASK_CONTENT_GRAPHICS);
                                                        
                                                }
                                                else 
@@ -956,7 +956,7 @@ void OsdWinVector::executeDrawCommand(SVGCommand & command)
                                                D2D1_POINT_2F pos = { 0.f, 0.f };
 
                                                currentosd_backbuffer.rendtarget2D->DrawGlyphRun(pos, &glyph_run,
-                                                       (ID2D1Brush*)command.reference);                
+                                                       (ID2D1Brush*)command.handle);
                                                currentosd_backbuffer.rendtarget2D->SetTransform(save_matrix);
 
        } break;
index fa7b61f16fd26061d725ea28ca4f21c4dacebc9c..1dc153e4d3d17d351860c0189e1165ec50b289c0 100644 (file)
@@ -36,7 +36,7 @@ SurfaceVector::~SurfaceVector()
 
   for (SVGCommand& command : commands)
   {
-    osd->decrementDrawStyleHandleRefCount(command.getRef()); // We remove the Style reference, so that osd can free stuff // FIXME BUG BUG BUG
+    osd->decrementDrawStyleHandleRefCount(command.getHandle()); // We remove the Style reference, so that osd can free stuff // FIXME BUG BUG BUG
 
     ImageIndex ii = command.getImageIndex();
     if (ii) osd->removeImageRef(ii);
@@ -258,7 +258,7 @@ void SurfaceVector::drawTVMedia(TVMediaInfo& tvmedia, float x, float y, float  w
   else
   {
 
-    commands.push_back(SVGCommand::PaintImageLoading(load_index, x, y, width, height, 0, corner));
+    commands.push_back(SVGCommand::PaintImageLoading(load_index, x, y, width, height, corner));
     //Log::getInstance()->log("SurfaceVector", Log::DEBUG, "TVMedia Add instru image loading %d %d", load_index,image);
   }
 
@@ -356,7 +356,7 @@ void SurfaceVector::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int hei
   ImageIndex image = osd->getMonoBitmapRef(base, width, height);
   VectorHandle ref = osd->getDrawStyleHandle(nextColour);
   removeCommands(dx, dy, width, height);
-  commands.push_back(SVGCommand::PaintImage(dx, dy, height, width, image, ref));
+  commands.push_back(SVGCommand::PaintImage(dx, dy, height, width, image, ref)); // FIXME BUG height and width wrong way around?
   command_mutex.unlock();
 }
 
@@ -380,8 +380,8 @@ int SurfaceVector::removeCommands(float x, float y, float width, float height)
         && (*itty).instr != DrawClipping)
     {
       //Log::getInstance()->log("OSD", Log::DEBUG, "Remove command %d %g %g %g %g %d %d",(*itty).instr,
-      //(*itty).x,(*itty).y,(*itty).w,(*itty).h,(*itty).reference,(*itty).target.image);
-      osd->decrementDrawStyleHandleRefCount((*itty).getRef()); // We remove the Style reference, so that osd can free stuff // FIXME BUG BUG BUG
+      //(*itty).x,(*itty).y,(*itty).w,(*itty).h,(*itty).handle,(*itty).target.image);
+      osd->decrementDrawStyleHandleRefCount((*itty).getHandle()); // We remove the Style reference, so that osd can free stuff // FIXME BUG BUG BUG
       ImageIndex ii = (*itty).getImageIndex();
 
       if (ii) osd->removeImageRef(ii);