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;
43 TextureDescriptor depth_stencil_texture_desc;
45 depth_stencil_texture_desc.format = color_format;
46 depth_stencil_texture_desc.size = fbo_size;
50 auto depth_stencil_tex =
52 depth_stencil_texture_desc
55 DepthAttachment depth0;
56 depth0.clear_depth = 0;
57 depth0.texture = depth_stencil_tex;
61 StencilAttachment stencil0;
62 stencil0.clear_stencil = 0;
63 stencil0.texture = depth_stencil_tex;
67 RenderTarget render_target_desc;
69 render_target_desc.SetColorAttachment(color0, 0u);
70 render_target_desc.SetDepthAttachment(depth0);
71 render_target_desc.SetStencilAttachment(stencil0);
74 gl_context.GetGPUTracer()->RecordRasterThread();
78 return std::unique_ptr<SurfaceGLES>(
79 new SurfaceGLES(std::move(swap_callback), render_target_desc));
static ContextGLES & Cast(Context &base)
static std::shared_ptr< TextureGLES > WrapFBO(std::shared_ptr< ReactorGLES > reactor, TextureDescriptor desc, GLuint fbo)
Create a texture by wrapping an external framebuffer object whose lifecycle is owned by the caller.
static std::shared_ptr< TextureGLES > CreatePlaceholder(std::shared_ptr< ReactorGLES > reactor, TextureDescriptor desc)
Create a "texture" that is never expected to be bound/unbound explicitly or initialized in any way....
static constexpr Color DarkSlateGray()