{
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);
//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);
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);
{
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);
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);
{
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);
{
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);
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;
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;
};
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;
};
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;
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;
};
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;
};
return ((x + w) < tx) || ((y + h) < ty) || ((tx + tw) < x) || ((ty + th) < y);
}
- VectorHandle getRef()
+ VectorHandle getHandle()
{
- return reference;
+ return handle;
};
ImageIndex getImageIndex()
SVGCommandInstr instr{DrawNoop};
Corner corner;
float x{}, y{}, w{}, h{};
- VectorHandle reference{VECTOR_HANDLE_INIT};
+ VectorHandle handle{VECTOR_HANDLE_INIT};
union
{
PathIndex path_index;
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);
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;
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
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;
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);
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);
}
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();
}
&& (*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);