19 {
20 TRACE_EVENT0(
"impeller",
"SurfaceGLES::WrapOnScreenFBO");
21
22 if (context == nullptr || !context->IsValid() || !swap_callback) {
23 return nullptr;
24 }
25
27
28 TextureDescriptor color0_tex;
30 color0_tex.format = color_format;
31 color0_tex.size = fbo_size;
35
36 ColorAttachment color0;
37 color0.texture = std::make_shared<TextureGLES>(
42
43 TextureDescriptor depth_stencil_texture_desc;
45 depth_stencil_texture_desc.format = color_format;
46 depth_stencil_texture_desc.size = fbo_size;
49
50 auto depth_stencil_tex = std::make_shared<TextureGLES>(
51 gl_context.GetReactor(), depth_stencil_texture_desc,
53
54 DepthAttachment depth0;
55 depth0.clear_depth = 0;
56 depth0.texture = depth_stencil_tex;
59
60 StencilAttachment stencil0;
61 stencil0.clear_stencil = 0;
62 stencil0.texture = depth_stencil_tex;
65
67
68 render_target_desc.SetColorAttachment(color0, 0u);
69 render_target_desc.SetDepthAttachment(depth0);
70 render_target_desc.SetStencilAttachment(stencil0);
71
72#ifdef IMPELLER_DEBUG
73 gl_context.GetGPUTracer()->RecordRasterThread();
74#endif
75
76 return std::unique_ptr<SurfaceGLES>(
77 new SurfaceGLES(std::move(swap_callback), render_target_desc));
78}
static ContextGLES & Cast(Context &base)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
static constexpr Color DarkSlateGray()
#define TRACE_EVENT0(category_group, name)