22 constexpr size_t width = 100;
23 constexpr size_t height = 100;
24 size_t row_bytes =
width * 4;
25 g_autofree
unsigned char* layer_data =
26 static_cast<unsigned char*
>(malloc(
height * row_bytes));
30 .allocation = layer_data, .row_bytes = row_bytes, .height =
height}};
32 .backing_store = &backing_store,
38 size_t frame_width, frame_height;
41 EXPECT_EQ(frame_width,
width);
42 EXPECT_EQ(frame_height,
height);
45 int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32,
width);
46 g_autofree
unsigned char* image_data =
47 static_cast<unsigned char*
>(malloc(
height * stride));
48 cairo_surface_t*
surface = cairo_image_surface_create_for_data(
49 image_data, CAIRO_FORMAT_ARGB32,
width,
height, stride);
50 cairo_t* cr = cairo_create(
surface);
58 constexpr size_t width1 = 90;
59 constexpr size_t height1 = 90;
60 size_t row_bytes = width1 * 4;
61 g_autofree
unsigned char* layer1_data =
62 static_cast<unsigned char*
>(malloc(height1 * row_bytes));
65 .software = {.allocation = layer1_data,
66 .row_bytes = row_bytes,
69 .backing_store = &backing_store1,
71 .size = {width1, height1}};
76 constexpr size_t width2 = 100;
77 constexpr size_t height2 = 100;
78 row_bytes = width2 * 4;
79 g_autofree
unsigned char* layer2_data =
80 static_cast<unsigned char*
>(malloc(height2 * row_bytes));
83 .software = {.allocation = layer2_data,
84 .row_bytes = row_bytes,
87 .backing_store = &backing_store2,
89 .size = {width2, height2}};
94 size_t frame_width, frame_height;
97 EXPECT_EQ(frame_width, width2);
98 EXPECT_EQ(frame_height, height2);
101 int stride2 = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width2);
102 g_autofree
unsigned char* image_data =
103 static_cast<unsigned char*
>(malloc(height2 * stride2));
104 cairo_surface_t*
surface = cairo_image_surface_create_for_data(
105 image_data, CAIRO_FORMAT_ARGB32, width2, height2, stride2);
106 cairo_t* cr = cairo_create(
surface);
108 cairo_surface_destroy(
surface);