summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap/bitmap.cxx
AgeCommit message (Collapse)Author
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-06-29tdf#125873 Selected border color preview isn't shownNoel Grandin
Regression from commit 319c57d2af5d26d3910db4b02dca145d8881af tdf#120837 File saving at least 5 times slower which made BitmapEx::operator== rely more heavily on Bitmap::operator==, which in turn relies on the platform-specific SalBitmap subclass to calculate a checksum, which was not happening with WinSalBitmap. Consequently, make Bitmap::operator== more robust by returning false if either of the underlying bitmaps cannot generate a checksum Change-Id: Iad8a4ce19544839a6303f0e8d006b138c2d75a31 Reviewed-on: https://gerrit.libreoffice.org/74834 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-03Support for native 32bit Bitmap in VCL and SVP (cairo) backendTomaž Vajngerl
This adds basic support for 32bit bitmaps for the SVP backend. For other backends the support is disabled for now as we need to add it for each backend separately and enable support. When this patch is applied it is possible to a Bitmap with bit count 32, but currently no input filter uses this with the exception of the new PngImageReader(libpng based), which is used only for the icons. For a general support more things need to be implemented and tested: - conversion back and fourth between 32-bit and 24-bit + 8bit alpha (or other supported pairs) - 'raw' export of the bitmap needs to be handeled properly (like in SVM import/export) so it creates the correct image. - input filters need to be checked and converted if this is necessary - look for possible bugs when drawing transparent bitmaps - check of UNO API Change-Id: I7a7be0e6134dfdd9a7aeaef897131bb6e710ae7e Reviewed-on: https://gerrit.libreoffice.org/69289 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-12-19Removed useless semicolonsAndrea Gelmini
Change-Id: I6efd221e71020030ae5b8ac8800f72e42b13aa28 Reviewed-on: https://gerrit.libreoffice.org/65390 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-12-11loplugin:useuniqueptr in vclNoel Grandin
Change-Id: I24eca813321fd3919bba9d37c285484f865ea2ea Reviewed-on: https://gerrit.libreoffice.org/64877 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-10tdf#42949 Fix IWYU warnings in include/vcl/s*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ie87d27dd2c385a63349e0b322fd067ba03d2d152 Reviewed-on: https://gerrit.libreoffice.org/64479 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-11tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski
Change-Id: I1027242192dfd2be4918094d59f2a8f8c8fec041 Reviewed-on: https://gerrit.libreoffice.org/63266 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-03tdf#120703 PVS: V547 Expression is always true/falseMike Kaganski
Change-Id: I856345576ff5c10a41509a97ad4539272bd55568 Reviewed-on: https://gerrit.libreoffice.org/62803 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-09-09Revert "clang-tidy performance-move-const-arg"Noel Grandin
This reverts commit 3d604d1cd6cc70ef96782ef769f0479b509987a8. comments from sberg: I assume dropping the std::move from aCurSel(std::move(aSel)) is caused by performance-move-const-arg's warning "if std::move() is called with an argument of a trivially-copyable type" (<https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html>). For my taste, that approach is too tightly tied to a class's current implementation details, something that may change over time. Imagine a trivially copyable class C with a raw pointer member (where the lifecycle of the pointed-to object is tracked by some higher-level, likely broken protocol). Now, that protocol is fixed and the raw pointer member is replaced with a std::shared_ptr. C is no longer trivially copyable, and the dropped std::move would turn out to be beneficial again. (Also, if Clang and clang-tidy did implement the fixed rules for trivially copyable classes from CWG1734/C++17, where a subset of a trivially copyable class's copy/move members may be deleted, the above rule to warn "if std::move() is called with an argument of a trivially-copyable type" would no longer make sense as written; consider a trivially copyable class whose copy ctor has been deleted.) Change-Id: Icb91610e50ed98b8f55fe6323bdfa48c8cb9b4b9 Reviewed-on: https://gerrit.libreoffice.org/60166 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06clang-tidy performance-move-const-argNoel Grandin
Change-Id: I607891e120688b746c8a4c577018d97147a79217 Reviewed-on: https://gerrit.libreoffice.org/60029 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-14return SalBitmap using std::shared_ptrNoel Grandin
since we hold it like that in Bitmap anyway Change-Id: I6264dfaaae6210cb008df5db8a421fc80c508f5b Reviewed-on: https://gerrit.libreoffice.org/55458 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-13vcl: move Bitmap::MakeMonochrome() to BitmapMonochromeFilterChris Sherlock
Change-Id: Iefe5be4349475a4aa0138534cf6bfe87ff7df245 Reviewed-on: https://gerrit.libreoffice.org/53280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-04-17remove ImpBitmapNoel Grandin
it's not adding anything useful, just hold the underlying SalBitmap instead Change-Id: I54852707b2f8af99283b9c882a428a8a7a11c4cf Reviewed-on: https://gerrit.libreoffice.org/52955 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-17move the ImpBitmap::GetBitCount logic up to BitmapNoel Grandin
in preparation for removing ImpBitmap Change-Id: I1ca76c645a8e988f6cd9be8a01b0d2853f6d6750 Reviewed-on: https://gerrit.libreoffice.org/53014 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-16rename ImpBitmap methodsNoel Grandin
to match underlying SalBitmap methods, in preparation for getting rid of ImpBitmap Change-Id: I14200ef53b1fdb8c1fa94d7d09319187cdfb3996 Reviewed-on: https://gerrit.libreoffice.org/52949 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-05vcl: ImplAssignWithSize() -> ReassignWithSize()Chris Sherlock
Change-Id: I278a976028762f5c101dfd46ee62c4aa06bd719d Reviewed-on: https://gerrit.libreoffice.org/52422 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-03-15move Bitmap::ScopedWriteAccess inside vclNoel Grandin
would have liked to make the AcquireWriteAccess methods DLLPRIVATE, but they are needed by the workbench and testing code Change-Id: I22497788eb68dfb84b7e542e5ef53322892a5274 Reviewed-on: https://gerrit.libreoffice.org/51310 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-06vcl: split painting bitmap functions to bitmappaint.cxxChris Sherlock
Change-Id: Ib5f52e4b7b5121de15cdb205165fcbdb8b09bc8a Reviewed-on: https://gerrit.libreoffice.org/50530 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-03-05vcl: move vcl/source/gdi/bitmap.cxx to vcl/source/bitmap/bitmap.cxxChris Sherlock
Change-Id: Ib74ac5016b6f99adef41b6ee562701b5158cffd3 Reviewed-on: https://gerrit.libreoffice.org/50532 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>