summaryrefslogtreecommitdiff
path: root/vcl/opengl
AgeCommit message (Collapse)Author
2019-12-05loplugin:external (clang-cl)Stephan Bergmann
...plus loplugin:consttobool and loplugin:fakebool fallout Change-Id: Ie3d8121815c080b13bea6d9deca1eb138ca56138 Reviewed-on: https://gerrit.libreoffice.org/84515 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-05Fix typoAndrea Gelmini
Change-Id: I95bdcf6ad6c7f6dc9e4772d20f941c332e778b80 Reviewed-on: https://gerrit.libreoffice.org/84495 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-11-27implement Skia native controls drawing/caching for WindowsLuboš Luňák
This actually fixes a number of drawing problems (e.g. highlight in popup menus), it seems the other code path is buggy. Change-Id: Iea697f577d08d20e338224d5ff5b3bf7b653f8d1
2019-11-27fix Skia Windows text renderingLuboš Luňák
There are two cases in WinSalGraphics::DrawTextLayout(), with and without cached glyphs: - Cached case DeferredTextDraw() gets data as BGRA with the glyph drawn in white, it just needs to be modulated to the proper color and drawn. - Uncached case DrawTextMask() gets data as BGRA with A invalid, it must be used as mask for the color to drawn, but without the inverse alpha VCL idiosyncracy that DrawMask() handles. Change-Id: I05dcec994df68d5986cd85cffa42a8f9f23c42c4
2019-11-27reimplement supportsOperation() for Skia and OpenGLLuboš Luňák
The shared X11 implementation depends on XRender, which doesn't make any sense. Change-Id: I82f36e0835a993a8b226af211d8635336960d7ec
2019-11-27implement pruning in SkiaGlobalWinGlyphCacheLuboš Luňák
Currently based on identifying the SkBitmap's by their getPixels(), but this may need changed later since it's probably going to be more performant to use SkSurface. Also move the cache pruning out of AllocateTexture(), as that may possibly remove elements that would be used by DrawCachedGlyphs(). Change-Id: Ide2de752f634593b97573667af49b7aa9ec1f47f
2019-11-27refactor Windows OpenGLGlyphCache stuff to be reusable for SkiaLuboš Luňák
Basically just remove 'OpenGL' from names of most of the classes, turn them into base classes that have OpenGL subclasses that actually implement the functionality. Change-Id: Idf1f347cebc2a417bda37d6955201c775ecb0890
2019-11-27Skia alpha handling improvementsLuboš Luňák
CppunitTest_vcl_bitmap_render_test now passes. Change-Id: I88863c63de84f28b5dfeeaf73d3879bc7cbba1b2
2019-11-27move opengl's code for converting 1,2,4bpp to 24bppLuboš Luňák
To be reused by the Skia code. Change-Id: If3befdbd86d98a2d931c7a366c47be57a0ae6c59
2019-11-27move opengl vcl files to opengl/Luboš Luňák
Better to have all of them together rather than scattered. Change-Id: I1f8bbfb7018a6c28c87e4dfa2acbf4efde62894b
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-08loplugin:stringadd (clang-cl)Stephan Bergmann
Change-Id: Icf2894f77c90aa4620910d621249947bad4be8b7 Reviewed-on: https://gerrit.libreoffice.org/82269 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-02tdf#128441: blacklist nvidia on Win10 deviceid 0x2182Julien Nabet
Change-Id: I033da69ee4f001f7dd2546822626fb2777dd040f Reviewed-on: https://gerrit.libreoffice.org/81943 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-10-24no-op in SalBitmap::ConvertToGreyscale() is also a successLuboš Luňák
Change-Id: I6bf3378c89c630aee0a890ac2807a31ea040cd52 Reviewed-on: https://gerrit.libreoffice.org/81374 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-10-06convert equals() to operator== in xmlreader::SpanNoel Grandin
Change-Id: Ic6a8eae344c06be87e2bc4bf7f242a2d18ebc8ad Reviewed-on: https://gerrit.libreoffice.org/80312 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-04loplugin:unusedmethodsNoel Grandin
Change-Id: Idd98dc9e1090a6b09124c80eed5a878e5e966cfc Reviewed-on: https://gerrit.libreoffice.org/80182 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-03loplugin:unusedmethodsNoel Grandin
Change-Id: I9790d053248ae6bd58ecc026c774014c4e5e04aa Reviewed-on: https://gerrit.libreoffice.org/80115 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-02Refactoring of the class CrashReporterJuergen Funk
- remove double code - using of all the methode of the CrashReporter-Class - all methode only active when crash-dump enable except the addKeyValue With this change the handling for the patch tdf#127711 A runtime-switch for the MiniCrashDump would be simpler Change-Id: I339b3b8e06f7fc2cd3c0d34ece112a6fd352913a Reviewed-on: https://gerrit.libreoffice.org/79272 Tested-by: Jenkins Reviewed-by: Juergen Funk (CIB) <juergen.funk_ml@cib.de>
2019-10-01don't suggest gtk SAL_USE_VCLPLUGIN env variableCaolán McNamara
Change-Id: I069fc594c32d2f1ea7fe4cc04be00a9a574054f8 Reviewed-on: https://gerrit.libreoffice.org/79898 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-01crashreport: change addKeyValue to lower-case camelJuergen Funk
Change-Id: Ife5775d3a570da1fc2e4dd627456523705b64e1d Reviewed-on: https://gerrit.libreoffice.org/79601 Reviewed-by: Juergen Funk (CIB) <juergen.funk_ml@cib.de> Tested-by: Juergen Funk (CIB) <juergen.funk_ml@cib.de>
2019-09-26remove internal use of 16-bit packed formatsNoel Grandin
none of our supported hardware uses these any more Change-Id: Ic95d6df619a05df0bec1f5870596cb2bb3bcc6cb Reviewed-on: https://gerrit.libreoffice.org/79476 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-23Mark move ctors/assignments noexceptMike Kaganski
This should enable using move semantics where possible e.g. in standard containers. According to https://en.cppreference.com/w/cpp/language/move_constructor: To make strong exception guarantee possible, user-defined move constructors should not throw exceptions. For example, std::vector relies on std::move_if_noexcept to choose between move and copy when the elements need to be relocated. Change-Id: I6e1e1cdd5cd430b139ffa2fa7031fb0bb625decb Reviewed-on: https://gerrit.libreoffice.org/77957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-08-22loplugin:constmethod in vclNoel Grandin
Change-Id: I20545527b117c9562b91076b748fb3e2659d2497 Reviewed-on: https://gerrit.libreoffice.org/77944 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20loplugin:constvars in vclNoel Grandin
Change-Id: Ic454a4d9520992eaecef4b64ec73d49e52ffcc2c Reviewed-on: https://gerrit.libreoffice.org/77828 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-12Fix typosAndrea Gelmini
Change-Id: Idb183e0ee9cccf0e4da16ff984ccf9b57eea0f9e Reviewed-on: https://gerrit.libreoffice.org/77273 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-10Silence -Werror,-Wimplicit-int-float-conversionStephan Bergmann
> vcl/opengl/gdiimpl.cxx:2237:45: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-int-float-conversion] > glClearColor(static_cast<float>(rand())/RAND_MAX, static_cast<float>(rand())/RAND_MAX, > ~^~~~~~~~ etc. with Clang 10, by doing the division with double precision. Change-Id: Ide74d29eb07ea24ea7fb318bba7a2892251a40f7 Reviewed-on: https://gerrit.libreoffice.org/77240 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-09Fix typosAndrea Gelmini
Change-Id: I545154bddfd29194630d744b4aa4f5c385321531 Reviewed-on: https://gerrit.libreoffice.org/77138 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-30tdf#62699 Drop (now) pass-through header include/vcl/salbtype.hxxGabor Kelemen
Change-Id: I2e2093ac3c8c6833b70d4932bc12a82a4483bde5 Reviewed-on: https://gerrit.libreoffice.org/76499 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-07-20cid#1448247 Division or modulo by float zeroCaolán McNamara
Change-Id: I591ac0446494a8a8c4b3481bdf91e60de0c9ebe1 Reviewed-on: https://gerrit.libreoffice.org/76011 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-08Do not support GL blacklisting for Windows versions older than 7Gabor Kelemen
Since we no longer install on such systems anyway Change-Id: Ia3b5c202e1276857c97017bb5a7eb9f087d5626e Reviewed-on: https://gerrit.libreoffice.org/74961 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-13tdf#42949 Fix IWYU warnings in vcl/inc/*Gabor Kelemen
Platform-specific subdirs are left alone: android, ios, osx, quartz, win Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Icbb906b7fbc960240c73c56d3dae2a78b06a0f53 Reviewed-on: https://gerrit.libreoffice.org/73754 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
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>