35 constexpr size_t width = 100;
36 constexpr size_t height = 100;
37 size_t row_bytes =
width * 4;
38 g_autofree
unsigned char* layer_data =
39 static_cast<unsigned char*
>(malloc(
height * row_bytes));
43 .allocation = layer_data, .row_bytes = row_bytes, .height =
height}};
45 .backing_store = &backing_store,
53 size_t frame_width, frame_height;
56 EXPECT_EQ(frame_width,
width);
57 EXPECT_EQ(frame_height,
height);
60 int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32,
width);
61 g_autofree
unsigned char* image_data =
62 static_cast<unsigned char*
>(malloc(
height * stride));
63 cairo_surface_t*
surface = cairo_image_surface_create_for_data(
64 image_data, CAIRO_FORMAT_ARGB32,
width,
height, stride);
65 cairo_t* cr = cairo_create(
surface);
73 constexpr size_t width1 = 90;
74 constexpr size_t height1 = 90;
75 size_t row_bytes = width1 * 4;
76 g_autofree
unsigned char* layer1_data =
77 static_cast<unsigned char*
>(malloc(height1 * row_bytes));
80 .software = {.allocation = layer1_data,
81 .row_bytes = row_bytes,
84 .backing_store = &backing_store1,
86 .size = {width1, height1}};
93 constexpr size_t width2 = 100;
94 constexpr size_t height2 = 100;
95 row_bytes = width2 * 4;
96 g_autofree
unsigned char* layer2_data =
97 static_cast<unsigned char*
>(malloc(height2 * row_bytes));
100 .software = {.allocation = layer2_data,
101 .row_bytes = row_bytes,
104 .backing_store = &backing_store2,
106 .size = {width2, height2}};
115 int stride2 = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width2);
116 g_autofree
unsigned char* image_data =
117 static_cast<unsigned char*
>(malloc(height2 * stride2));
118 cairo_surface_t*
surface = cairo_image_surface_create_for_data(
119 image_data, CAIRO_FORMAT_ARGB32, width2, height2, stride2);
120 cairo_t* cr = cairo_create(
surface);
122 cairo_surface_destroy(
surface);