diff options
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/opengl/framebuffer.hxx | 45 | ||||
-rw-r--r-- | vcl/inc/opengl/salbmp.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/opengl/texture.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/opengl/x11/gdiimpl.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/opengl/x11/salvd.hxx | 55 | ||||
-rw-r--r-- | vcl/inc/openglgdiimpl.hxx | 15 | ||||
-rw-r--r-- | vcl/inc/svdata.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/salgdi.h | 4 | ||||
-rw-r--r-- | vcl/inc/unx/salvd.h | 15 |
9 files changed, 121 insertions, 21 deletions
diff --git a/vcl/inc/opengl/framebuffer.hxx b/vcl/inc/opengl/framebuffer.hxx new file mode 100644 index 000000000000..4ccc1c5728ea --- /dev/null +++ b/vcl/inc/opengl/framebuffer.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_VCL_INC_OPENGL_FRAMEBUFFER_H +#define INCLUDED_VCL_INC_OPENGL_FRAMEBUFFER_H + +#include <GL/glew.h> +#include <vcl/dllapi.h> + +#include <opengl/texture.hxx> + +class VCL_PLUGIN_PUBLIC OpenGLFramebuffer +{ +private: + GLuint mnId; + OpenGLTexture maAttachedTexture; + +public: + OpenGLFramebuffer(); + virtual ~OpenGLFramebuffer(); + + GLuint Id() const { return mnId; }; + + void Bind(); + void Unbind(); + + bool IsFree() const; + bool IsAttached( const OpenGLTexture& rTexture ) const; + void AttachTexture( const OpenGLTexture& rTexture ); + void DetachTexture(); + +public: + OpenGLFramebuffer* mpPrevFramebuffer; + OpenGLFramebuffer* mpNextFramebuffer; +}; + +#endif // INCLUDED_VCL_INC_OPENGL_FRAMEBUFFER_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx index 449c1b68adf3..6a812d007af0 100644 --- a/vcl/inc/opengl/salbmp.hxx +++ b/vcl/inc/opengl/salbmp.hxx @@ -39,6 +39,7 @@ class BitmapPalette; class VCL_PLUGIN_PUBLIC OpenGLSalBitmap : public SalBitmap { private: + OpenGLContext* mpContext; OpenGLTexture maTexture; bool mbDirtyTexture; BitmapPalette maPalette; diff --git a/vcl/inc/opengl/texture.hxx b/vcl/inc/opengl/texture.hxx index eb003cfe5b96..ad4738a6948d 100644 --- a/vcl/inc/opengl/texture.hxx +++ b/vcl/inc/opengl/texture.hxx @@ -22,6 +22,9 @@ #include <GL/glew.h> #include <vcl/dllapi.h> +#include <vcl/salgtype.hxx> + +#include <tools/gen.hxx> class ImplOpenGLTexture { diff --git a/vcl/inc/opengl/x11/gdiimpl.hxx b/vcl/inc/opengl/x11/gdiimpl.hxx index f5e5bfb4f2f4..53ebe5b30722 100644 --- a/vcl/inc/opengl/x11/gdiimpl.hxx +++ b/vcl/inc/opengl/x11/gdiimpl.hxx @@ -31,8 +31,8 @@ protected: bool IsOffscreen() const SAL_OVERRIDE; virtual OpenGLContext* CreateWinContext() SAL_OVERRIDE; - virtual bool CompareWinContext( OpenGLContext* pContext ) SAL_OVERRIDE; virtual OpenGLContext* CreatePixmapContext() SAL_OVERRIDE; + virtual bool UseContext( OpenGLContext* pContext ) SAL_OVERRIDE; public: // implementation of X11GraphicsImpl diff --git a/vcl/inc/opengl/x11/salvd.hxx b/vcl/inc/opengl/x11/salvd.hxx new file mode 100644 index 000000000000..0d7143b2b01f --- /dev/null +++ b/vcl/inc/opengl/x11/salvd.hxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_VCL_INC_OPENGL_X11_SALVD_H +#define INCLUDED_VCL_INC_OPENGL_X11_SALVD_H + +#include <prex.h> +#include <postx.h> + +#include <unx/saltype.h> +#include <salvd.hxx> + +class SalDisplay; +class X11OpenGLSalGraphics; + +class X11OpenGLSalVirtualDevice : public SalVirtualDevice +{ + SalDisplay *mpDisplay; + X11SalGraphics *mpGraphics; + bool mbGraphics; // is Graphics used + SalX11Screen mnXScreen; + int mnWidth; + int mnHeight; + sal_uInt16 mnDepth; + +public: + X11OpenGLSalVirtualDevice( SalGraphics *pGraphics, + long nDX, long nDY, + sal_uInt16 nBitCount, + const SystemGraphicsData *pData ); + virtual ~X11OpenGLSalVirtualDevice(); + + SalDisplay * GetDisplay() const { return mpDisplay; } + sal_uInt16 GetDepth() const { return mnDepth; } + int GetWidth() const { return mnWidth; } + int GetHeight() const { return mnHeight; } + SalX11Screen GetXScreenNumber() const { return mnXScreen; } + + virtual SalGraphics* AcquireGraphics() SAL_OVERRIDE; + virtual void ReleaseGraphics( SalGraphics* pGraphics ) SAL_OVERRIDE; + + // Set new size, without saving the old contents + virtual bool SetSize( long nNewDX, long nNewDY ) SAL_OVERRIDE; + virtual void GetSize( long& rWidth, long& rHeight ) SAL_OVERRIDE; +}; + +#endif // INCLUDED_VCL_INC_OPENGL_X11_SALVD_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx index ee7889ea69a4..043bd9528fa4 100644 --- a/vcl/inc/openglgdiimpl.hxx +++ b/vcl/inc/openglgdiimpl.hxx @@ -23,6 +23,7 @@ #include "salgdiimpl.hxx" #include <vcl/dllapi.h> +#include "opengl/framebuffer.hxx" #include "opengl/texture.hxx" #include "regionband.hxx" @@ -37,6 +38,7 @@ class VCL_PLUGIN_PUBLIC OpenGLSalGraphicsImpl : public SalGraphicsImpl protected: OpenGLContext* mpContext; + OpenGLFramebuffer* mpFramebuffer; // clipping vcl::Region maClipRegion; @@ -44,7 +46,6 @@ protected: bool mbUseStencil; bool mbOffscreen; - GLuint mnFramebufferId; OpenGLTexture maOffscreenTex; SalColor mnLineColor; @@ -156,23 +157,23 @@ public: virtual void PostDraw(); protected: - bool AcquireContext( bool bOffscreen ); + bool AcquireContext(); bool ReleaseContext(); // create a new context for window rendering virtual OpenGLContext* CreateWinContext() = 0; - // check whether the given context can be used by this instance - virtual bool CompareWinContext( OpenGLContext* pContext ) = 0; - - // create a new context for window rendering + // create a new context for offscreen rendering virtual OpenGLContext* CreatePixmapContext() = 0; + // check whether the given context can be used by this instance + virtual bool UseContext( OpenGLContext* pContext ) = 0; + public: OpenGLSalGraphicsImpl(); virtual ~OpenGLSalGraphicsImpl (); - OpenGLContext& GetOpenGLContext() { return *mpContext; } + OpenGLContext* GetOpenGLContext(); virtual void Init() SAL_OVERRIDE; diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 212e036ea13f..be40afc1f703 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -345,7 +345,7 @@ struct ImplSVData void ImplInitSVData(); void ImplDeInitSVData(); void ImplDestroySVData(); -vcl::Window* ImplGetDefaultWindow(); +VCL_PLUGIN_PUBLIC vcl::Window* ImplGetDefaultWindow(); VCL_PLUGIN_PUBLIC ResMgr* ImplGetResMgr(); VCL_PLUGIN_PUBLIC ResId VclResId( sal_Int32 nId ); // throws std::bad_alloc if no res mgr DockingManager* ImplGetDockingManager(); diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index 8ef42ba5cd12..edf47b12eeef 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -46,6 +46,7 @@ class X11Pixmap; class X11SalVirtualDevice; class X11SalGraphicsImpl; class X11OpenGLSalGraphicsImpl; +class X11OpenGLSalVirtualDevice; class PspSalPrinter; class PspSalInfoPrinter; class ServerFont; @@ -73,7 +74,7 @@ private: protected: SalFrame* m_pFrame; // the SalFrame which created this Graphics or NULL - X11SalVirtualDevice* m_pVDev; // the SalVirtualDevice which created this Graphics or NULL + SalVirtualDevice* m_pVDev; // the SalVirtualDevice which created this Graphics or NULL const SalColormap* m_pColormap; SalColormap *m_pDeleteColormap; @@ -123,6 +124,7 @@ public: void Init( SalFrame *pFrame, Drawable aDrawable, SalX11Screen nXScreen ); void Init( X11SalVirtualDevice *pVirtualDevice, SalColormap* pColormap = NULL, bool bDeleteColormap = false ); + void Init( X11OpenGLSalVirtualDevice *pVirtualDevice ); void Init( class ImplSalPrinterData *pPrinter ); void DeInit(); diff --git a/vcl/inc/unx/salvd.h b/vcl/inc/unx/salvd.h index dd84c3542fa3..b1caa68f0a39 100644 --- a/vcl/inc/unx/salvd.h +++ b/vcl/inc/unx/salvd.h @@ -44,19 +44,12 @@ class X11SalVirtualDevice : public SalVirtualDevice bool bExternPixmap_; public: - X11SalVirtualDevice(); + X11SalVirtualDevice( SalGraphics *pGraphics, + long nDX, long nDY, + sal_uInt16 nBitCount, + const SystemGraphicsData *pData ); virtual ~X11SalVirtualDevice(); - bool Init( SalDisplay *pDisplay, - long nDX, long nDY, - sal_uInt16 nBitCount, - SalX11Screen nXScreen, - Pixmap hDrawable = None, - XRenderPictFormat* pXRenderFormat = NULL ); - void InitGraphics( X11SalVirtualDevice *pVD ) - { - pGraphics_->Init( pVD ); - } Display *GetXDisplay() const { return pDisplay_->GetDisplay(); |