[Impeller] Do not copy the command list when queueing a RenderPassGLES to the reactor (flutter/engine#41125)

[Impeller] Do not copy the command list when queueing a RenderPassGLES to the reactor
This commit is contained in:
Jason Simmons 2023-04-12 14:54:46 -07:00 committed by GitHub
parent 7dc83ce910
commit a084108d8b
2 changed files with 10 additions and 4 deletions

View File

@ -520,11 +520,13 @@ bool RenderPassGLES::OnEncodeCommands(const Context& context) const {
CanDiscardAttachmentWhenDone(stencil0->store_action);
}
std::shared_ptr<const RenderPassGLES> shared_this = shared_from_this();
return reactor_->AddOperation([pass_data,
allocator = context.GetResourceAllocator(),
commands = commands_](const auto& reactor) {
auto result =
EncodeCommandsInReactor(*pass_data, allocator, reactor, commands);
render_pass = std::move(shared_this)](
const auto& reactor) {
auto result = EncodeCommandsInReactor(*pass_data, allocator, reactor,
render_pass->commands_);
FML_CHECK(result) << "Must be able to encode GL commands without error.";
});
}

View File

@ -4,13 +4,17 @@
#pragma once
#include <memory>
#include "flutter/fml/macros.h"
#include "flutter/impeller/renderer/backend/gles/reactor_gles.h"
#include "flutter/impeller/renderer/render_pass.h"
namespace impeller {
class RenderPassGLES final : public RenderPass {
class RenderPassGLES final
: public RenderPass,
public std::enable_shared_from_this<RenderPassGLES> {
public:
// |RenderPass|
~RenderPassGLES() override;