Skip to content

Instantly share code, notes, and snippets.

@dnfield
Last active March 15, 2023 23:30
Show Gist options
  • Save dnfield/a309ab473c4fa827187f5f1cc8a58043 to your computer and use it in GitHub Desktop.
Save dnfield/a309ab473c4fa827187f5f1cc8a58043 to your computer and use it in GitHub Desktop.
Test to image instead of playground
TEST_P(AiksTest, CanRenderStrokes) {
Canvas canvas;
Paint paint;
paint.color = Color::Red();
paint.stroke_width = 20.0;
paint.style = Paint::Style::kStroke;
canvas.DrawPath(PathBuilder{}.AddLine({200, 100}, {800, 100}).TakePath(),
paint);
Picture picture = canvas.EndRecordingAsPicture();
std::shared_ptr<Image> image = picture.ToImage(GetContext(), {1000, 1000});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment