Skip to content

Commit

Permalink
fixed: recreated container does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
gaimanjing authored and harry75369 committed Sep 23, 2024
1 parent b32206f commit 32f3a36
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Application/VGGLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ class VLayer__pImpl
VGG_DECL_API(VLayer);

public:
std::unique_ptr<SkiaContext> skiaContext;
std::unique_ptr<SkiaContext> skiaContext;
std::unique_ptr<SimpleRasterExecutor> simpleRasterExecutor;

std::vector<std::shared_ptr<Renderable>> items;

Expand Down Expand Up @@ -205,6 +206,7 @@ class VLayer__pImpl

void cleanup()
{
simpleRasterExecutor = nullptr;
skiaContext = nullptr;
}

Expand Down Expand Up @@ -349,6 +351,7 @@ std::optional<ELayerError> VLayer::onInit()
ASSERT(false && "Invalid Graphics API backend");
}
ASSERT(_->skiaContext);
_->simpleRasterExecutor = std::make_unique<SimpleRasterExecutor>(_->skiaContext->context());
return std::nullopt;
}
void VLayer::beginFrame()
Expand Down Expand Up @@ -383,8 +386,11 @@ void VLayer::setRenderNode(Ref<RenderNode> node)

void VLayer::setRenderNode(Ref<ZoomerNode> transform, Ref<RenderNode> node)
{
static SimpleRasterExecutor s_e(d_ptr->skiaContext->context());
d_ptr->rasterNode = raster::make(&s_e, d_ptr->viewport, std::move(transform), std::move(node));
d_ptr->rasterNode = raster::make(
d_ptr->simpleRasterExecutor.get(),
d_ptr->viewport,
std::move(transform),
std::move(node));
}

} // namespace VGG::layer
Expand Down

0 comments on commit 32f3a36

Please sign in to comment.