diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2016-10-02 18:09:30 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2016-11-07 12:59:38 +0000 |
commit | 19dc288ce4a5ad7a386ff2b4208b7284d8731067 (patch) | |
tree | efff7545278a77719dfd821439ec97ad3bb2b7eb /vcl/inc/opengl | |
parent | 055be3f4be764e445064effabf06de9d1ed819f7 (diff) |
opengl: use shared_ptr for ImplOpenGLTexture
Change-Id: I755e312e3e0a69b99a8f02f7d05561b7289845ce
Reviewed-on: https://gerrit.libreoffice.org/30597
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/inc/opengl')
-rw-r--r-- | vcl/inc/opengl/texture.hxx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/vcl/inc/opengl/texture.hxx b/vcl/inc/opengl/texture.hxx index c8f658efb72f..a0c80295f226 100644 --- a/vcl/inc/opengl/texture.hxx +++ b/vcl/inc/opengl/texture.hxx @@ -32,7 +32,6 @@ class ImplOpenGLTexture { - int mnRefCount; public: GLuint mnTexture; int mnWidth; @@ -53,11 +52,6 @@ public: void IncreaseRefCount(int nSlotNumber); void DecreaseRefCount(int nSlotNumber); - bool IsUnique() - { - return mnRefCount == 1; - } - bool InitializeSlotMechanism(int nInitialSlotSize); void SetSlotDeallocateCallback(std::function<void(int)> aCallback) @@ -79,7 +73,7 @@ private: // if the rect size doesn't match the mpImpl one, this instance // is a sub-area from the real OpenGL texture Rectangle maRect; - ImplOpenGLTexture* mpImpl; + std::shared_ptr<ImplOpenGLTexture> mpImpl; int mnSlotNumber; inline bool GetTextureRect(const SalTwoRect& rPosAry, bool bInverted, GLfloat& x1, GLfloat& x2, GLfloat& y1, GLfloat& y2) const; @@ -91,7 +85,7 @@ private: public: OpenGLTexture(); - OpenGLTexture(ImplOpenGLTexture* pImpl, Rectangle aRectangle, int nSlotNumber); + OpenGLTexture(const std::shared_ptr<ImplOpenGLTexture>& pImpl, Rectangle aRectangle, int nSlotNumber); OpenGLTexture( int nWidth, int nHeight, bool bAllocate = true ); OpenGLTexture( int nWidth, int nHeight, int nFormat, int nType, void const * pData ); |