MCPcopy Create free account
hub / github.com/Logicalshift/flo_draw / decode_all_iter

Function decode_all_iter

canvas/src/decoding.rs:2113–2161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2111
2112 #[test]
2113 fn decode_all_iter() {
2114 check_round_trip(vec![
2115 Draw::Path(PathOp::NewPath),
2116 Draw::Path(PathOp::Move(10.0, 15.0)),
2117 Draw::Path(PathOp::Line(20.0, 42.0)),
2118 Draw::Path(PathOp::BezierCurve(((1.0, 2.0), (3.0, 4.0)), (5.0, 6.0))),
2119 Draw::Path(PathOp::ClosePath),
2120 Draw::Fill,
2121 Draw::Stroke,
2122 Draw::LineWidth(23.0),
2123 Draw::LineWidthPixels(43.0),
2124 Draw::LineJoin(LineJoin::Bevel),
2125 Draw::LineCap(LineCap::Round),
2126 Draw::WindingRule(WindingRule::NonZero),
2127 Draw::NewDashPattern,
2128 Draw::DashLength(56.0),
2129 Draw::DashOffset(13.0),
2130 Draw::StrokeColor(Color::Rgba(0.1, 0.2, 0.3, 0.4)),
2131 Draw::FillColor(Color::Rgba(0.2, 0.3, 0.4, 0.5)),
2132 Draw::FillTexture(TextureId(23), (42.0, 43.0), (44.0, 45.0)),
2133 Draw::FillGradient(GradientId(24), (42.0, 43.0), (44.0, 45.0)),
2134 Draw::FillTransform(Transform2D::identity()),
2135 Draw::BlendMode(BlendMode::Lighten),
2136 Draw::IdentityTransform,
2137 Draw::CanvasHeight(81.0),
2138 Draw::CenterRegion((6.0, 7.0), (8.0, 9.0)),
2139 Draw::MultiplyTransform(Transform2D([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]])),
2140 Draw::Unclip,
2141 Draw::Store,
2142 Draw::Restore,
2143 Draw::FreeStoredBuffer,
2144 Draw::PushState,
2145 Draw::PopState,
2146 Draw::ClearCanvas(Color::Rgba(0.1, 0.2, 0.3, 0.4)),
2147 Draw::Layer(LayerId(21)),
2148 Draw::ClearLayer,
2149 Draw::ClearAllLayers,
2150 Draw::SwapLayers(LayerId(1), LayerId(2)),
2151 Draw::Path(PathOp::NewPath),
2152 Draw::Sprite(SpriteId(1000)),
2153 Draw::ClearSprite,
2154 Draw::SpriteTransform(SpriteTransform::Translate(4.0, 5.0)),
2155 Draw::SpriteTransform(SpriteTransform::Transform2D(Transform2D::scale(3.0, 4.0))),
2156 Draw::DrawSprite(SpriteId(1300)),
2157
2158 Draw::Gradient(GradientId(42), GradientOp::Create(Color::Rgba(0.1, 0.2, 0.3, 0.4))),
2159 Draw::Gradient(GradientId(44), GradientOp::AddStop(0.5, Color::Rgba(0.1, 0.2, 0.3, 0.4))),
2160 ]);
2161 }
2162
2163 #[test]
2164 fn decode_all_stream() {

Callers

nothing calls this directly

Calls 1

check_round_tripFunction · 0.85

Tested by

no test coverage detected