Files
oak-editor/app/render/backend/opengl/openglbackend.h
T
itsmattkc 9272858de2 send list to EmitCachedFrameReady() rather than one rational at a time
Since EmitCachedFrameReady() makes a copy of the texture, we can economize a lot
by re-using the same copied texture for all the times rather than making a
separate copy for each time.
2019-12-27 05:17:18 +11:00

48 lines
1.0 KiB
C++

#ifndef OPENGLBACKEND_H
#define OPENGLBACKEND_H
#include "../videorenderbackend.h"
#include "openglframebuffer.h"
#include "openglworker.h"
#include "opengltexture.h"
#include "opengltexturecache.h"
#include "openglshader.h"
#include "openglshadercache.h"
class OpenGLBackend : public VideoRenderBackend
{
Q_OBJECT
public:
OpenGLBackend(QObject* parent = nullptr);
virtual ~OpenGLBackend() override;
OpenGLTexturePtr GetCachedFrameAsTexture(const rational& time);
protected:
virtual bool InitInternal() override;
virtual void CloseInternal() override;
virtual bool CompileInternal() override;
virtual void DecompileInternal() override;
virtual void EmitCachedFrameReady(const QList<rational> &times, const QVariant& value) override;
private:
OpenGLTexturePtr CopyTexture(OpenGLTexturePtr input);
OpenGLShaderCache shader_cache_;
OpenGLTextureCache texture_cache_;
OpenGLTexturePtr master_texture_;
OpenGLFramebuffer copy_buffer_;
OpenGLShaderPtr copy_pipeline_;
};
#endif // OPENGLBACKEND_H