diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-11-13 12:00:59 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-12-11 11:39:55 +0000 |
commit | 7bc1f1285e82982b5d900f54f3c6f877517598b8 (patch) | |
tree | f055198ff7acfa3cf2fac695186452530d539f19 /vcl/inc/opengl | |
parent | 93185f720aab0e58564c050ea3518746d8597803 (diff) |
tdf#93529 - move to a Mac-like double-buffered OpenGL model.
This moves us to always rendering to an off-screen texture, and then
(at idle) blitting this to the screen & swapping buffers. Ideally we
should never see any rendering, or flicker again with this approach.
Several fixes are included:
+ avoid multiple OpenGL contexts being created for the same window,
created excessive flicker problems.
+ de-virtualize UseContext - which context we use is less critical.
+ kill 'mbOffscreen' distinction - all VCL rendering is offscreen.
+ implement 'doFlush' and high priority idle flushing.
+ bind stencil buffer for clipping vs. textures - fixing complex
clopping when rendering to virtual-devices, and off-screen.
+ document environment. variables.
+ use white as default background glClear color, but red or
random color for DBGUTIL.
Change-Id: I6be08595b6c8deb7e6db0dbd81308b2c97d2b4ff
Diffstat (limited to 'vcl/inc/opengl')
-rw-r--r-- | vcl/inc/opengl/texture.hxx | 8 | ||||
-rw-r--r-- | vcl/inc/opengl/win/gdiimpl.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/opengl/x11/gdiimpl.hxx | 1 |
3 files changed, 7 insertions, 3 deletions
diff --git a/vcl/inc/opengl/texture.hxx b/vcl/inc/opengl/texture.hxx index f67b3348d14d..e57aa9e32306 100644 --- a/vcl/inc/opengl/texture.hxx +++ b/vcl/inc/opengl/texture.hxx @@ -37,6 +37,8 @@ public: int mnWidth; int mnHeight; GLenum mnFilter; + GLuint mnOptStencil; + bool mbHasOptStencil; std::unique_ptr<std::vector<int>> mpSlotReferences; int mnFreeSlots; @@ -76,7 +78,8 @@ public: } bool InitializeSlots(int nSlotSize); - int FindFreeSlot(); + int FindFreeSlot(); + GLuint AddStencil(); }; class VCL_DLLPUBLIC OpenGLTexture @@ -110,6 +113,9 @@ public: void Bind(); void Unbind(); void Read( GLenum nFormat, GLenum nType, sal_uInt8* pData ); + GLuint AddStencil(); + bool HasStencil() const; + GLuint StencilId() const; void SaveToFile(const OUString& rFileName); diff --git a/vcl/inc/opengl/win/gdiimpl.hxx b/vcl/inc/opengl/win/gdiimpl.hxx index ecefede6e7ea..8102d2ef5c07 100644 --- a/vcl/inc/opengl/win/gdiimpl.hxx +++ b/vcl/inc/opengl/win/gdiimpl.hxx @@ -31,7 +31,6 @@ public: protected: virtual rtl::Reference<OpenGLContext> CreateWinContext() override; - virtual bool UseContext( const rtl::Reference<OpenGLContext> &pContext ) override; bool RenderTextureCombo(TextureCombo& rCombo, int nX, int nY); diff --git a/vcl/inc/opengl/x11/gdiimpl.hxx b/vcl/inc/opengl/x11/gdiimpl.hxx index f07468d6a135..eccd0ef06ae9 100644 --- a/vcl/inc/opengl/x11/gdiimpl.hxx +++ b/vcl/inc/opengl/x11/gdiimpl.hxx @@ -29,7 +29,6 @@ public: protected: virtual rtl::Reference<OpenGLContext> CreateWinContext() override; - virtual bool UseContext( const rtl::Reference<OpenGLContext> &pContext ) override; bool RenderPixmap(X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY, TextureCombo& rCombo); |