mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Impeller] Ensure that missing color attachment 0u does not cause crash in embedder API (flutter/engine#43705)
https://github.com/flutter/flutter/issues/130619
This commit is contained in:
parent
389b81e4ac
commit
4698c6b307
@ -247,7 +247,8 @@ bool EntityPass::Render(ContentContext& renderer,
|
||||
const RenderTarget& render_target) const {
|
||||
auto root_render_target = render_target;
|
||||
|
||||
if (root_render_target.GetColorAttachments().empty()) {
|
||||
if (root_render_target.GetColorAttachments().find(0u) ==
|
||||
root_render_target.GetColorAttachments().end()) {
|
||||
VALIDATION_LOG << "The root RenderTarget must have a color attachment.";
|
||||
return false;
|
||||
}
|
||||
@ -341,7 +342,7 @@ bool EntityPass::Render(ContentContext& renderer,
|
||||
|
||||
// The safety check for fetching this color attachment is at the beginning of
|
||||
// this method.
|
||||
auto color0 = root_render_target.GetColorAttachments().find(0)->second;
|
||||
auto color0 = root_render_target.GetColorAttachments().find(0u)->second;
|
||||
|
||||
// If a root stencil was provided by the caller, then verify that it has a
|
||||
// configuration which can be used to render this pass.
|
||||
|
||||
@ -83,7 +83,6 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceGLImpeller::AcquireFrame(
|
||||
GLFrameInfo frame_info = {static_cast<uint32_t>(size.width()),
|
||||
static_cast<uint32_t>(size.height())};
|
||||
const GLFBOInfo fbo_info = delegate_->GLContextFBO(frame_info);
|
||||
|
||||
auto surface = impeller::SurfaceGLES::WrapFBO(
|
||||
impeller_context_, // context
|
||||
swap_callback, // swap_callback
|
||||
|
||||
@ -999,7 +999,7 @@ MakeRenderTargetFromBackingStoreImpeller(
|
||||
|
||||
impeller::RenderTarget render_target_desc;
|
||||
|
||||
render_target_desc.SetColorAttachment(color0, framebuffer->target);
|
||||
render_target_desc.SetColorAttachment(color0, 0u);
|
||||
render_target_desc.SetStencilAttachment(stencil0);
|
||||
|
||||
return std::make_unique<flutter::EmbedderRenderTargetImpeller>(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user