Skip to content
Snippets Groups Projects
Commit 7f214cf6 authored by Seun Odutola's avatar Seun Odutola
Browse files

Layer-backed macOS applications shouldn't override the rendering context.

There's been instances with layer-backed macOS applications where contexts (NSOpenGLContext) for views tries to render into the context-object (CGLContextObj) of another, which tends to arise when the context (NSOpenGLContext) gets overridden in the vtkCocoaRenderWindow 'InitializeFromCurrentContext()' function. The idea is to protect the integrity of the context to be rendered into from compromise by falling back onto the 'Superclass::InitializeFromCurrentContext()' instead.
parent 5b450c83
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,9 @@
vtkCocoaRenderWindow* renderWindow = [customView renderWindow];
if (renderWindow && renderWindow->GetMapped())
{
renderWindow->InitializeFromCurrentContext();
bool contextInitialised = renderWindow->Superclass::InitializeFromCurrentContext();
assert(contextInitialised);
(void)contextInitialised;
renderWindow->SetFrameBlitModeToBlitToCurrent();
renderWindow->Render();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment