Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Prev Previous commit
Merge branch 'main' into remove_rest_of_vertices
  • Loading branch information
Jonah Williams authored Apr 24, 2024
commit 14292a3136918122f37d50b45b10a2003a1280ee
43 changes: 0 additions & 43 deletions impeller/entity/contents/content_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -584,49 +584,6 @@ void ContentContext::ClearCachedRuntimeEffectPipeline(
void ContentContext::InitializeCommonlyUsedShadersIfNeeded() const {
TRACE_EVENT0("flutter", "InitializeCommonlyUsedShadersIfNeeded");
GetContext()->InitializeCommonlyUsedShadersIfNeeded();

if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) {
// TODO(jonahwilliams): The OpenGL Embedder Unittests hang if this code
// runs.
return;
}

// Initialize commonly used shaders that aren't defaults. These settings were
// chosen based on the knowledge that we mix and match triangle and
// triangle-strip geometry, and also have fairly agressive srcOver to src
// blend mode conversions.
auto options = ContentContextOptions{
.sample_count = SampleCount::kCount4,
.color_attachment_pixel_format =
context_->GetCapabilities()->GetDefaultColorFormat()};

// Note: When editing this, check the order the default pipelines are created.
// These should be first.
for (const auto mode : {BlendMode::kSource, BlendMode::kSourceOver}) {
for (const auto geometry :
{PrimitiveType::kTriangle, PrimitiveType::kTriangleStrip}) {
options.blend_mode = mode;
options.primitive_type = geometry;
CreateIfNeeded(solid_fill_pipelines_, options);
CreateIfNeeded(texture_pipelines_, options);
if (GetContext()->GetCapabilities()->SupportsSSBO()) {
CreateIfNeeded(linear_gradient_ssbo_fill_pipelines_, options);
CreateIfNeeded(radial_gradient_ssbo_fill_pipelines_, options);
CreateIfNeeded(sweep_gradient_ssbo_fill_pipelines_, options);
CreateIfNeeded(conical_gradient_ssbo_fill_pipelines_, options);
}
}
}

options.blend_mode = BlendMode::kDestination;
options.primitive_type = PrimitiveType::kTriangleStrip;
for (const auto stencil_mode :
{ContentContextOptions::StencilMode::kLegacyClipIncrement,
ContentContextOptions::StencilMode::kLegacyClipDecrement,
ContentContextOptions::StencilMode::kLegacyClipRestore}) {
options.stencil_mode = stencil_mode;
CreateIfNeeded(clip_pipelines_, options);
}
}

} // namespace impeller
You are viewing a condensed version of this merge commit. You can view the full changes here.