234 {
235 std::unique_ptr<NiceMock<MockGLESImpl>> mock_gl_impl =
236 std::make_unique<NiceMock<MockGLESImpl>>();
237 testing::NiceMock<MockGLESImpl>& mock_gl_impl_ref = *mock_gl_impl;
238 std::shared_ptr<MockGLES> mock_gl =
MockGLES::Init(std::move(mock_gl_impl));
239
240 std::shared_ptr<ContextGLES> context = CreateFakeGLESContext();
241 std::shared_ptr<MockWorker> dummy_worker = std::make_shared<MockWorker>();
242 context->AddReactorWorker(dummy_worker);
243 std::shared_ptr<ReactorGLES> reactor = context->GetReactor();
244
245 TextureDescriptor tex_desc;
246 tex_desc.size = {100, 100};
248 auto texture = std::make_shared<TextureGLES>(reactor, tex_desc,
false);
249
251 ColorAttachment color0;
255 target.SetColorAttachment(color0, 0);
256
257 std::shared_ptr<CommandBuffer> command_buffer =
258 std::static_pointer_cast<Context>(context)->CreateCommandBuffer();
259 std::shared_ptr<RenderPass> render_pass =
260 command_buffer->CreateRenderPass(
target);
261
262 EXPECT_CALL(mock_gl_impl_ref, CheckFramebufferStatus(_))
263 .WillRepeatedly(Return(GL_FRAMEBUFFER_COMPLETE));
264
265 PipelineDescriptor desc;
266 ColorAttachmentDescriptor color0_desc;
268 desc.SetColorAttachmentDescriptor(0, color0_desc);
269
271 std::shared_ptr<PipelineGLES> pipeline =
272 std::shared_ptr<PipelineGLES>(new PipelineGLES(
273 reactor, std::weak_ptr<PipelineLibrary>(), desc,
274 std::make_shared<UniqueHandleGLES>(reactor, pipeline_handle)));
275 pipeline->buffer_bindings_ = std::make_unique<BufferBindingsGLES>();
276
277 return {std::move(mock_gl), mock_gl_impl_ref,
278 std::move(context), std::move(dummy_worker),
279 std::move(reactor), std::move(command_buffer),
280 std::move(render_pass), std::move(pipeline)};
281 }
static std::shared_ptr< MockGLES > Init(std::unique_ptr< MockGLESImpl > impl, const std::optional< std::vector< const char * > > &extensions=std::nullopt, const char *version_string="OpenGL ES 3.0")