Kaydet (Commit) fe39cd0d authored tarafından Noel Grandin's avatar Noel Grandin

convert SalRGB to scoped enum

and remove unused values

Change-Id: Id10c18e832d54a6e530c3fe197b230d2d511d79c
Reviewed-on: https://gerrit.libreoffice.org/63739
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst bab27533
......@@ -544,18 +544,6 @@ vcl/inc/salptype.hxx:44
enum SalPrinterError General
vcl/inc/unx/saldisp.hxx:65
srv_vendor_t vendor_none
vcl/inc/unx/saldisp.hxx:77
enum SalRGB RGBA
vcl/inc/unx/saldisp.hxx:77
enum SalRGB RBGA
vcl/inc/unx/saldisp.hxx:78
enum SalRGB GBRA
vcl/inc/unx/saldisp.hxx:78
enum SalRGB GRBA
vcl/inc/unx/saldisp.hxx:79
enum SalRGB BRGA
vcl/inc/unx/saldisp.hxx:79
enum SalRGB BGRA
vcl/source/gdi/CommonSalLayout.cxx:129
enum (anonymous namespace)::VerticalOrientation Rotated
vcl/unx/gtk3/gtk3gtkinst.cxx:2524
......
......@@ -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
......
......@@ -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_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment