diff options
-rw-r--r-- | basebmp/source/bitmapdevice.cxx | 9 | ||||
-rw-r--r-- | basebmp/source/debug.cxx | 2 | ||||
-rw-r--r-- | include/basebmp/rgbmaskpixelformats.hxx | 13 | ||||
-rw-r--r-- | include/basebmp/scanlineformats.hxx | 6 |
4 files changed, 26 insertions, 4 deletions
diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx index 34cf2c882ff8..60ad322fc1cb 100644 --- a/basebmp/source/bitmapdevice.cxx +++ b/basebmp/source/bitmapdevice.cxx @@ -107,6 +107,7 @@ static const sal_uInt8 bitsPerPixel[] = 16, // SIXTEEN_BIT_LSB_TC_MASK 16, // SIXTEEN_BIT_MSB_TC_MASK 24, // TWENTYFOUR_BIT_TC_MASK + 32, // TWENTYFOUR_BIT_TC_MASK_BGRU 32, // THIRTYTWO_BIT_TC_MASK_BGRA 32, // THIRTYTWO_BIT_TC_MASK_ARGB 32, // THIRTYTWO_BIT_TC_MASK_ABGR @@ -2076,15 +2077,17 @@ BitmapDeviceSharedPtr createBitmapDeviceImplInner( const basegfx::B2IVector& aBounds, rSize, nScanlineFormat, nScanlineStride, pFirstScanline, pMem, pPal, rDamage ); - - // twentyfour bit formats case FORMAT_TWENTYFOUR_BIT_TC_MASK: return createRenderer<PixelFormatTraits_BGR24,StdMasks>( aBounds, rSize, nScanlineFormat, nScanlineStride, pFirstScanline, pMem, pPal, rDamage ); - + // hybrid cairo 24bits used out of 32bit format + case FORMAT_THIRTYTWO_BIT_TC_MASK_BGRU: + return createRenderer<PixelFormatTraits_BGRU32_8888,StdMasks>( + aBounds, rSize, nScanlineFormat, nScanlineStride, + pFirstScanline, pMem, pPal, rDamage ); // thirtytwo bit formats diff --git a/basebmp/source/debug.cxx b/basebmp/source/debug.cxx index d8348ffd379b..3e719cd77825 100644 --- a/basebmp/source/debug.cxx +++ b/basebmp/source/debug.cxx @@ -63,6 +63,8 @@ namespace basebmp return "SIXTEEN_BIT_MSB_TC_MASK"; case FORMAT_TWENTYFOUR_BIT_TC_MASK: return "TWENTYFOUR_BIT_TC_MASK"; + case FORMAT_THIRTYTWO_BIT_TC_MASK_BGRU: + return "THIRTYTWO_BIT_TC_MASK_BGRU"; case FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA: return "THIRTYTWO_BIT_TC_MASK_BGRA"; case FORMAT_THIRTYTWO_BIT_TC_MASK_ARGB: diff --git a/include/basebmp/rgbmaskpixelformats.hxx b/include/basebmp/rgbmaskpixelformats.hxx index 696f35aac846..eaee275554c2 100644 --- a/include/basebmp/rgbmaskpixelformats.hxx +++ b/include/basebmp/rgbmaskpixelformats.hxx @@ -334,6 +334,19 @@ typedef PixelFormatTraitsTemplate_RGBMask< BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_RGBX32_8888::getter_type, PixelFormatTraits_RGBX32_8888::setter_type); +// The following hybrid 24bits used out of 32bit was added for Cairo needs + +typedef PixelFormatTraitsTemplate_RGBMask< + sal_uInt32, + 0x00000000, + 0x00FF0000, + 0x0000FF00, + 0x000000FF, + BASEBMP_TRUECOLORMASK_LSB_SWAP > PixelFormatTraits_BGRU32_8888; +BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_BGRU32_8888::getter_type, + PixelFormatTraits_BGRU32_8888::setter_type); + + } // namespace basebmp #endif /* INCLUDED_BASEBMP_RGBMASKPIXELFORMATS_HXX */ diff --git a/include/basebmp/scanlineformats.hxx b/include/basebmp/scanlineformats.hxx index a5a88aa5d19c..80278792241a 100644 --- a/include/basebmp/scanlineformats.hxx +++ b/include/basebmp/scanlineformats.hxx @@ -42,8 +42,12 @@ enum Format FORMAT_SIXTEEN_BIT_LSB_TC_MASK, FORMAT_SIXTEEN_BIT_MSB_TC_MASK, FORMAT_TWENTYFOUR_BIT_TC_MASK, + // CAIRO_FORMAT_RGB24, each pixel is a 32-bit quantity, with the upper 8 + // bits unused. Red, Green, and Blue are stored in the remaining 24 bits in + // that order (below U is for unused) + FORMAT_THIRTYTWO_BIT_TC_MASK_BGRU, // The order of the channels code letters indicates the order of the - // channel bytes in memory, I think + // channel bytes in memory FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, FORMAT_THIRTYTWO_BIT_TC_MASK_ARGB, FORMAT_THIRTYTWO_BIT_TC_MASK_ABGR, |