Convert visual layers to scene nodes.
This commit is contained in:
parent
798cb365d7
commit
3e53bd9e00
64 changed files with 863 additions and 551 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue