From 2e9198c55a6ebf0ea3ee7f74da30fdaa9b3235f8 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Fri, 15 May 2020 21:19:45 +0100 Subject: [PATCH] Some more renaming SVGCommand::reference to handle SVGCommand::getRef to getHandle --- osdopenvg.cc | 24 ++++++++++++------------ osdvector.cc | 4 ++-- osdvector.h | 20 ++++++++++---------- osdwinvector.cc | 10 +++++----- surfacevector.cc | 10 +++++----- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/osdopenvg.cc b/osdopenvg.cc index faa4c43..757704b 100644 --- a/osdopenvg.cc +++ b/osdopenvg.cc @@ -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); diff --git a/osdvector.cc b/osdvector.cc index 2994fa8..237f056 100644 --- a/osdvector.cc +++ b/osdvector.cc @@ -344,7 +344,7 @@ void OsdVector::decrementAllRefCounts(std::vector& 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& 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); diff --git a/osdvector.h b/osdvector.h index ef0ae1e..1797c25 100644 --- a/osdvector.h +++ b/osdvector.h @@ -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; diff --git a/osdwinvector.cc b/osdwinvector.cc index 9a0292b..612d4d7 100644 --- a/osdwinvector.cc +++ b/osdwinvector.cc @@ -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; diff --git a/surfacevector.cc b/surfacevector.cc index fa7b61f..1dc153e 100644 --- a/surfacevector.cc +++ b/surfacevector.cc @@ -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); -- 2.39.2