[core] custom layer - add contextLost callback
- optional callback method that can be used to do cleanup when the context has been lost before re-initialisation
This commit is contained in:
committed by
Ivo van Dongen
parent
b0c06c764b
commit
97a010cc9b
@@ -16,8 +16,12 @@ RenderCustomLayer::RenderCustomLayer(Immutable<style::CustomLayer::Impl> _impl)
|
||||
|
||||
RenderCustomLayer::~RenderCustomLayer() {
|
||||
assert(BackendScope::exists());
|
||||
if (initialized && !contextDestroyed && impl().deinitializeFn) {
|
||||
impl().deinitializeFn(impl().context);
|
||||
if (initialized) {
|
||||
if (contextDestroyed && impl().contextLostFn ) {
|
||||
impl().contextLostFn(impl().context);
|
||||
} else if (!contextDestroyed && impl().deinitializeFn) {
|
||||
impl().deinitializeFn(impl().context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user