summaryrefslogtreecommitdiff
path: root/vcl/opengl/win
AgeCommit message (Collapse)Author
2018-01-24loplugin:unused-returns in vclNoel Grandin
Change-Id: I507320900a47f604d17ed7d402d531a7cbdf744e Reviewed-on: https://gerrit.libreoffice.org/48331 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-23More loplugin:cstylecast on WindowsStephan Bergmann
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More loplugin:cstylecast" Change-Id: Ib3355159dd08333e1b7a8d091caf2069cdcc7862 Reviewed-on: https://gerrit.libreoffice.org/48317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-27loplugin:includeform: vcl (Windows)Stephan Bergmann
Change-Id: I4a0fc4b483069141d2b943079adf5aa741df968e
2017-10-05Rename and move SAL_U/W to o3tl::toU/WMike Kaganski
Previosly (since commit 9ac98e6e3488e434bf4864ecfb13a121784f640b) it was expected to gradually remove SAL_U/W usage in Windows code by replacing with reinterpret_cast or changing to some bettertypes. But as it's useful to make use of fact that LibreOffice and Windows use compatible representation of strings, this commit puts these functions to a better-suited o3tl, and recommends that the functions be consistently used throughout Windows-specific code to reflect the compatibility and keep the casts safe. Change-Id: I2f7c65606d0e2d0c01a00f08812bb4ab7659c5f6 Reviewed-on: https://gerrit.libreoffice.org/43150 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-10-01loplugin:nullptr,redundantcast (clang-cl)Stephan Bergmann
Change-Id: Ic173e38828b04fd177d62551e3323b816c73d556 Reviewed-on: https://gerrit.libreoffice.org/42980 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-30Use explicit function names for fooA/fooW WinAPI; prefer fooWMike Kaganski
We should only use generic foo function name when it takes params that are also dependent on UNICODE define, like LoadCursor( nullptr, IDC_ARROW ) where IDC_ARROW is defined in MSVC headers synchronised with LoadCursor definition. We should always use Unicode API for any file paths operations, because otherwise we will get "?" for any character in path that is not in current non-unicode codepage, which will result in failed file operations. Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633 Reviewed-on: https://gerrit.libreoffice.org/42935 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-29Drop check for Windows versions we don't supportMike Kaganski
Since we dropped support of Vista and below in master toward 6.0, those checks are needless. Removing the code that only worked in older versions, and streamlining the resulting code. Also, use kernel32.dll version for Windows version, instead of deprecated GetVersionEx, and inconvenient VersionHelpers. Since both GetVersion(Ex) and VersionHelpers (based on VerifyVersionInfo) are subject to manifest-based behavior since Windows 8.1, this move will hopefully result in more reliable OS version detection. Change-Id: I3edd8fc1843e64b6a65bd3a126be6a085511f13c Reviewed-on: https://gerrit.libreoffice.org/42905 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-18Use even more WIN32_LEAN_AND_MEANMike Kaganski
Change-Id: I538fe5b41156366e0e87b3a93e58a3947afd18f5 Reviewed-on: https://gerrit.libreoffice.org/42398 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-14loplugin:externvar (clang-cl)Stephan Bergmann
Change-Id: I83245eb7d616d87b74326f49911b1fa5fc58431e
2017-09-05Resolves: tdf#107730 ensure per-thread epoxy_handle_external_wglMakeCurrentCaolán McNamara
Change-Id: Idc1e2da3a02715a09b5b8f4e8e736b8806e59f8e Reviewed-on: https://gerrit.libreoffice.org/41927 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-08-31loplugin:constparams: vcl (clang-cl)Stephan Bergmann
Change-Id: Iabcbb6e09616a28c0d8927d11af3da47e48cbd90
2017-08-18loplugin:oncevar (clang-cl)Stephan Bergmann
Change-Id: I118da42ad7a42e4d081fd9901e230a0318a77f73
2017-07-05loplugin:casttovoid (clang-cl): vclStephan Bergmann
Change-Id: I4c54f7edc0422382e1cd7fca95c2e7ab2b4bab1c
2017-07-03loplugin:oncevar (clang-cl): vclStephan Bergmann
Change-Id: I0459978c2cfb61cd7251f0e8d9a30f1f19c02c11
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-22Don't keep gGlobalGlyphCache, gTextureCache around until exitStephan Bergmann
Those static variables had been introduced with 56c5a0ba7781a325123852737970fa7f0179ff7f "tdf#94682 limit the number of textures for the glyph texture atlas" and dea885f80a80c6a5839ee5dbf8521487186a9522 "opengl: cache native widget textures also for Windows", but at least the clang-cl build crashed on exit from soffice.bin with > Exception thrown at 0x00007FFF3906AA84 (opengl32.dll) in soffice.bin: 0xC0000005: Access violation reading location 0x0000000000000898. > opengl32.dll!glGetString() Unknown > epoxy.dll!epoxy_glGetString_dispatch_table_rewrite_ptr(unsigned int name) Line 46456 C > epoxy.dll!epoxy_glGetString_dispatch_table_thunk(unsigned int name) Line 46456 C > epoxy.dll!epoxy_is_desktop_gl() Line 299 C > epoxy.dll!gl_provider_resolver(const char * name, const gl_provider * providers, const unsigned short * entrypoints) Line 7323 C > epoxy.dll!epoxy_glDeleteTextures_resolver() Line 14646 C > epoxy.dll!epoxy_glDeleteTextures_dispatch_table_rewrite_ptr(int n, const unsigned int * textures) Line 45813 C > epoxy.dll!epoxy_glDeleteTextures_dispatch_table_thunk(int n, const unsigned int * textures) Line 45813 C > vcllo.dll!TextureState::unbindAndDelete(unsigned int nTexture) Line 59 C++ > vcllo.dll!ImplOpenGLTexture::~ImplOpenGLTexture() Line 182 C++ > [External Code] > vcllo.dll!PackedTextureAtlasManager::~PackedTextureAtlasManager() Line 129 C++ > vcllo.dll!GlobalGlyphCache::~GlobalGlyphCache() Line 67 C++ > [External Code] > vcllo.dll!??__FgGlobalGlyphCache@GlyphCache@@0V?$unique_ptr@UGlobalGlyphCache@@U?$default_delete@UGlobalGlyphCache@@@std@@@std@@A@YAXXZ() Line 48 C++ > [External Code] resp. > Exception thrown at 0x00007FFF3A5AAA84 (opengl32.dll) in soffice.bin: 0xC0000005: Access violation reading location 0x0000000000000898. > opengl32.dll!glGetString() Unknown > epoxy.dll!epoxy_glGetString_dispatch_table_rewrite_ptr(unsigned int name) Line 46456 C > epoxy.dll!epoxy_glGetString_dispatch_table_thunk(unsigned int name) Line 46456 C > epoxy.dll!epoxy_is_desktop_gl() Line 299 C > epoxy.dll!gl_provider_resolver(const char * name, const gl_provider * providers, const unsigned short * entrypoints) Line 7323 C > epoxy.dll!epoxy_glDeleteTextures_resolver() Line 14646 C > epoxy.dll!epoxy_glDeleteTextures_dispatch_table_rewrite_ptr(int n, const unsigned int * textures) Line 45813 C > epoxy.dll!epoxy_glDeleteTextures_dispatch_table_thunk(int n, const unsigned int * textures) Line 45813 C > vcllo.dll!TextureState::unbindAndDelete(unsigned int nTexture) Line 59 C++ > vcllo.dll!ImplOpenGLTexture::~ImplOpenGLTexture() Line 182 C++ > [External Code] > vcllo.dll!OpenGLTexture::~OpenGLTexture() Line 313 C++ > [External Code] > vcllo.dll!TextureCombo::~TextureCombo() Line 51 C++ > [External Code] > vcllo.dll!std::pair<ControlCacheKey, std::unique_ptr<TextureCombo, std::default_delete<TextureCombo> > >::~pair() Line 145 C++ > [External Code] > vcllo.dll!o3tl::lru_map<ControlCacheKey, std::unique_ptr<TextureCombo, std::default_delete<TextureCombo> >, ControlCacheHashFunction>::~lru_map() Line 34 C++ > vcllo.dll!??__FgTextureCache@?A@@YAXXZ() Line 738 C++ > [External Code] Change-Id: I0198f657f5d59314c5f662c214504ed3e1523567 Reviewed-on: https://gerrit.libreoffice.org/36801 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-04Finally switch MSVC to sal_Unicode = char16_t, tooStephan Bergmann
There is lots of (Windows-only) code that relied on sal_Unicode being the same as wchar_t, and the best change may be different in each case (and doing the changes may be somewhat error prone). So for now add SAL_U/SAL_W scaffolding functions to sal/types.h, remove their uses one by one again, and finally drop those functions again. Change-Id: I2cc791bd941d089901abb5f6fc2f05fbc49e65ea Reviewed-on: https://gerrit.libreoffice.org/36077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-04loplugin:loopvartoosmall (clang-cl)Stephan Bergmann
Change-Id: Ibdfdc5c66cf1e81d9e43c94df31120c476a78572 Reviewed-on: https://gerrit.libreoffice.org/36064 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-04tdf#105162: Need to call epoxy_handle_external_wglMakeCurrent()Tor Lillqvist
Somewhere, in time before calling epoxy-wrapper OpenGL functions. This seems to be a good place. Educated guess based on debugging, turned out to work. Change-Id: Id3f1dfb0c5a9dbfb166c47ea81db902af1a4fc08
2017-01-04tdf#97228 Moved class ControlCacheKey in a seperate include file.Huzaifa Iftikhar
class ControlCacheKey defined in include/vcl/salnativewidgets.hxx is used only by vcl therefore it is moved to a seperate include file named ControlCacheKey.hxx which is inside vcl/inc/ControlCacheKey.hxx. This header file contains the definition of the the class ControlCacheKey. Since this class uses an object of another class named Size which is defined in gen.hxx therefore this is included in ControlCacheKey.hxx. All the files that references the class ControlCacheKey includes ControlCacheKey.hxx with the syntax: #include "ControlCacheKey.hxx" Change-Id: I7d7b3e1cf6950a953e6bbed670c1914826b2bacd Reviewed-on: https://gerrit.libreoffice.org/32422 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-12-20Related: tdf#104705 an effort to address crashCaolán McNamara
Change-Id: I43284c19d0f38fb8fbd7e908c5d255cdfd399015 Reviewed-on: https://gerrit.libreoffice.org/32222 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-12-16loplugin:nullptr (clang-cl)Stephan Bergmann
Change-Id: I557e752ca05146e2a571d027fc3d1875afd6ef26
2016-12-13change from glew to epoxyCaolán McNamara
because that works under wayland out of the box and gtk3 uses it already Change-Id: Iefaac31e325534a81a5389f752804af917c1baef Reviewed-on: https://gerrit.libreoffice.org/31213 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-12-09move the windows restart because of bad-opengl requirements to a better placeCaolán McNamara
because if the opengl support is such that the opengl-for-vcl requirements don't fit, then on the second run after discovering this (the first having restarted) if you try opengl slide transitions libreoffice will just exit because it thinks this first check of opengl-for-slideshow is the first opengl-for-vcl effort. so move this code into the place which I believe is the opengl-for-vcl entry point this is all related to... commit 210c39dd9a6ebaa964c03c20e4b442ea36941ae9 Date: Fri Jun 3 09:25:13 2016 +0300 tdf#100193: Check earlier and harder whether OpenGL is good enough on Windows Change-Id: I3f6a72efff9c533ca9a0602227fd929ac645f60b Reviewed-on: https://gerrit.libreoffice.org/31763 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-12-08model the WinOpenGLContext::isCurrent like the X11OpenGLContext::isCurrentCaolán McNamara
i.e. if !m_aGLWin.hRC then we're definitely not a current context Change-Id: Id35f75c19629a17b714edf6aa6628d8f5b2f8ced
2016-12-08the return from ImplInit *is* checkedCaolán McNamara
bool WinOpenGLContext::init(HDC hDC, HWND hWnd) { ... return ImplInit(); } rtl::Reference<OpenGLContext> WinOpenGLSalGraphicsImpl::CreateWinContext() { ... if (!xContext->init(mrWinParent.mhLocalDC, mrWinParent.mhWnd)) } etc. Another problem here is ... "If we notice that OpenGL is broken the first time being called, it is not too late to call disableOpenGLAndTerminateForRestart(). The first time this will be called is from displaying the splash screen" isn't true when the first start causes opengl to be disabled, then on subsequent starts you can enter this function from launching an opengl slide transition. (note opengl is disabled if opengl is < 30, so all the versioning checks the slide transitions do is probably pointless now. The only actually useful use of opengl we have seems to be somewhat unloved) Change-Id: I1e159f826447520f39ea063fd4c0c83220b1385f
2016-11-22loplugin:datamembershadowStephan Bergmann
Change-Id: If9e9371569750dd2c970450b808c6c5567faae55
2016-11-09tdf#103804 reduced register areaScale shader and detection for intelTomaž Vajngerl
Some intel drivers crash when areaScale shader with "large" array is used. This adds a "reduced register" version of the areaScale shader. We still use the first version of the shader for other drivers and switch between the 2 implementations with a runtime detection. Change-Id: I1860f898c03b40a600eb1b41f7262719382a7171 Reviewed-on: https://gerrit.libreoffice.org/30571 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-10-15clang-cl loplugin: vclStephan Bergmann
Change-Id: I40f8a6fef9d66b28a1d72551a6873b041b38b09e Reviewed-on: https://gerrit.libreoffice.org/29841 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-08-12fix windows buildNoel Grandin
after commit 500a3be0 "loplugin:countusersofdefaultparams in vcl..xmlsecurity" Change-Id: I09b07f241dc45f2d23370addfb1bc10aa2caedc4
2016-08-01Look also for "RDPDD Chained DD"Tor Lillqvist
Apparently in some remote desktop situations the device string uses "RDPDD" and not "RDPUDD". No idea what the semantic difference is. Change-Id: I85532b90d759d02fffb73d0f3d22166aefd4edab
2016-07-28opengl: don't initialize MSAA when we create VCL contextTomaž Vajngerl
Change-Id: Ic8060ebdabb86d8b724ee419fdfcc1f58e8a0316 Reviewed-on: https://gerrit.libreoffice.org/27614 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-07-28opengl: improve context creation, temp window creation on windowsTomaž Vajngerl
If anything fails at context creation then don't forget to deallocate resources. Temp window creation is written C like, as it was copy/pasted from an C example. Change-Id: Ia9d704e42206b1d4c37db2954bba4f165e3c8389 Reviewed-on: https://gerrit.libreoffice.org/27613 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-07-25opengl: check supported texture size on first GL initTomaž Vajngerl
Change-Id: I27ef828a8d47d50adbbcc3fb0fd152f4f6ffc446 Reviewed-on: https://gerrit.libreoffice.org/27497 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2016-06-20add some OpenGL info to the crash reporterMarkus Mohrhard
Change-Id: Id377bc3bd814fad822d577603b1f147b71ad9ae2 Reviewed-on: https://gerrit.libreoffice.org/26445 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-06-03Clean up Windows error reporting a bitTor Lillqvist
We have comphelper::WindowsErrorString(), so use it, in SAL_WARNs, right where an error happens. Get rid of the fairly unhelpful ImplWriteLastError() function. Avoid duplicated error reporting. Change-Id: I83374a65980b7c0ffa35fc493b4fb1f2e94f0dbb
2016-06-03tdf#100193: Check earlier and harder whether OpenGL is good enough on WindowsTor Lillqvist
If we notice early enough that OpenGL is broken or not good enough, we can disable it and terminate with EXITHELPER_NORMAL_RESTART. Not beautiful, but works. The earlier added check whether shader compilation and loading of shader program binaries from a cached file works is now just one of the aspects that are checked. Change-Id: I9382576cc607f1916f6002f1fa78a62e23180fe3
2016-06-02Accept also hex vendor id in hex in opengl_blacklist_windows.xmlTor Lillqvist
(And not just names from the hardcoded list.) Surely we want it to be possible to add a blacklist entry for a hitherto unhandled vendor to the file at a user site without having to modify the parsing code and rebuilding LO. Change-Id: I01ca45cb91df06e1634a565b3e469fb85fe4e116
2016-05-31tdf#100159: Remove (harmless) duplicate callTor Lillqvist
Change-Id: I3a836f5d401aaf93154182e6ed195dbc82fc058e
2016-05-31tdf#100159: Use shader preambles as needed, add missing shader combinationsTor Lillqvist
Some shaders are in some cases (or always?) compiled with a preamble, so add that then as applicable when compiling and caching them in advance. Add a few shader combinations that I hadn't noticed. Change-Id: Ib66027e03a36cd4b161fe9f57ceaa338f9fb042d
2016-05-31It is EXITHELPER_NORMAL_RESTART that we wantTor Lillqvist
Change-Id: Ica1d68dcdd98aef061a2bed0b5389cef327e1ca5
2016-05-30On Windows, compile OpenGL shaders in advance and disable on failureTor Lillqvist
If the shader compilation or loading of an already compiled shader fails, disable OpenGL in the registry and exit with the EXITHELPER_CRASH_WITH_RESTART status. The wrapper process will thus run soffice.bin once more, and this time OpenGL will not be used. Change-Id: I3cc4a615f00a8a1adb584493861e4956c83cec32
2016-05-25this temporary window will never see key inputMarkus Mohrhard
Change-Id: I89942224b708565d098702a85ea841c2736dff40 Reviewed-on: https://gerrit.libreoffice.org/25437 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-05-25Convert XmlReader::Result to scoped enumNoel Grandin
Change-Id: I6a0d1dcf5ae51d2ac08aacdfec50865f93e51c21 Reviewed-on: https://gerrit.libreoffice.org/25365 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-25Mark dubious fallthrough cases as "SAL_FALLTHROUGH; //TODO ???" (in Win-only)Stephan Bergmann
Change-Id: If5ee201aab8c4451971a11ea7d7ff943c9a1a726
2016-05-25-Werror,-Winconsistent-missing-overrideStephan Bergmann
Change-Id: I15a8399d120450b01bd35c7ad974d3af749811ad
2016-05-25Missing includeStephan Bergmann
Change-Id: I11a004458ac90db92f4bf9e54827b6727c5cbc67
2016-05-24Convert XmlReader::Text to scoped enumNoel Grandin
Change-Id: I4741b13fcf887a95b85886cb41f8236e128e81a2 Reviewed-on: https://gerrit.libreoffice.org/25364 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-21split GLWindow into platform dependent parts and move to respective backendsCaolán McNamara
Change-Id: I636d9bdac907000e4089aebdc5548ea89ec58083 Reviewed-on: https://gerrit.libreoffice.org/25252 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-05-21Split OpenGLContext up into SalInstance specific classesCaolán McNamara
which, at least theoretically, allows there to be vclplug specific ones. i.e. a gtk3 specific one which doesn't assume gtk3 is running under X Change-Id: I6c007a87abbd3049b6fffc70d349e3b7ac445eec