20 TRACE_EVENT0(
"impeller",
"SurfaceGLES::WrapOnScreenFBO");
22 if (context ==
nullptr || !context->IsValid() || !swap_callback) {
28 TextureDescriptor color0_tex;
30 color0_tex.format = color_format;
31 color0_tex.size = fbo_size;
36 ColorAttachment color0;
37 color0.texture = std::make_shared<TextureGLES>(
43 TextureDescriptor stencil0_tex;
45 stencil0_tex.format = color_format;
46 stencil0_tex.size = fbo_size;
51 StencilAttachment stencil0;
52 stencil0.clear_stencil = 0;
53 stencil0.texture = std::make_shared<TextureGLES>(
58 RenderTarget render_target_desc;
60 render_target_desc.SetColorAttachment(color0, 0u);
61 render_target_desc.SetStencilAttachment(stencil0);
64 gl_context.GetGPUTracer()->RecordRasterThread();
65 #endif // IMPELLER_DEBUG
67 return std::unique_ptr<SurfaceGLES>(
68 new SurfaceGLES(std::move(swap_callback), render_target_desc));