47 return eglChooseConfig(eglGetDisplay(EGL_DEFAULT_DISPLAY), attributes, result,
64 EGLConfig window_egl_config, pbuffer_egl_config;
65 ASSERT_TRUE(GetEGLConfigForSurface(EGL_WINDOW_BIT, &window_egl_config));
66 ASSERT_TRUE(GetEGLConfigForSurface(EGL_PBUFFER_BIT, &pbuffer_egl_config));
68 auto display = std::make_unique<MockDisplay>();
69 EXPECT_CALL(*display, IsValid).WillRepeatedly(Return(
true));
71 std::make_unique<Config>(ConfigDescriptor(), window_egl_config);
73 std::make_unique<Config>(ConfigDescriptor(), pbuffer_egl_config);
76 ChooseConfig(Matcher<ConfigDescriptor>(AllOf(
78 Field(&ConfigDescriptor::surface_type,
80 .WillOnce(Return(ByMove(std::move(first_result))));
81 EXPECT_CALL(*display, ChooseConfig(Matcher<ConfigDescriptor>(
82 Field(&ConfigDescriptor::surface_type,
84 .WillOnce(Return(ByMove(std::move(second_result))));
85 ON_CALL(*display, ChooseConfig(_))
86 .WillByDefault(Return(ByMove(std::unique_ptr<Config>())));
88 std::make_unique<AndroidContextGLImpeller>(std::move(display),
true);
93 EGLConfig window_egl_config, pbuffer_egl_config;
94 ASSERT_TRUE(GetEGLConfigForSurface(EGL_WINDOW_BIT, &window_egl_config));
95 ASSERT_TRUE(GetEGLConfigForSurface(EGL_PBUFFER_BIT, &pbuffer_egl_config));
97 auto display = std::make_unique<MockDisplay>();
98 EXPECT_CALL(*display, IsValid).WillRepeatedly(Return(
true));
99 std::unique_ptr<Config> first_result;
100 std::unique_ptr<Config> second_result;
102 std::make_unique<Config>(ConfigDescriptor(), window_egl_config);
104 std::make_unique<Config>(ConfigDescriptor(), pbuffer_egl_config);
107 ChooseConfig(Matcher<ConfigDescriptor>(AllOf(
110 Field(&ConfigDescriptor::surface_type,
112 .WillOnce(Return(ByMove(std::move(first_result))));
115 ChooseConfig(Matcher<ConfigDescriptor>(AllOf(
118 Field(&ConfigDescriptor::surface_type,
120 .WillOnce(Return(ByMove(std::move(second_result))));
123 ChooseConfig(Matcher<ConfigDescriptor>(
125 Field(&ConfigDescriptor::surface_type,
127 .WillOnce(Return(ByMove(std::move(third_result))));
128 EXPECT_CALL(*display, ChooseConfig(Matcher<ConfigDescriptor>(
129 Field(&ConfigDescriptor::surface_type,
131 .WillOnce(Return(ByMove(std::move(fourth_result))));
132 ON_CALL(*display, ChooseConfig(_))
133 .WillByDefault(Return(ByMove(std::unique_ptr<Config>())));
135 std::make_unique<AndroidContextGLImpeller>(std::move(display),
true);
136 ASSERT_TRUE(context);