uhh yeah this might be fubar
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "render/backend/opengl/openglrenderer.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ManagedDisplayWidget::ManagedDisplayWidget(QWidget *parent) :
|
||||
@@ -30,6 +32,8 @@ ManagedDisplayWidget::ManagedDisplayWidget(QWidget *parent) :
|
||||
color_service_(nullptr)
|
||||
{
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
attached_renderer_ = new OpenGLRenderer();
|
||||
}
|
||||
|
||||
ManagedDisplayWidget::~ManagedDisplayWidget()
|
||||
@@ -102,7 +106,7 @@ void ManagedDisplayWidget::ColorConfigChanged()
|
||||
SetColorTransform(color_manager_->GetCompliantColorSpace(color_transform_, true));
|
||||
}
|
||||
|
||||
OpenGLColorProcessorPtr ManagedDisplayWidget::color_service()
|
||||
ColorProcessorPtr ManagedDisplayWidget::color_service()
|
||||
{
|
||||
return color_service_;
|
||||
}
|
||||
@@ -113,6 +117,8 @@ void ManagedDisplayWidget::ContextCleanup()
|
||||
|
||||
color_service_ = nullptr;
|
||||
|
||||
attached_renderer_->Destroy();
|
||||
|
||||
doneCurrent();
|
||||
}
|
||||
|
||||
@@ -188,6 +194,8 @@ void ManagedDisplayWidget::initializeGL()
|
||||
SetupColorProcessor();
|
||||
|
||||
connect(context(), &QOpenGLContext::aboutToBeDestroyed, this, &ManagedDisplayWidget::ContextCleanup, Qt::DirectConnection);
|
||||
|
||||
static_cast<OpenGLRenderer*>(attached_renderer_)->Init(context());
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::EnableDefaultContextMenu()
|
||||
@@ -280,11 +288,9 @@ void ManagedDisplayWidget::SetupColorProcessor()
|
||||
|
||||
try {
|
||||
|
||||
color_service_ = OpenGLColorProcessor::Create(color_manager_,
|
||||
color_manager_->GetReferenceColorSpace(),
|
||||
color_transform_);
|
||||
|
||||
color_service_->Enable(context(), true);
|
||||
color_service_ = ColorProcessor::Create(color_manager_,
|
||||
color_manager_->GetReferenceColorSpace(),
|
||||
color_transform_);
|
||||
|
||||
} catch (OCIO::Exception& e) {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <QOpenGLWidget>
|
||||
|
||||
#include "render/backend/opengl/openglcolorprocessor.h"
|
||||
#include "render/backend/renderer.h"
|
||||
#include "render/colormanager.h"
|
||||
#include "widget/menu/menu.h"
|
||||
|
||||
@@ -98,7 +98,7 @@ protected:
|
||||
/**
|
||||
* @brief Provides access to the color processor (nullptr if none is set)
|
||||
*/
|
||||
OpenGLColorProcessorPtr color_service();
|
||||
ColorProcessorPtr color_service();
|
||||
|
||||
/**
|
||||
* @brief Override when setting up OpenGL context
|
||||
@@ -128,6 +128,11 @@ private:
|
||||
*/
|
||||
void ClearOCIOLutTexture();
|
||||
|
||||
/**
|
||||
* @brief Renderer abstraction
|
||||
*/
|
||||
Renderer* attached_renderer_;
|
||||
|
||||
/**
|
||||
* @brief Connected color manager
|
||||
*/
|
||||
@@ -136,7 +141,7 @@ private:
|
||||
/**
|
||||
* @brief Color management service
|
||||
*/
|
||||
OpenGLColorProcessorPtr color_service_;
|
||||
ColorProcessorPtr color_service_;
|
||||
|
||||
/**
|
||||
* @brief Internal color transform storage
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
#include "common/qtutils.h"
|
||||
#include "node/node.h"
|
||||
#include "render/backend/opengl/openglrenderfunctions.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
@@ -75,7 +74,7 @@ void HistogramScope::CleanUp()
|
||||
doneCurrent();
|
||||
}
|
||||
|
||||
OpenGLShaderPtr HistogramScope::CreateShader()
|
||||
QVariant HistogramScope::CreateShader()
|
||||
{
|
||||
OpenGLShaderPtr pipeline = OpenGLShader::Create();
|
||||
|
||||
|
||||
@@ -36,16 +36,16 @@ public:
|
||||
protected:
|
||||
virtual void initializeGL() override;
|
||||
|
||||
virtual OpenGLShaderPtr CreateShader() override;
|
||||
OpenGLShaderPtr CreateSecondaryShader();
|
||||
virtual QVariant CreateShader() override;
|
||||
QVariant CreateSecondaryShader();
|
||||
|
||||
void AssertAdditionalTextures();
|
||||
|
||||
virtual void DrawScope() override;
|
||||
|
||||
private:
|
||||
OpenGLShaderPtr pipeline_secondary_;
|
||||
OpenGLTexture texture_row_sums_;
|
||||
QVariant pipeline_secondary_;
|
||||
QVariant texture_row_sums_;
|
||||
|
||||
private slots:
|
||||
void CleanUp();
|
||||
|
||||
@@ -54,7 +54,7 @@ void ScopeBase::showEvent(QShowEvent* e)
|
||||
UploadTextureFromBuffer();
|
||||
}
|
||||
|
||||
OpenGLShaderPtr ScopeBase::CreateShader()
|
||||
QVariant ScopeBase::CreateShader()
|
||||
{
|
||||
return OpenGLShader::CreateDefault();
|
||||
}
|
||||
|
||||
@@ -22,10 +22,7 @@
|
||||
#define SCOPEBASE_H
|
||||
|
||||
#include "codec/frame.h"
|
||||
#include "render/backend/opengl/openglcolorprocessor.h"
|
||||
#include "render/backend/opengl/openglframebuffer.h"
|
||||
#include "render/backend/opengl/openglshader.h"
|
||||
#include "render/backend/opengl/opengltexture.h"
|
||||
#include "render/colorprocessor.h"
|
||||
#include "widget/manageddisplay/manageddisplay.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
@@ -47,35 +44,28 @@ protected:
|
||||
|
||||
virtual void showEvent(QShowEvent* e) override;
|
||||
|
||||
virtual OpenGLShaderPtr CreateShader();
|
||||
virtual QVariant CreateShader();
|
||||
|
||||
virtual void DrawScope();
|
||||
|
||||
OpenGLShaderPtr pipeline()
|
||||
QVariant pipeline()
|
||||
{
|
||||
return pipeline_;
|
||||
}
|
||||
|
||||
OpenGLTexture& managed_tex()
|
||||
QVariant managed_tex()
|
||||
{
|
||||
return managed_tex_;
|
||||
}
|
||||
|
||||
OpenGLFramebuffer& framebuffer()
|
||||
{
|
||||
return framebuffer_;
|
||||
}
|
||||
|
||||
private:
|
||||
void UploadTextureFromBuffer();
|
||||
|
||||
OpenGLShaderPtr pipeline_;
|
||||
QVariant pipeline_;
|
||||
|
||||
OpenGLTexture texture_;
|
||||
QVariant texture_;
|
||||
|
||||
OpenGLTexture managed_tex_;
|
||||
|
||||
OpenGLFramebuffer framebuffer_;
|
||||
QVariant managed_tex_;
|
||||
|
||||
Frame* buffer_;
|
||||
|
||||
|
||||
@@ -25,9 +25,7 @@
|
||||
|
||||
#include "node/node.h"
|
||||
#include "render/backend/opengl/openglcolorprocessor.h"
|
||||
#include "render/backend/opengl/openglframebuffer.h"
|
||||
#include "render/backend/opengl/openglshader.h"
|
||||
#include "render/backend/opengl/opengltexture.h"
|
||||
#include "render/color.h"
|
||||
#include "render/colormanager.h"
|
||||
#include "tool/tool.h"
|
||||
@@ -211,7 +209,7 @@ private:
|
||||
/**
|
||||
* @brief Internal reference to the OpenGL texture to draw. Set in SetTexture() and used in paintGL().
|
||||
*/
|
||||
OpenGLTexture texture_;
|
||||
QVariant texture_;
|
||||
|
||||
/**
|
||||
* @brief Translation only matrix (defaults to identity).
|
||||
|
||||
Reference in New Issue
Block a user