Commit 4842efe4 authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot

Merge topic 'make_release_graphics_public'

b92c70a6 Make release graphics resources public
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !6259
parents 3502a7fc b92c70a6
Pipeline #153451 running with stage
......@@ -146,6 +146,13 @@ public:
*/
virtual void Render() = 0;
/**
* Release any graphics resources that are being consumed by this texture.
* The parameter window could be used to determine which graphic
* resources to release.
*/
virtual void ReleaseGraphicsResources(vtkWindow*) {}
//@{
/**
* Get the pixel data of an image, transmitted as RGBRGBRGB. The
......
......@@ -281,7 +281,7 @@ const char* vtkOpenGLRenderWindow::ReportCapabilities()
}
// ----------------------------------------------------------------------------
void vtkOpenGLRenderWindow::ReleaseGraphicsResources(vtkRenderWindow* renWin)
void vtkOpenGLRenderWindow::ReleaseGraphicsResources(vtkWindow* renWin)
{
this->PushContext();
......
......@@ -428,6 +428,12 @@ public:
// does VTKs framebuffer require resolving for reading pixels
bool GetBufferNeedsResolving();
/**
* Free up any graphics resources associated with this window
* a value of NULL means the context may already be destroyed
*/
void ReleaseGraphicsResources(vtkWindow*) override;
protected:
vtkOpenGLRenderWindow();
~vtkOpenGLRenderWindow() override;
......@@ -462,12 +468,6 @@ protected:
*/
virtual void DestroyWindow() = 0;
/**
* Free up any graphics resources associated with this window
* a value of NULL means the context may already be destroyed
*/
virtual void ReleaseGraphicsResources(vtkRenderWindow*);
/**
* Query and save OpenGL state
*/
......
......@@ -60,7 +60,7 @@ void vtkOpenVRModel::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "Loaded " << (this->Loaded ? "On\n" : "Off\n");
}
void vtkOpenVRModel::ReleaseGraphicsResources(vtkRenderWindow* win)
void vtkOpenVRModel::ReleaseGraphicsResources(vtkWindow* win)
{
this->ModelVBO->ReleaseGraphicsResources();
this->ModelHelper.ReleaseGraphicsResources(win);
......
......@@ -58,7 +58,7 @@ public:
void SetRayLength(double length);
vtkOpenVRRay* GetRay() { return this->Ray; }
void ReleaseGraphicsResources(vtkRenderWindow* win);
void ReleaseGraphicsResources(vtkWindow* win);
// the tracked device this model represents if any
vr::TrackedDeviceIndex_t TrackedDevice;
......
......@@ -133,7 +133,7 @@ vtkOpenVRRenderWindow::~vtkOpenVRRenderWindow()
}
// ----------------------------------------------------------------------------
void vtkOpenVRRenderWindow::ReleaseGraphicsResources(vtkRenderWindow* renWin)
void vtkOpenVRRenderWindow::ReleaseGraphicsResources(vtkWindow* renWin)
{
// this->HelperWindow->ReleaseGraphicsResources(renWin);
this->Superclass::ReleaseGraphicsResources(renWin);
......
......@@ -381,15 +381,15 @@ public:
// OpenGL state
vtkOpenGLState* GetState() override;
protected:
vtkOpenVRRenderWindow();
~vtkOpenVRRenderWindow();
/**
* Free up any graphics resources associated with this window
* a value of nullptr means the context may already be destroyed
*/
virtual void ReleaseGraphicsResources(vtkRenderWindow*);
void ReleaseGraphicsResources(vtkWindow*) override;
protected:
vtkOpenVRRenderWindow();
~vtkOpenVRRenderWindow();
virtual void CreateAWindow() {}
virtual void DestroyWindow() {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment