mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-18 22:18:38 -04:00
The issue occurred on multiple refreshes in the short period of time. Sometimes, fast refresh was performed instead of the cached deep one.
32 lines
703 B
C++
32 lines
703 B
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include <gui/Common.hpp>
|
|
|
|
#include <optional>
|
|
|
|
namespace service::gui
|
|
{
|
|
struct RenderReference
|
|
{
|
|
int contextId;
|
|
::gui::RefreshModes refreshMode;
|
|
};
|
|
|
|
class RenderCache
|
|
{
|
|
public:
|
|
std::optional<RenderReference> getCachedRender() const;
|
|
bool isRenderCached() const noexcept;
|
|
void cache(RenderReference render);
|
|
void invalidate();
|
|
|
|
private:
|
|
void exchange(RenderReference render);
|
|
|
|
std::optional<RenderReference> cachedRender;
|
|
};
|
|
} // namespace service::gui
|