Convert RenderPath/CommandPath and RenderPaint to refcounted objects

Diffs=
8666bde87 Convert RenderPath/CommandPath and RenderPaint to refcounted objects (#6395)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
This commit is contained in:
csmartdalton
2023-12-27 22:45:06 +00:00
parent ec21667efa
commit 163b2250af
31 changed files with 76 additions and 118 deletions

View File

@@ -34,11 +34,11 @@ public:
size_t count) override;
// Returns a full-formed RenderPath -- can be treated as immutable
std::unique_ptr<RenderPath> makeRenderPath(RawPath&, FillRule) override;
rcp<RenderPath> makeRenderPath(RawPath&, FillRule) override;
std::unique_ptr<RenderPath> makeEmptyRenderPath() override;
rcp<RenderPath> makeEmptyRenderPath() override;
std::unique_ptr<RenderPaint> makeRenderPaint() override;
rcp<RenderPaint> makeRenderPaint() override;
};
} // namespace rive
#endif

View File

@@ -140,15 +140,12 @@ public:
};
// Returns a full-formed RenderPath -- can be treated as immutable
std::unique_ptr<RenderPath> SokolFactory::makeRenderPath(RawPath& rawPath, FillRule rule)
rcp<RenderPath> SokolFactory::makeRenderPath(RawPath& rawPath, FillRule rule)
{
return rivestd::make_unique<SokolRenderPath>(rawPath, rule);
return make_rcp<SokolRenderPath>(rawPath, rule);
}
std::unique_ptr<RenderPath> SokolFactory::makeEmptyRenderPath()
{
return rivestd::make_unique<SokolRenderPath>();
}
rcp<RenderPath> SokolFactory::makeEmptyRenderPath() { return make_rcp<SokolRenderPath>(); }
class SokolBuffer : public lite_rtti_override<RenderBuffer, SokolBuffer>
{
@@ -930,10 +927,7 @@ public:
}
};
std::unique_ptr<RenderPaint> SokolFactory::makeRenderPaint()
{
return rivestd::make_unique<SokolRenderPaint>();
}
rcp<RenderPaint> SokolFactory::makeRenderPaint() { return make_rcp<SokolRenderPaint>(); }
void SokolTessRenderer::restore()
{