Test

This page contains an HTML5 2D canvas port of the automated test suite for the canvas_ity library. See test.cpp for the original C++ version.

Examine the images below to see how your browser's canvas implementation renders each test and see how they relate to the results produced by the library (run the library's test harness with --pngs to get the images). Compare the code for the JavaScript and C++ tests line-by-line to see how the HTML5 API maps to the library's API and vice-versa.

scale_uniform

scale_non_uniform

rotate

translate

transform

transform_fill

transform_stroke

set_transform

global_alpha

global_composite_operation

shadow_color

shadow_offset

shadow_offset_offscreen

shadow_blur

shadow_blur_offscreen

shadow_blur_composite

line_width

line_width_angular

line_cap

line_cap_offscreen

line_join

line_join_offscreen

miter_limit

line_dash_offset

line_dash

line_dash_closed

line_dash_overlap

line_dash_offscreen

color

linear_gradient

radial_gradient

color_stop

pattern

begin_path

move_to

close_path

line_to

quadratic_curve_to

bezier_curve_to

arc_to

arc

rectangle

fill

fill_rounding

fill_converging

fill_zone_plate

stroke

stroke_wide

stroke_inner_join

stroke_spiral

stroke_long

clip

clip_winding

is_point_in_path

is_point_in_path_offscreen

clear_rectangle

fill_rectangle

stroke_rectangle

text_align

text_baseline

font

fill_text

stroke_text

measure_text

draw_image

draw_image_matted

get_image_data

put_image_data

save_restore

example_button

example_smiley

example_knot

example_icon

example_illusion

example_star

example_neon