Skip to content

Commit

Permalink
Update drawpoolmanager.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah committed Nov 23, 2023
1 parent 661e339 commit fa63a0b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/framework/graphics/drawpoolmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ void DrawPoolManager::drawPool(const DrawPoolType type) {
return;

if (pool->isStatus(DrawPool::DrawStatus::CAN_REPAINT)) {
pool->m_drawStatus.store(DrawPool::DrawStatus::DRAWING);
std::scoped_lock l(pool->m_mutex);
pool->m_drawStatus.store(DrawPool::DrawStatus::DRAWING);
pool->m_framebuffer->bind();
for (int_fast8_t i = -1; ++i <= pool->m_depthLevel;) {
for (const auto& order : pool->m_objects[i])
Expand Down Expand Up @@ -199,17 +199,14 @@ void DrawPoolManager::addBoundingRect(const Rect& dest, const Color& color, uint
void DrawPoolManager::preDraw(const DrawPoolType type, const std::function<void()>& f, const Rect& dest, const Rect& src, const Color& colorClear)
{
select(type);

auto pool = getCurrentPool();
const auto pool = getCurrentPool();

if (pool->isStatus(DrawPool::DrawStatus::DRAWING))
return;

std::scoped_lock l(pool->m_mutex);
pool->m_drawStatus.store(DrawPool::DrawStatus::PRE_DRAW);

{
std::scoped_lock l(pool->m_mutex);

pool->setEnable(true);
pool->resetState();

Expand Down

0 comments on commit fa63a0b

Please sign in to comment.