/touch/

ce-5-1 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap/BitmapInfoAccess.cxx
AgeCommit message (Collapse)Author
2023-12-07simplify and modernise ScopedBitmapAccessNoel Grandin
(*) Make all of it use a "Scoped" paradigm (*) pass by value, no need to allocate on heap (*) make all of the construction go via the *Access constructors, instead of it being some via the constructors and some via the Acquire*Access methods. (*) take the Bitmap& by const& in the constructor, so we can avoid doing const_cast in random places. Change-Id: Ie03a9145c0965980ee8df9a89b8714a425e18f74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160293 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-06Remove the special-casing in Bitmap::Invert (and fix)Noel Grandin
and rather rely on the backends doing the right thing, which is considerably faster. Which uncovers a bug in the existing code - it is not legal to simply invert the value when dealing with palette-based images. Fix this by sharing some code with Bitmap::ReplaceMask. Change-Id: I2ef340a9f251c8c7e27b68ab451ce85df07c1035 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160332 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-10crashtesting: threaded scaling crash on re-export of ooo24840-1.sxw to odtCaolán McNamara
#13 0x00007f1cb843752a in o3tl::cow_wrapper<ImplBitmapPalette, o3tl::UnsafeRefCountingPolicy>::operator->() (this=0x5596086d5968) at include/o3tl/cow_wrapper.hxx:329 __PRETTY_FUNCTION__ = "BitmapColor& BitmapPalette::operator[](sal_uInt16)" #14 0x00007f1cb843752a in BitmapPalette::operator[](unsigned short) (this=0x5596086d5968, nIndex=nIndex@entry=0) at vcl/source/bitmap/bitmappalette.cxx:139 __PRETTY_FUNCTION__ = "BitmapColor& BitmapPalette::operator[](sal_uInt16)" #15 0x00007f1cb849f5f5 in BitmapInfoAccess::GetPaletteColor(unsigned short) const (nColor=0, this=0x5596085989f0) at include/vcl/BitmapInfoAccess.hxx:114 __PRETTY_FUNCTION__ = "const BitmapColor& BitmapInfoAccess::GetPaletteColor(sal_uInt16) const" the mpBuffer member of BitmapInfoAccess is BitmapBuffer* mpBuffer; not const BitmapBuffer* mpBuffer; so mpBuffer->maPalette.foo() calls non-const variants of foo(), (BitmapPalette::operator[](unsigned short) in this case), which is presumably non the expected outcome, as the copy-on-write mpImpl of BitmapPalette unsafely creates a new copy its internals on the first dereference of mpImpl in a non-const method. Change-Id: I1ebb3c67386a9028e5b8bab4b2d1cc5862700aa1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121910 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-06vcl: use PixelFormat enum in SalBitmap interface and backendsTomaž Vajngerl
This changes all backends to use PixelFormat as the input to the SalBitmap::Create method (and all the backends). This is the first part as we need to make sure to also limit the use of GetBitCount method and also use of it in SalGraphics. Change-Id: I8d2b6adfcb8fe3dd78010538411f338c9a1c3996 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113603 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-04-02vcl: remove GetBitCount and GetColorCount from Bitmap{Ex}Tomaž Vajngerl
We can cast the PixelFormat enum to int for the same information and we can use the enum to reduce ambiguity when possible. Change-Id: I6ea648139465568cdeb12e5f5f75c7b609365bf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113188 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-12-24vcl: move access functions into appropriate bitmap access filesChris Sherlock
Split class functions into BitmapInfoAccess.cxx, BitmapReadAccess.cxx and BitmapWriteAccess.cxx Split header files into BitmapInfoAccess.hxx and BitmapReadAccess.hxx Change-Id: I7dcbe1d26c5b64d297658a6b809c93d7ad7f053d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108039 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>