Convert visual layers to scene nodes.

This commit is contained in:
James Grogan 2022-11-16 15:06:08 +00:00
parent 798cb365d7
commit 3e53bd9e00
64 changed files with 863 additions and 551 deletions

View file

@ -12,7 +12,6 @@
DrawingContext::DrawingContext(DrawingSurface* surface, FontsManager* fontsManager, DrawingMode requestedDrawingMode)
: mSurface(surface),
mDrawingMode(requestedDrawingMode),
mScene(std::make_unique<Scene>()),
mFontsManager(fontsManager)
{
mPainter = PainterFactory::Create(mDrawingMode);
@ -23,11 +22,6 @@ std::unique_ptr<DrawingContext> DrawingContext::Create(DrawingSurface* surface,
return std::make_unique<DrawingContext>(surface, fontsManager, requestedDrawingMode);
}
Scene* DrawingContext::getScene() const
{
return mScene.get();
}
DrawingSurface* DrawingContext::getSurface() const
{
return mSurface;
@ -40,6 +34,10 @@ FontsManager* DrawingContext::getFontsManager() const
void DrawingContext::paint()
{
mScene->update(mFontsManager, mDrawingMode == DrawingMode::RASTER ? mSurface->getImage() : nullptr);
if (mDrawingMode == DrawingMode::GRAPH)
{
mSurface->getScene()->update(mFontsManager);
}
mPainter->paint(this);
}