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 ...@@ -544,18 +544,6 @@ vcl/inc/salptype.hxx:44
enum SalPrinterError General enum SalPrinterError General
vcl/inc/unx/saldisp.hxx:65 vcl/inc/unx/saldisp.hxx:65
srv_vendor_t vendor_none 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 vcl/source/gdi/CommonSalLayout.cxx:129
enum (anonymous namespace)::VerticalOrientation Rotated enum (anonymous namespace)::VerticalOrientation Rotated
vcl/unx/gtk3/gtk3gtkinst.cxx:2524 vcl/unx/gtk3/gtk3gtkinst.cxx:2524
......
...@@ -71,12 +71,9 @@ extern "C" srv_vendor_t sal_GetServerVendor( Display *p_display ); ...@@ -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) // MSB/Bigendian view (Color == RGB, r=0xFF0000, g=0xFF00, b=0xFF)
enum SalRGB { RGB, RBG, enum class SalRGB { RGB, RBG,
GBR, GRB, GBR, GRB,
BGR, BRG, BGR, BRG,
RGBA, RBGA,
GBRA, GRBA,
BGRA, BRGA,
otherSalRGB }; otherSalRGB };
class SalVisual : public XVisualInfo class SalVisual : public XVisualInfo
......
...@@ -2393,7 +2393,7 @@ bool SalDisplay::XIfEventWithTimeout( XEvent* o_pEvent, XPointer i_pPredicateDat ...@@ -2393,7 +2393,7 @@ bool SalDisplay::XIfEventWithTimeout( XEvent* o_pEvent, XPointer i_pPredicateDat
} }
SalVisual::SalVisual(): 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) nBlueBits_(0)
{} {}
...@@ -2414,46 +2414,46 @@ SalVisual::SalVisual( const XVisualInfo* pXVI ) ...@@ -2414,46 +2414,46 @@ SalVisual::SalVisual( const XVisualInfo* pXVI )
if( red_mask == 0xFF0000 ) if( red_mask == 0xFF0000 )
if( green_mask == 0xFF00 ) if( green_mask == 0xFF00 )
if( blue_mask == 0xFF ) if( blue_mask == 0xFF )
eRGBMode_ = RGB; eRGBMode_ = SalRGB::RGB;
else else
eRGBMode_ = otherSalRGB; eRGBMode_ = SalRGB::otherSalRGB;
else if( blue_mask == 0xFF00 ) else if( blue_mask == 0xFF00 )
if( green_mask == 0xFF ) if( green_mask == 0xFF )
eRGBMode_ = RBG; eRGBMode_ = SalRGB::RBG;
else else
eRGBMode_ = otherSalRGB; eRGBMode_ = SalRGB::otherSalRGB;
else else
eRGBMode_ = otherSalRGB; eRGBMode_ = SalRGB::otherSalRGB;
else if( green_mask == 0xFF0000 ) else if( green_mask == 0xFF0000 )
if( red_mask == 0xFF00 ) if( red_mask == 0xFF00 )
if( blue_mask == 0xFF ) if( blue_mask == 0xFF )
eRGBMode_ = GRB; eRGBMode_ = SalRGB::GRB;
else else
eRGBMode_ = otherSalRGB; eRGBMode_ = SalRGB::otherSalRGB;
else if( blue_mask == 0xFF00 ) else if( blue_mask == 0xFF00 )
if( red_mask == 0xFF ) if( red_mask == 0xFF )
eRGBMode_ = GBR; eRGBMode_ = SalRGB::GBR;
else else
eRGBMode_ = otherSalRGB; eRGBMode_ = SalRGB::otherSalRGB;
else else
eRGBMode_ = otherSalRGB; eRGBMode_ = SalRGB::otherSalRGB;
else if( blue_mask == 0xFF0000 ) else if( blue_mask == 0xFF0000 )
if( red_mask == 0xFF00 ) if( red_mask == 0xFF00 )
if( green_mask == 0xFF ) if( green_mask == 0xFF )
eRGBMode_ = BRG; eRGBMode_ = SalRGB::BRG;
else else
eRGBMode_ = otherSalRGB; eRGBMode_ = SalRGB::otherSalRGB;
else if( green_mask == 0xFF00 ) else if( green_mask == 0xFF00 )
if( red_mask == 0xFF ) if( red_mask == 0xFF )
eRGBMode_ = BGR; eRGBMode_ = SalRGB::BGR;
else else
eRGBMode_ = otherSalRGB; eRGBMode_ = SalRGB::otherSalRGB;
else else
eRGBMode_ = otherSalRGB; eRGBMode_ = SalRGB::otherSalRGB;
else else
eRGBMode_ = otherSalRGB; eRGBMode_ = SalRGB::otherSalRGB;
else else
eRGBMode_ = otherSalRGB; eRGBMode_ = SalRGB::otherSalRGB;
} }
} }
...@@ -2462,8 +2462,8 @@ SalVisual::SalVisual( const XVisualInfo* pXVI ) ...@@ -2462,8 +2462,8 @@ SalVisual::SalVisual( const XVisualInfo* pXVI )
// Color is RGB (ABGR) a=0xFF000000, r=0xFF0000, g=0xFF00, b=0xFF // Color is RGB (ABGR) a=0xFF000000, r=0xFF0000, g=0xFF00, b=0xFF
#define SALCOLOR RGB #define SALCOLOR SalRGB::RGB
#define SALCOLORREVERSE BGR #define SALCOLORREVERSE SalRGB::BGR
Color SalVisual::GetTCColor( Pixel nPixel ) const Color SalVisual::GetTCColor( Pixel nPixel ) const
{ {
...@@ -2479,7 +2479,7 @@ Color SalVisual::GetTCColor( Pixel nPixel ) const ...@@ -2479,7 +2479,7 @@ Color SalVisual::GetTCColor( Pixel nPixel ) const
Pixel g = nPixel & green_mask; Pixel g = nPixel & green_mask;
Pixel b = nPixel & blue_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_, return Color( r >> nRedShift_,
g >> nGreenShift_, g >> nGreenShift_,
b >> nBlueShift_ ); b >> nBlueShift_ );
...@@ -2510,7 +2510,7 @@ Pixel SalVisual::GetTCPixel( Color nColor ) const ...@@ -2510,7 +2510,7 @@ Pixel SalVisual::GetTCPixel( Color nColor ) const
if( SALCOLORREVERSE == eRGBMode_ ) if( SALCOLORREVERSE == eRGBMode_ )
return (b << 16) | (g << 8) | r; 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_); return (r << nRedShift_) | (g << nGreenShift_) | (b << nBlueShift_);
if( nRedShift_ > 0 ) r <<= nRedShift_; else r >>= -nRedShift_; 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