45 constexpr size_t width = 100;
46 constexpr size_t height = 100;
51 .open_gl = {.framebuffer = {.user_data = framebuffer}}};
53 .backing_store = &backing_store,
61 size_t frame_width, frame_height;
63 EXPECT_EQ(frame_width,
width);
64 EXPECT_EQ(frame_height,
height);
67 int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32,
width);
68 g_autofree
unsigned char* image_data =
69 static_cast<unsigned char*
>(malloc(
height * stride));
70 cairo_surface_t*
surface = cairo_image_surface_create_for_data(
71 image_data, CAIRO_FORMAT_ARGB32,
width,
height, stride);
72 cairo_t* cr = cairo_create(
surface);
80 constexpr size_t width1 = 90;
81 constexpr size_t height1 = 90;
86 .open_gl = {.framebuffer = {.user_data = framebuffer1}}};
88 .backing_store = &backing_store1,
90 .size = {width1, height1}};
95 constexpr size_t width2 = 100;
96 constexpr size_t height2 = 100;
101 .open_gl = {.framebuffer = {.user_data = framebuffer2}}};
103 .backing_store = &backing_store2,
105 .size = {width2, height2}};
110 size_t frame_width, frame_height;
112 EXPECT_EQ(frame_width, width2);
113 EXPECT_EQ(frame_height, height2);
116 int stride2 = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width2);
117 g_autofree
unsigned char* image_data =
118 static_cast<unsigned char*
>(malloc(height2 * stride2));
119 cairo_surface_t*
surface = cairo_image_surface_create_for_data(
120 image_data, CAIRO_FORMAT_ARGB32, width2, height2, stride2);
121 cairo_t* cr = cairo_create(
surface);
123 cairo_surface_destroy(
surface);
128 constexpr size_t width = 100;
129 constexpr size_t height = 100;
132 ON_CALL(epoxy, glGetString(GL_VENDOR))
134 ::testing::Return(
reinterpret_cast<const GLubyte*
>(
"Intel")));
142 .open_gl = {.framebuffer = {.user_data = framebuffer}}};
144 .backing_store = &backing_store,
149 constexpr GLuint kFakeTextureName = 123;
150 glBindTexture(GL_TEXTURE_2D, kFakeTextureName);
152 glEnable(GL_SCISSOR_TEST);
158 int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32,
width);
159 g_autofree
unsigned char* image_data =
160 static_cast<unsigned char*
>(malloc(
height * stride));
161 cairo_surface_t*
surface = cairo_image_surface_create_for_data(
162 image_data, CAIRO_FORMAT_ARGB32,
width,
height, stride);
163 cairo_t* cr = cairo_create(
surface);
165 cairo_surface_destroy(
surface);
168 GLuint texture_2d_binding;
169 glGetIntegerv(GL_TEXTURE_BINDING_2D,
170 reinterpret_cast<GLint*
>(&texture_2d_binding));
171 EXPECT_EQ(texture_2d_binding, kFakeTextureName);
172 EXPECT_EQ(glIsEnabled(GL_BLEND), GL_FALSE);
173 EXPECT_EQ(glIsEnabled(GL_SCISSOR_TEST), GL_TRUE);
177 constexpr size_t width = 100;
178 constexpr size_t height = 100;
181 ON_CALL(epoxy, glGetString(GL_VENDOR))
183 ::testing::Return(
reinterpret_cast<const GLubyte*
>(
"Intel")));
187 EXPECT_CALL(epoxy, glBlitFramebuffer);
193 .open_gl = {.framebuffer = {.user_data = framebuffer}}};
195 .backing_store = &backing_store,
204 int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32,
width);
205 g_autofree
unsigned char* image_data =
206 static_cast<unsigned char*
>(malloc(
height * stride));
207 cairo_surface_t*
surface = cairo_image_surface_create_for_data(
208 image_data, CAIRO_FORMAT_ARGB32,
width,
height, stride);
209 cairo_t* cr = cairo_create(
surface);
211 cairo_surface_destroy(
surface);
216 constexpr size_t width = 100;
217 constexpr size_t height = 100;
220 ON_CALL(epoxy, glGetString(GL_VENDOR))
222 ::testing::Return(
reinterpret_cast<const GLubyte*
>(
"Intel")));
226 .WillRepeatedly(::testing::Return(
false));
228 ::testing::StrEq(
"GL_EXT_framebuffer_blit")))
229 .WillRepeatedly(::testing::Return(
true));
231 EXPECT_CALL(epoxy, glBlitFramebuffer);
237 .open_gl = {.framebuffer = {.user_data = framebuffer}}};
239 .backing_store = &backing_store,
248 int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32,
width);
249 g_autofree
unsigned char* image_data =
250 static_cast<unsigned char*
>(malloc(
height * stride));
251 cairo_surface_t*
surface = cairo_image_surface_create_for_data(
252 image_data, CAIRO_FORMAT_ARGB32,
width,
height, stride);
253 cairo_t* cr = cairo_create(
surface);
255 cairo_surface_destroy(
surface);
260 constexpr size_t width = 100;
261 constexpr size_t height = 100;
264 ON_CALL(epoxy, glGetString(GL_VENDOR))
266 ::testing::Return(
reinterpret_cast<const GLubyte*
>(
"Intel")));
274 .open_gl = {.framebuffer = {.user_data = framebuffer}}};
276 .backing_store = &backing_store,
285 int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32,
width);
286 g_autofree
unsigned char* image_data =
287 static_cast<unsigned char*
>(malloc(
height * stride));
288 cairo_surface_t*
surface = cairo_image_surface_create_for_data(
289 image_data, CAIRO_FORMAT_ARGB32,
width,
height, stride);
290 cairo_t* cr = cairo_create(
surface);
292 cairo_surface_destroy(
surface);
297 constexpr size_t width = 100;
298 constexpr size_t height = 100;
302 ON_CALL(epoxy, glGetString(GL_VENDOR))
304 ::testing::Return(
reinterpret_cast<const GLubyte*
>(
"NVIDIA")));
312 .open_gl = {.framebuffer = {.user_data = framebuffer}}};
314 .backing_store = &backing_store,
323 int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32,
width);
324 g_autofree
unsigned char* image_data =
325 static_cast<unsigned char*
>(malloc(
height * stride));
326 cairo_surface_t*
surface = cairo_image_surface_create_for_data(
327 image_data, CAIRO_FORMAT_ARGB32,
width,
height, stride);
328 cairo_t* cr = cairo_create(
surface);
330 cairo_surface_destroy(
surface);
336 constexpr size_t width = 100;
337 constexpr size_t height = 100;
342 .open_gl = {.framebuffer = {.user_data = framebuffer}}};
344 .backing_store = &backing_store,
355 .WillRepeatedly(::testing::Return(200));
357 .WillRepeatedly(::testing::Return(200));
362 int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, 200);
363 g_autofree
unsigned char* image_data =
364 static_cast<unsigned char*
>(g_malloc(200 * stride));
365 cairo_surface_t*
surface = cairo_image_surface_create_for_data(
366 image_data, CAIRO_FORMAT_ARGB32, 200, 200, stride);
367 cairo_t* cr = cairo_create(
surface);
372 cairo_surface_destroy(
surface);