Delete all draw cache on quit
This commit is contained in:
parent
fcda17c7d3
commit
4124104fbc
3 changed files with 5 additions and 3 deletions
|
|
@ -498,8 +498,10 @@ void DrawingProgramCache::draw_cache_image_to_canvas(SkCanvas* canvas, const Dra
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawingProgramCache::delete_window_cache_surface() {
|
void DrawingProgramCache::delete_all_draw_cache() {
|
||||||
windowCache.surface = nullptr;
|
windowCache.surface = nullptr;
|
||||||
|
windowCache.attachedDrawingProgramCache = nullptr;
|
||||||
|
nodeCacheMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawingProgramCache::~DrawingProgramCache() {
|
DrawingProgramCache::~DrawingProgramCache() {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ class DrawingProgramCache {
|
||||||
void update_and_draw_cached_canvas(SkCanvas* canvas, const DrawData& drawData);
|
void update_and_draw_cached_canvas(SkCanvas* canvas, const DrawData& drawData);
|
||||||
void draw_components_to_canvas(SkCanvas* canvas, const DrawData& drawData, const std::optional<SCollision::AABB<WorldScalar>>& drawBounds);
|
void draw_components_to_canvas(SkCanvas* canvas, const DrawData& drawData, const std::optional<SCollision::AABB<WorldScalar>>& drawBounds);
|
||||||
void invalidate_cache_at_aabb(const SCollision::AABB<WorldScalar>& aabb);
|
void invalidate_cache_at_aabb(const SCollision::AABB<WorldScalar>& aabb);
|
||||||
static void delete_window_cache_surface();
|
static void delete_all_draw_cache();
|
||||||
|
|
||||||
CanvasComponentContainer::ObjInfo* get_front_object_colliding_with_in_editing_layer(const SCollision::ColliderCollection<float>& cC);
|
CanvasComponentContainer::ObjInfo* get_front_object_colliding_with_in_editing_layer(const SCollision::ColliderCollection<float>& cC);
|
||||||
~DrawingProgramCache();
|
~DrawingProgramCache();
|
||||||
|
|
|
||||||
|
|
@ -794,7 +794,7 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDL_AppQuit(void *appstate, SDL_AppResult result) {
|
void SDL_AppQuit(void *appstate, SDL_AppResult result) {
|
||||||
DrawingProgramCache::delete_window_cache_surface();
|
DrawingProgramCache::delete_all_draw_cache();
|
||||||
|
|
||||||
MainStruct& mS = *((MainStruct*)appstate);
|
MainStruct& mS = *((MainStruct*)appstate);
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue