| 136 | } |
| 137 | |
| 138 | void CanvasWidget::renderImpl() { |
| 139 | auto renderingOffset = Vec2F(screenPosition()); |
| 140 | |
| 141 | for (auto const& op : m_renderOps) { |
| 142 | if (auto args = op.ptr<ImageOp>()) |
| 143 | tupleUnpackFunction(bind(&CanvasWidget::renderImage, this, renderingOffset, _1, _2, _3, _4, _5), *args); |
| 144 | if (auto args = op.ptr<ImageRectOp>()) |
| 145 | tupleUnpackFunction(bind(&CanvasWidget::renderImageRect, this, renderingOffset, _1, _2, _3, _4), *args); |
| 146 | if (auto args = op.ptr<DrawableOp>()) |
| 147 | tupleUnpackFunction(bind(&CanvasWidget::renderDrawable, this, renderingOffset, _1, _2), *args); |
| 148 | if (auto args = op.ptr<TiledImageOp>()) |
| 149 | tupleUnpackFunction(bind(&CanvasWidget::renderTiledImage, this, renderingOffset, _1, _2, _3, _4, _5), *args); |
| 150 | if (auto args = op.ptr<LineOp>()) |
| 151 | tupleUnpackFunction(bind(&CanvasWidget::renderLine, this, renderingOffset, _1, _2, _3, _4), *args); |
| 152 | if (auto args = op.ptr<RectOp>()) |
| 153 | tupleUnpackFunction(bind(&CanvasWidget::renderRect, this, renderingOffset, _1, _2), *args); |
| 154 | if (auto args = op.ptr<PolyOp>()) |
| 155 | tupleUnpackFunction(bind(&CanvasWidget::renderPoly, this, renderingOffset, _1, _2, _3), *args); |
| 156 | if (auto args = op.ptr<TrianglesOp>()) |
| 157 | tupleUnpackFunction(bind(&CanvasWidget::renderTriangles, this, renderingOffset, _1, _2), *args); |
| 158 | if (auto args = op.ptr<TextOp>()) |
| 159 | tupleUnpackFunction(bind(&CanvasWidget::renderText, this, renderingOffset, _1, _2, _3), *args); |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | void CanvasWidget::renderImage(Vec2F const& renderingOffset, String const& texName, Vec2F const& position, float scale, Vec4B const& color, bool centered) { |
| 164 | auto& context = GuiContext::singleton(); |
nothing calls this directly
no test coverage detected