1616#include " impeller/renderer/render_target.h"
1717#include " impeller/tessellator/tessellator.h"
1818
19- // TODO(zanderso): https://github.com/flutter/flutter/issues/127701
20- // NOLINTBEGIN(bugprone-unchecked-optional-access)
21-
2219namespace impeller {
2320
2421void ContentContextOptions::ApplyToPipelineDescriptor (
@@ -33,13 +30,7 @@ void ContentContextOptions::ApplyToPipelineDescriptor(
3330 desc.SetSampleCount (sample_count);
3431
3532 ColorAttachmentDescriptor color0 = *desc.GetColorAttachmentDescriptor (0u );
36- if (!color_attachment_pixel_format.has_value ()) {
37- VALIDATION_LOG << " Color attachment pixel format must be set." ;
38- color0.format = PixelFormat::kB8G8R8A8UNormInt ;
39- } else {
40- color0.format = *color_attachment_pixel_format;
41- }
42- color0.format = *color_attachment_pixel_format;
33+ color0.format = color_attachment_pixel_format.value_or (PixelFormat::kUnknown );
4334 color0.alpha_blend_op = BlendOperation::kAdd ;
4435 color0.color_blend_op = BlendOperation::kAdd ;
4536
@@ -137,9 +128,9 @@ void ContentContextOptions::ApplyToPipelineDescriptor(
137128 desc.ClearStencilAttachments ();
138129 }
139130
140- if ( desc.GetFrontStencilAttachmentDescriptor (). has_value ()) {
141- StencilAttachmentDescriptor stencil =
142- desc. GetFrontStencilAttachmentDescriptor () .value ();
131+ auto maybe_stencil = desc.GetFrontStencilAttachmentDescriptor ();
132+ if (maybe_stencil. has_value ()) {
133+ StencilAttachmentDescriptor stencil = maybe_stencil .value ();
143134 stencil.stencil_compare = stencil_compare;
144135 stencil.depth_stencil_pass = stencil_operation;
145136 desc.SetStencilAttachmentDescriptors (stencil);
@@ -312,9 +303,9 @@ ContentContext::ContentContext(std::shared_ptr<Context> context)
312303 context_->GetPipelineLibrary ()->GetPipeline (uv_pipeline_desc).Get ();
313304 }
314305
315- if ( solid_fill_pipelines_[{}]->GetDescriptor (). has_value ()) {
316- auto clip_pipeline_descriptor =
317- solid_fill_pipelines_[{}]-> GetDescriptor () .value ();
306+ auto maybe_pipeline_desc = solid_fill_pipelines_[{}]->GetDescriptor ();
307+ if (maybe_pipeline_desc. has_value ()) {
308+ auto clip_pipeline_descriptor = maybe_pipeline_desc .value ();
318309 clip_pipeline_descriptor.SetLabel (" Clip Pipeline" );
319310 // Disable write to all color attachments.
320311 auto color_attachments =
@@ -412,5 +403,3 @@ void ContentContext::SetWireframe(bool wireframe) {
412403}
413404
414405} // namespace impeller
415-
416- // NOLINTEND(bugprone-unchecked-optional-access)
0 commit comments