summaryrefslogtreecommitdiff
path: root/vcl/opengl
AgeCommit message (Collapse)Author
2019-05-02tdf#115092: blacklist Intel(R) HD Graphics 530Xisco Fauli
Change-Id: I3fbe05ead88afcb725d7fdd91e4dd145be974d8f Reviewed-on: https://gerrit.libreoffice.org/71666 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-04-16fix areaScaleFragmentShader.glsl with texture atlas (tdf#105277)Luboš Luňák
With a texture atlas the "texture" is just a subtexture of a larger texture, so texture coordinates are not the full range between 0 and 1, but just a part of it. Since areaScaleFragmentShader converts between pixel and texture coordinates, the conversion needs to take this into account. Change-Id: I9d29ffea52551d19ba681971a2b4f140a35b491c Reviewed-on: https://gerrit.libreoffice.org/70774 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-04-16in dbgutil mode initialize texture contents with predictable garbageLuboš Luňák
So that textures do not start with random uninitialized contents. Change-Id: Ie240f5f71ed77d5c6c22a120e96540a2d0d7c2ed Reviewed-on: https://gerrit.libreoffice.org/70773 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-04-16make ConvertBGRABufferToBitmapEx work properly also on non-win32Luboš Luňák
Windows uses GL_BGRA, but e.g. on Linux OpenGL stores as GL_RGBA. Change-Id: I00820f7b7a16a54b10c682ba332627ec04648508 Reviewed-on: https://gerrit.libreoffice.org/70772 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-04-16round() instead of truncating in two-pass OpenGL area scalingLuboš Luňák
BitmapTest::testScale2() on Linux fails for me without this, as the two-pass setup higher truncates the size to integers, and truncating here again sets the final size as 64 instead of the expected 65 Change-Id: I54748e29f0e0ca63539e42009759a93d6a5d6be2 Reviewed-on: https://gerrit.libreoffice.org/70779 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-04-15restore code commentsLuboš Luňák
These got removed in d115a235bf3ff5366 for some reason. Change-Id: I27eadc7f9f874f420ab0273e0ef2b62af57f6c4a
2019-04-10clang-tidy: Silence warnings from WIP unhandled-self-assignment checkTamás Zolnai
Where it can be done by removing useless / duplicate code. For XFListStyle I removed the copy operator entirely, because it was bugous and it seems not to be used anyway. Change-Id: Iba0eb0d5c45b42f0e78be466c617acdc1216eb22 Reviewed-on: https://gerrit.libreoffice.org/70482 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-03-29tdf#107966 vcl opengl: fix not drawn 1px wide polypolygonsMiklos Vajna
Visible at e.g. in Calc: Format Cells/Borders/Line Styles. The problem was that first commit 2e99e4e11d33679aed674eea0d6054d16d39d6df (opengl: use MVP matrix in vertex shaders, pixel offsets, 2015-07-08) introduced the concept of pixel offsets, setting the value (implicitly) to 0 in OpenGLSalGraphicsImpl::DrawTrapezoid(), but using 0.5 in OpenGLSalGraphicsImpl::FlushLinesOrTriangles(). This is fine, but then later commit 2003076c4318511a3d621558d3b44b4e8e6c6529 (opengl: batch draw polypolygons, 2016-05-29) changed OpenGLSalGraphicsImpl::drawPolyPolygon() to use deferred drawing instead of DrawTrapezoid(), without doing any translation of the input polypolygon. This resulted in loss of those polygons when used in the above mentioned dialog, which has a listbox of bitmaps, where each line style preview is drawn on a virtual device with a height of 1px. So at the end the 1px offset meant the previews were simply missing. ('make CppunitTest_vcl_gen SAL_USE_VCLPLUGIN=gen SAL_FORCEGL=1' is needed on Linux to see the test failing without the fix.) Change-Id: Ia9f3d6e7cb38a43fe2f8a41746b538af68add43c Reviewed-on: https://gerrit.libreoffice.org/69920 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-03-28make OpenGLSalBitmap deallocate user data properlyLuboš Luňák
In OpenGLSalBitmap::AcquireBuffer(), if ReadTexture() failed, then the data from AllocateUserData() didn't get deallocated and a next call to OpenGLSalBitmap::AcquireBuffer() skipped the whole block because it assumed the data was valid. Triggered while fixing tdf#116888. Change-Id: Ibfe5c42d6b18748ca649d6b4242ef268c1b13a71 Reviewed-on: https://gerrit.libreoffice.org/69746 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-03-28make ReadTexture() also handle 8-bit non-grayscale images (tdf#116888)Luboš Luňák
The missing case caused BitmapReadAccess to work with random data (together with a follow-up bug that didn't deallocate data properly after ReadTexture() failed). Change-Id: I4546ee4ca85d6a0b01cc41636c257008c9f19587 Reviewed-on: https://gerrit.libreoffice.org/69745 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-03-22opengl's drawBitmap() should also scale properly if needed (tdf#123372)Luboš Luňák
If the bitmap to be drawn will need to be scale for drawing, OpenGL handles this by scaling, but the scaling is of poor quality. Other backends scale in such a case with a good quality, and e.g. opengl's drawAlphaBitmap() also does the same check, so copy that check to drawBitmap() as well. Change-Id: If6a457c69c6676d03fa4046b9910683f51479d21 Reviewed-on: https://gerrit.libreoffice.org/69556 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-21add missing else in an if-else chainLuboš Luňák
No functional change, but avoid the warning. Change-Id: Ia552c6199806a9e029800e9d65c0852baa370bd8 Reviewed-on: https://gerrit.libreoffice.org/69270 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-03-14Fix scheduled Task priority change handlingJan-Marek Glogowski
If a task is still in the scheduler priority queue and its priority is changed, it won't be moved into the correct queue. We have to track the priority of the scheduled task, so we can warn the developer to fix the code and actually handle re-start correctly. Since we don't want to traverse the whole Scheduler queues on priority change (which sometimes get very long) to remove the wrong data item, we'll just invalidate it, if a priority change is detected. This also reverts commit d24b264c4a47 ("vcl opengl: avoid task priority warning on cursor blink"), which tried to avoid the warning, which was just half right and independent of the broken priority change handling. LO doesn't change priorities of scheduled tasks normally, so that bug didn't turn out to have much impact, I guess. Change-Id: I6e46b518a7c3532047c619c013bd8597f73ed7a6 Reviewed-on: https://gerrit.libreoffice.org/69249 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-03-08tdf#121120 vcl opengl: handle 8-bit palette bitmap as 24 bit RGB textureMiklos Vajna
This fixes the black rectangle instead of actual image content in the bugdoc. An alternative would be to handle this in the PNG import, but commit 66dbd4da3afcadb1393daf9be9cecff71b86509a (tdf#113918: Workaround: Load 1bpp indexed PNG as 8bpp indexed Bitmap, 2017-11-20) already tried something similar and failed, leading to the revert in commit 25cd843664919974f0d21ca7a0b02cc43e9eeabb (tdf#115297: alternative fix for displaying 1bit images, 2018-02-27). The test is especially useful with SAL_FORCEGL=1 SAL_USE_VCLPLUGIN=gen specified on Linux, so the GL codepath is triggered. Change-Id: Ia9d049d09dce2ac34826ee427f74616a96a35c88 Reviewed-on: https://gerrit.libreoffice.org/68925 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-03-08vcl opengl: avoid task priority warning on cursor blinkMiklos Vajna
warn:vcl.schedule:22358:22358:include/vcl/task.hxx:107: Priority will just change after next schedule! Just don't set the priority if it's already set to the correct value, so we can avoid a warning each time the visible cursor is shown or hidden. Change-Id: Ie11164db0af4cfba06a620c9b2426cb903af3887 Reviewed-on: https://gerrit.libreoffice.org/68907 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-02-26sal_uLong->sal_uInt32 in drawEPSNoel Grandin
Change-Id: I58beedfee1a55df971e778ba2aa3b6989ba53663 Reviewed-on: https://gerrit.libreoffice.org/68341 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-08o3tl::make_unique -> std::make_unique in tools..xmloffGabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: Ib3201f865d43f372007cdf381c7e244e9cbeae26 Reviewed-on: https://gerrit.libreoffice.org/67474 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-07tdf#42949 Fix IWYU warnings in include/vcl/[v-x]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I98f49765c6b74808dcbd692e0f375dd2848fcfd4 Reviewed-on: https://gerrit.libreoffice.org/65614 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-12-05tdf#121719: Revert fix for tdf#96971Xisco Fauli
it's still used on Mac. Revert it until XOL is removed This reverts 258301879bcd20397c38bbd522dea2c923bd9fc2 Change-Id: I06548a590f370618ad640724a1b9c59a3faceec2 Reviewed-on: https://gerrit.libreoffice.org/64582 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29remove unnecessary "if (!empty()" checks before loopsNoel Grandin
found with git grep -n -A4 'if.*!.*empty' | grep -B3 -P '(\bfor)|(\bwhile)|(\bdo)' Change-Id: I582235b7cf977a0f9fb4099eb306fdb4a07b5334 Reviewed-on: https://gerrit.libreoffice.org/64169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-23improve function local staticsNoel Grandin
simplify the initialisaion and make them thread-safe i.e. initialise them using the runtime's local static locking. Thanks to mike kaganski for pointing out the nice lambda approach that makes this feasible. Change-Id: I76391189a6d0a3d7eed2d0d88d28dfa6541eaff7 Reviewed-on: https://gerrit.libreoffice.org/63645 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-21loplugin:redundantfcast improvementsNoel Grandin
check for calls to constructors, and extend the list of types we check for unnecessary temporary creation Change-Id: Ia2c1f202b41ed6866779fff5343c821128033eec Reviewed-on: https://gerrit.libreoffice.org/63472 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-19tdf#42949 Fix IWYU warnings in include/vcl/[ab]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: If18c80fc64e55d797953e24e40e5d5e62bd9c625 Reviewed-on: https://gerrit.libreoffice.org/63453 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-05Fix for --enable-debug --disable-assert-always-abortStephan Bergmann
...found by <https://ci.libreoffice.org//job/lo_tb_random_config_linux/1573/> Change-Id: I805457f4da6d91a1ee27b0e4da999448950ecf40 Reviewed-on: https://gerrit.libreoffice.org/62875 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-30tdf#119020 always scale icons as 24bit RGBJan-Marek Glogowski
We don't really care for the palette or even lower bitness of the original icons, when scaling them. So just convert them to 24bit to get the best scaling quality. And also actually fail the OpenGL scaling for 8bit color icons, instead of handling them as a grayscale image, which results in "funny" luminance based color icons. Change-Id: I62ff9e7cd45dbffba81b0db5a0252737b6189059 Reviewed-on: https://gerrit.libreoffice.org/62505 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-10-24remove more rtl::OUString and OString prefixesNoel Grandin
which seem to have snuck back in since the great rounds of removals. Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1 Reviewed-on: https://gerrit.libreoffice.org/62229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-21pvs-studio: V501 same expression twiceCaolán McNamara
Change-Id: I3a2585c605ba9cb83f47fafc93653b36ab4104fc Reviewed-on: https://gerrit.libreoffice.org/62135 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-21pvs-studio: silence bogus V557Caolán McNamara
Change-Id: I5aa740afa1143adaf4e2afa5d5e1596497de8323 Reviewed-on: https://gerrit.libreoffice.org/62112 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17clang-tidy readability-redundant-smartptr-getNoel Grandin
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-15loplugin:constantparamNoel Grandin
Change-Id: I895ceffa468d84d22e4a81b7a6b06eaed0bd839d Reviewed-on: https://gerrit.libreoffice.org/61776 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-24loplugin:external (clang-cl)Stephan Bergmann
Including: * expanding STDAPI to its definition (as per <https://msdn.microsoft.com/library/ms686631(vs.85).aspx> "STDAPI"), to add __declspec(dllexport) into its middle, in extensions/source/activex/so_activex.cxx; as discussed in the comments at <https://gerrit.libreoffice.org/#/c/60691/> "Get rid of Windows .def files in setup_native, use __declspec(dllexport)", having a function both listed in a .def file EXPORTS and marking it dllexport is OK, and the latter helps the heuristics of loplugin:external; however, the relevant functions in extensions/source/activex/so_activex.cxx probably don't even need to be exported in the first place? * follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191 Reviewed-on: https://gerrit.libreoffice.org/60938 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-17loplugin:staticconstfield improvementsNoel Grandin
Change-Id: Ia0a19736dfd4500bb17b04c072710f8ee8744031 Reviewed-on: https://gerrit.libreoffice.org/60526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-14loplugin:constfields in vclNoel Grandin
Change-Id: I1072642be4fdfa720e61f2d7bad3c2701eb81610 Reviewed-on: https://gerrit.libreoffice.org/60430 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-13Support buffering SystemDependent GraphicData (II)Armin Le Grand
In this step I have changed all calls that use a B2DPolyPolygon and do filled graphics, added support for providing needed transformation which will -if supported- be used. Added buffering of SystemDependentData at B2DPolyPolygon for that purpose, see comments describing the current possibilities in the Gdiplus implementation. Moved lifetime creation/cleanup of SystemDependentDataManager to ImplSVData due to cleanup problems in the clang build Tried to use a std::unique_ptr to hold the instance of a SystemDependentDataBuffer at ImplSVData and cleanup inside DeInitVCL() right before ::ImplDeInitScheduler. This works in principle, but scheduler shutdown triggers ProcessEventsToIdle which leads to repaints and re-creates the buffer. Will now do exactly as was done with GdiPlusBuffer before, a simple local static incarnation and a call to SetStatic() in constructor Splitted SystemDependentDataBuffer and Timer due to different LifeTimes. Timer needs to be destructed earlier than SystemDependentDataBuffer, before Scheduler::ImplDeInitScheduler() is called from DeInitVCL() Change-Id: I2134e4346a183a4cee1be3428c51541cc8867c11 Reviewed-on: https://gerrit.libreoffice.org/60102 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-09-12loplugin:simplifyconstruct in ucbhelper..vclNoel Grandin
Change-Id: Id435bb3289dcfd9a7aeca6a661e249085958cb7c Reviewed-on: https://gerrit.libreoffice.org/60392 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-07Fix some std::unique_ptr array allocsJan-Marek Glogowski
Found by reviewing the output of and the code around git grep -n "unique_ptr.*new.*\[.*\]" | grep -v "\[\]" The onlineupdater code needs a little bit more attention. Change-Id: I8b70c7da7db60af52bfac12314a21602ede8bfc0 Reviewed-on: https://gerrit.libreoffice.org/60162 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-09-06clang-tidy performance-unnecessary-value-paramNoel Grandin
Change-Id: I69247498e13331f6ef84afeb242479f8fb1178a8 Reviewed-on: https://gerrit.libreoffice.org/60068 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-30Support buffering SystemDependent GraphicDataArmin Le Grand
This is a first step to allow buffering of system dependent data, especially (but not only) for the system-dependent implementations of graphic output. For example, for B2DPolygon and Win output, it allows buffering the Gdiplus::GraphicsPath instead of re- creating it all the time. To support that, the change includes forwarding the current transformation to the renderers in SalGraphics. The current state in VCL is to transform all and everything to device coordinates at every single paint. I have currently started to do this for ::drawPolyLine implementations. The fallbacks for all systems will at the start of that method just transform the data to device coordinates, so all works as before. This may also be done for FilledPolygon paint in a later step, but most urgent is FatLine painting. An arrangement of shared_ptr/weak_ptr is used so that either the instance buffering (in the example B2DPolygon) or the instance managing it can delete it. The instance managing it currently uses a 1s Timer and a cycle-lifetime management, but that can be extended in the future to e.g. include size hints, too. The mechanism it designed to support multiple Data per buffering element, e.g. for B2DPolygon at the same time system-dependent instances of Gdiplus and Cairo can be buffered, but also PDF-data. This is achieved semi-automatic by using typeid(class).hash_code() as key for organization. The mechanism will be used for now at B2DPolygon, but is not limited to. There is already a similar but less general buffer (see GdiPlusBuffer) that can and will be converted to use this new mechanism. Added vcl/headless Cairo renderer to support given ObjectToDevice transformation (not to transform given B2DPolygon) Added support for CairoPath buffered at B2DPolygon, seems to work well. Need to do more tests Moved usage to templates suggested by Noel Grandin (Noel Grandin <noelgrandin@gmail.com>), thanks for these suggestions. Adapted Win usage to that, too. Converted Win-specific GdiPlus BitmapBuffer to new mechanism, works well. Checked, the manager holds now a mix of bitmap and path data under Win Added a cleanup mechanism to flush all buffered data at DeInitVCL() using flushAll() at SystemDependentDataBuffer Adapted Linux-versions of ::drawPolyLine to support PixelSnapHairline, for now in a simplified version that still allows buffering. This will also be used (and use buffering) for the Cairo-fallback in X11SalGraphics Change-Id: I88d7e438a20b96ddab7707050893bdd590c098c7 Reviewed-on: https://gerrit.libreoffice.org/59555 Tested-by: Armin Le Grand <Armin.Le.Grand@cib.de> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-08-29loplugin:constantparam (3)Noel Grandin
Change-Id: Ifc47bb8e096c9a8563021b2fcb44199577740746 Reviewed-on: https://gerrit.libreoffice.org/59747 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-22pass X11SalGraphics around by std::unique_ptrNoel Grandin
Change-Id: Id2fcf829e3ca0edcfcdd3d4daf31188ae5317b27 Reviewed-on: https://gerrit.libreoffice.org/59427 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-19tdf#112166 need to check if glXCreateContextAttribsARB really existsCaolán McNamara
checking the glXCreateContextAttribsARB function pointer will just return the epoxy_glXCreateContextAttribsARB stub which always exists. Change-Id: I740cc680082102c1f9712cf5cc083e92b26f8865 Reviewed-on: https://gerrit.libreoffice.org/59300 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-13Fix typosAndrea Gelmini
Change-Id: I0bcdff1d355f374e9922cf3f318a88f01af86f4f Reviewed-on: https://gerrit.libreoffice.org/58929 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2018-08-13vcl opengl windows: fix error handling in tryShaders()Miklos Vajna
Both of my GPUs failed to start with GL enabled in an enable-symbols build, but they were fine in a dbgutil build. It seems the problem was that in case CHECK_GL_ERROR() expands to an error reporting code, then we already correctly checked the error of the last GL call at the end of tryShaders() -- but in case it expanded to nothing, then previous (unrelated) errors signaled that shader compilation went wrong, even if it did not. Given that we have error handling right before glDeleteProgram(), clear the GL error queue before calling glDeleteProgram(). Change-Id: If58188d06a0b7009a71af82c476b5aa77823d9b0 Reviewed-on: https://gerrit.libreoffice.org/58852 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-04Use more basegfx deg<->rad functions, instead of direct formulasMike Kaganski
Also make the functions constexpr. Due to slight changes in floating-point arithmetics (90.0 instead of 180.0, M_PI2 instead of M_PI resp.), results might differ in last digits (usually 17th decimal digit). This has lead to need to tweak char2dump's PieChartTest unit test. Change-Id: I20323dd7dab27e4deb408ea4181e390cc05e7cd3 Reviewed-on: https://gerrit.libreoffice.org/58583 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-07-31Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directory vcl Change-Id: I205fe0f4e80a66cd9c3b19f7e9716411da1d1cf5 Reviewed-on: https://gerrit.libreoffice.org/58221 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-27loplugin:returnconstant in vclNoel Grandin
Change-Id: I597ef6d75d1c21cdc15a91bf7f549bc14c851506 Reviewed-on: https://gerrit.libreoffice.org/58086 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-26tdf#118860 svx opengl: avoid SalBitmap creation without solar mutexMiklos Vajna
The bugdoc has 2 slides. When switching to the second slide, the graphic is loaded in the background, but OpenGLSalBitmap::Create() can't work correctly if the caller doesn't own the solar mutex. This already asserts in OpenGLContext::prepareForYield() in a less obvious way. Focus on the correctness, so just hold the solar mutex during the whole ImportGrpahic() call. If it turns out that the purpose of running this on a thread is to avoid synchronous network traffic, then the data could be first copied to a memory stream, and only then take the lock + import the graphic. Change-Id: I88203c12b4e7a5f2b689928c01e2ba953c5b13c5 Reviewed-on: https://gerrit.libreoffice.org/57970 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2018-07-23Fix typosAndrea Gelmini
Change-Id: If0d8f4033d9bc20f521d33d732fb349f0df5eeef Reviewed-on: https://gerrit.libreoffice.org/57822 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins