From 53106e18475194a1f56e6b0a23c53ac0cba3608a Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sat, 15 Feb 2020 14:02:00 +1100 Subject: [PATCH] opengl: remove locks from texture These are not used anymore and are therefore unnecessary. --- app/render/backend/opengl/openglbackend.cpp | 4 ---- app/render/backend/opengl/openglproxy.cpp | 4 ---- app/render/backend/opengl/opengltexture.cpp | 10 ---------- app/render/backend/opengl/opengltexture.h | 7 ------- 4 files changed, 25 deletions(-) diff --git a/app/render/backend/opengl/openglbackend.cpp b/app/render/backend/opengl/openglbackend.cpp index 4f0b6a987..a79cc6d09 100644 --- a/app/render/backend/opengl/openglbackend.cpp +++ b/app/render/backend/opengl/openglbackend.cpp @@ -128,8 +128,6 @@ void OpenGLBackend::ParamsChangedEvent() OpenGLTexturePtr OpenGLBackend::CopyTexture(OpenGLTexturePtr input) { - input->Lock(); - QOpenGLContext* ctx = QOpenGLContext::currentContext(); OpenGLTexturePtr copy = std::make_shared(); @@ -147,7 +145,5 @@ OpenGLTexturePtr OpenGLBackend::CopyTexture(OpenGLTexturePtr input) copy_buffer_.Release(); copy_buffer_.Detach(); - input->Unlock(); - return copy; } diff --git a/app/render/backend/opengl/openglproxy.cpp b/app/render/backend/opengl/openglproxy.cpp index 5f26e9941..bf92d4841 100644 --- a/app/render/backend/opengl/openglproxy.cpp +++ b/app/render/backend/opengl/openglproxy.cpp @@ -364,8 +364,6 @@ void OpenGLProxy::TextureToBuffer(const QVariant &tex_in, QByteArray &buffer) PixelFormat::Info format_info = PixelService::GetPixelFormatInfo(video_params_.format()); - texture->texture()->Lock(); - QOpenGLFunctions* f = QOpenGLContext::currentContext()->functions(); buffer_.Attach(texture->texture()); buffer_.Bind(); @@ -380,8 +378,6 @@ void OpenGLProxy::TextureToBuffer(const QVariant &tex_in, QByteArray &buffer) buffer_.Release(); buffer_.Detach(); - - texture->texture()->Unlock(); } void OpenGLProxy::SetParameters(const VideoRenderingParams ¶ms) diff --git a/app/render/backend/opengl/opengltexture.cpp b/app/render/backend/opengl/opengltexture.cpp index 03dd4fbe8..1810b8704 100644 --- a/app/render/backend/opengl/opengltexture.cpp +++ b/app/render/backend/opengl/opengltexture.cpp @@ -156,16 +156,6 @@ void OpenGLTexture::Upload(const void *data) Release(); } -void OpenGLTexture::Lock() -{ - mutex_.lock(); -} - -void OpenGLTexture::Unlock() -{ - mutex_.unlock(); -} - void OpenGLTexture::CreateInternal(QOpenGLContext* create_ctx, GLuint* tex, const void *data) { QOpenGLFunctions* f = create_ctx->functions(); diff --git a/app/render/backend/opengl/opengltexture.h b/app/render/backend/opengl/opengltexture.h index 1247a5a50..ef1c7c23e 100644 --- a/app/render/backend/opengl/opengltexture.h +++ b/app/render/backend/opengl/opengltexture.h @@ -22,7 +22,6 @@ #define OPENGLTEXTURE_H #include -#include #include #include "codec/frame.h" @@ -60,10 +59,6 @@ public: void Upload(const void *data); - void Lock(); - - void Unlock(); - public slots: void Destroy(); @@ -80,8 +75,6 @@ private: PixelFormat::Format format_; - QMutex mutex_; - }; using OpenGLTexturePtr = std::shared_ptr;