diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/saldisp.hxx | 5 | ||||
-rw-r--r-- | vcl/unx/generic/app/saldisp.cxx | 44 |
2 files changed, 23 insertions, 26 deletions
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 44fb08b87a91..c5bc241a37cc 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -71,12 +71,9 @@ extern "C" srv_vendor_t sal_GetServerVendor( Display *p_display ); // MSB/Bigendian view (Color == RGB, r=0xFF0000, g=0xFF00, b=0xFF) -enum SalRGB { RGB, RBG, +enum class SalRGB { RGB, RBG, GBR, GRB, BGR, BRG, - RGBA, RBGA, - GBRA, GRBA, - BGRA, BRGA, otherSalRGB }; class SalVisual : public XVisualInfo diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index e454587bafe0..ba436d4b3945 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -2393,7 +2393,7 @@ bool SalDisplay::XIfEventWithTimeout( XEvent* o_pEvent, XPointer i_pPredicateDat } SalVisual::SalVisual(): - eRGBMode_(RGB), nRedShift_(0), nGreenShift_(0), nBlueShift_(0), nRedBits_(0), nGreenBits_(0), + eRGBMode_(SalRGB::RGB), nRedShift_(0), nGreenShift_(0), nBlueShift_(0), nRedBits_(0), nGreenBits_(0), nBlueBits_(0) {} @@ -2414,46 +2414,46 @@ SalVisual::SalVisual( const XVisualInfo* pXVI ) if( red_mask == 0xFF0000 ) if( green_mask == 0xFF00 ) if( blue_mask == 0xFF ) - eRGBMode_ = RGB; + eRGBMode_ = SalRGB::RGB; else - eRGBMode_ = otherSalRGB; + eRGBMode_ = SalRGB::otherSalRGB; else if( blue_mask == 0xFF00 ) if( green_mask == 0xFF ) - eRGBMode_ = RBG; + eRGBMode_ = SalRGB::RBG; else - eRGBMode_ = otherSalRGB; + eRGBMode_ = SalRGB::otherSalRGB; else - eRGBMode_ = otherSalRGB; + eRGBMode_ = SalRGB::otherSalRGB; else if( green_mask == 0xFF0000 ) if( red_mask == 0xFF00 ) if( blue_mask == 0xFF ) - eRGBMode_ = GRB; + eRGBMode_ = SalRGB::GRB; else - eRGBMode_ = otherSalRGB; + eRGBMode_ = SalRGB::otherSalRGB; else if( blue_mask == 0xFF00 ) if( red_mask == 0xFF ) - eRGBMode_ = GBR; + eRGBMode_ = SalRGB::GBR; else - eRGBMode_ = otherSalRGB; + eRGBMode_ = SalRGB::otherSalRGB; else - eRGBMode_ = otherSalRGB; + eRGBMode_ = SalRGB::otherSalRGB; else if( blue_mask == 0xFF0000 ) if( red_mask == 0xFF00 ) if( green_mask == 0xFF ) - eRGBMode_ = BRG; + eRGBMode_ = SalRGB::BRG; else - eRGBMode_ = otherSalRGB; + eRGBMode_ = SalRGB::otherSalRGB; else if( green_mask == 0xFF00 ) if( red_mask == 0xFF ) - eRGBMode_ = BGR; + eRGBMode_ = SalRGB::BGR; else - eRGBMode_ = otherSalRGB; + eRGBMode_ = SalRGB::otherSalRGB; else - eRGBMode_ = otherSalRGB; + eRGBMode_ = SalRGB::otherSalRGB; else - eRGBMode_ = otherSalRGB; + eRGBMode_ = SalRGB::otherSalRGB; else - eRGBMode_ = otherSalRGB; + eRGBMode_ = SalRGB::otherSalRGB; } } @@ -2462,8 +2462,8 @@ SalVisual::SalVisual( const XVisualInfo* pXVI ) // Color is RGB (ABGR) a=0xFF000000, r=0xFF0000, g=0xFF00, b=0xFF -#define SALCOLOR RGB -#define SALCOLORREVERSE BGR +#define SALCOLOR SalRGB::RGB +#define SALCOLORREVERSE SalRGB::BGR Color SalVisual::GetTCColor( Pixel nPixel ) const { @@ -2479,7 +2479,7 @@ Color SalVisual::GetTCColor( Pixel nPixel ) const Pixel g = nPixel & green_mask; Pixel b = nPixel & blue_mask; - if( otherSalRGB != eRGBMode_ ) // 8+8+8=24 + if( SalRGB::otherSalRGB != eRGBMode_ ) // 8+8+8=24 return Color( r >> nRedShift_, g >> nGreenShift_, b >> nBlueShift_ ); @@ -2510,7 +2510,7 @@ Pixel SalVisual::GetTCPixel( Color nColor ) const if( SALCOLORREVERSE == eRGBMode_ ) return (b << 16) | (g << 8) | r; - if( otherSalRGB != eRGBMode_ ) // 8+8+8=24 + if( SalRGB::otherSalRGB != eRGBMode_ ) // 8+8+8=24 return (r << nRedShift_) | (g << nGreenShift_) | (b << nBlueShift_); if( nRedShift_ > 0 ) r <<= nRedShift_; else r >>= -nRedShift_; |