diff options
author | Tor Lillqvist <tml@collabora.com> | 2013-12-11 18:11:22 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2013-12-11 18:17:18 +0200 |
commit | 69baf700b6ac9c069022714c3d661a632ade93a3 (patch) | |
tree | 26ca14be48b3fe46753dd6131974ee7fde0d6489 /vcl | |
parent | 108eee306ea0beef1e8cc5e673a72db0928dd6b8 (diff) |
Try to fix colour issues
Use RGBA consistenly. Wonder why the code was changed to use BGRA at
some point?
I got the picture in the document to show up with correct colours but
unfortunately not the RED GREEN BLUE etc text. Weird. Even weirder, if
I add a temporary hack in CoreTextStyle::SetTextColor() to use some
other colours for non-black text (instead of the ones passed in the
parameter), those colours do show up. This is a mystery.
Change-Id: I591424a19fa02b3f095035e989cbc49fff94b8ca
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/ios/iosinst.cxx | 6 | ||||
-rw-r--r-- | vcl/quartz/salgdi.cxx | 15 |
2 files changed, 18 insertions, 3 deletions
diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx index c0f707305d20..0b3f69fafbfb 100644 --- a/vcl/ios/iosinst.cxx +++ b/vcl/ios/iosinst.cxx @@ -156,7 +156,7 @@ public: sal_uLong nSalFrameStyle, SystemParentData *pSysParent ) : SvpSalFrame( pInstance, pParent, nSalFrameStyle, - true, basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA, + true, basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA, pSysParent ) { enableDamageTracker(); @@ -361,7 +361,7 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg ) CGImageCreate( aDevice->getSize().getX(), aDevice->getSize().getY(), 8, 32, aDevice->getScanlineStride(), CGColorSpaceCreateDeviceRGB(), - kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little, + kCGImageAlphaNoneSkipLast, provider, NULL, false, @@ -403,7 +403,7 @@ touch_lo_copy_buffer(const void * source, size_t sourceWidth, size_t sourceHeigh 32, sourceBytesPerRow, CGColorSpaceCreateDeviceRGB(), - kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little, + kCGImageAlphaNoneSkipLast, provider, NULL, false, diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index 0a48e2d6b2f6..ee802056a2d3 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -302,6 +302,7 @@ AquaSalGraphics::~AquaSalGraphics() void AquaSalGraphics::SetTextColor( SalColor nSalColor ) { maTextColor = RGBAColor( nSalColor ); + // SAL_ DEBUG(std::hex << nSalColor << std::dec << "={" << maTextColor.GetRed() << ", " << maTextColor.GetGreen() << ", " << maTextColor.GetBlue() << ", " << maTextColor.GetAlpha() << "}"); if( mpTextStyle) mpTextStyle->SetTextColor( maTextColor ); } @@ -819,6 +820,13 @@ bool SvpSalGraphics::CheckContext() CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipLast); break; + case basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_ARGB: + mrContext = CGBitmapContextCreate(pixelBuffer.get(), + bufferSize.getX(), bufferSize.getY(), + 8, scanlineStride, + CGColorSpaceCreateDeviceRGB(), + kCGImageAlphaNoneSkipFirst); + break; case basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA: mrContext = CGBitmapContextCreate(pixelBuffer.get(), bufferSize.getX(), bufferSize.getY(), @@ -826,6 +834,13 @@ bool SvpSalGraphics::CheckContext() CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little); break; + case basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_ABGR: + mrContext = CGBitmapContextCreate(pixelBuffer.get(), + bufferSize.getX(), bufferSize.getY(), + 8, scanlineStride, + CGColorSpaceCreateDeviceRGB(), + kCGImageAlphaNoneSkipLast | kCGBitmapByteOrder32Little); + break; default: SAL_WARN( "vcl.ios", "CheckContext: unsupported color format " << basebmp::formatName( m_aDevice->getScanlineFormat() ) ); warned = true; |