1 #ifndef _RIVE_NOOP_RENDERER_HPP_
2 #define _RIVE_NOOP_RENDERER_HPP_
3 #include "renderer.hpp"
8 class NoOpRenderPaint : public RenderPaint
11 void color(unsigned int value) override {}
12 void style(RenderPaintStyle value) override {}
13 void thickness(float value) override {}
14 void join(StrokeJoin value) override {}
15 void cap(StrokeCap value) override {}
16 void blendMode(BlendMode value) override {}
18 void linearGradient(float sx, float sy, float ex, float ey) override {}
19 void radialGradient(float sx, float sy, float ex, float ey) override {}
20 void addStop(unsigned int color, float stop) override {}
21 void completeGradient() override {}
24 enum class NoOpPathCommandType
33 struct NoOpPathCommand
35 NoOpPathCommandType command;
44 class NoOpRenderPath : public RenderPath
47 std::vector<NoOpPathCommand> commands;
50 commands.emplace_back((NoOpPathCommand){NoOpPathCommandType::Reset,
59 void fillRule(FillRule value) override {}
60 void addPath(CommandPath* path, const Mat2D& transform) override {}
61 void addRenderPath(RenderPath* path, const Mat2D& transform) override {}
63 void moveTo(float x, float y) override
65 commands.emplace_back((NoOpPathCommand){
66 NoOpPathCommandType::MoveTo, x, y, 0.0f, 0.0f, 0.0f, 0.0f});
68 void lineTo(float x, float y) override
70 commands.emplace_back((NoOpPathCommand){
71 NoOpPathCommandType::LineTo, x, y, 0.0f, 0.0f, 0.0f, 0.0f});
74 float ox, float oy, float ix, float iy, float x, float y) override
76 commands.emplace_back((NoOpPathCommand){
77 NoOpPathCommandType::CubicTo, x, y, ix, iy, ox, oy});
81 commands.emplace_back((NoOpPathCommand){NoOpPathCommandType::Close,
91 class NoOpRenderer : public Renderer
95 void transform(const Mat2D& transform) {}
96 void translate(float x, float y) {}
97 void drawPath(RenderPath* path, RenderPaint* paint) {}
98 void clipPath(RenderPath* path) {}