Got rid of fBitsPerPixel (and BitsPerPixel()) in ServerBitmap,

since they were nowhere used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31677 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2009-07-21 18:28:31 +00:00
parent 782bdb4030
commit de6a19ee14
2 changed files with 3 additions and 22 deletions
-12
View File
@@ -68,7 +68,6 @@ ServerBitmap::ServerBitmap(BRect rect, color_space space, uint32 flags,
fBytesPerRow(0), fBytesPerRow(0),
fSpace(space), fSpace(space),
fFlags(flags), fFlags(flags),
fBitsPerPixel(0),
fOwner(NULL) fOwner(NULL)
// fToken is initialized (if used) by the BitmapManager // fToken is initialized (if used) by the BitmapManager
{ {
@@ -91,7 +90,6 @@ ServerBitmap::ServerBitmap(const ServerBitmap* bitmap)
fBytesPerRow = bitmap->fBytesPerRow; fBytesPerRow = bitmap->fBytesPerRow;
fSpace = bitmap->fSpace; fSpace = bitmap->fSpace;
fFlags = bitmap->fFlags; fFlags = bitmap->fFlags;
fBitsPerPixel = bitmap->fBitsPerPixel;
fOwner = bitmap->fOwner; fOwner = bitmap->fOwner;
} else { } else {
fWidth = 0; fWidth = 0;
@@ -99,7 +97,6 @@ ServerBitmap::ServerBitmap(const ServerBitmap* bitmap)
fBytesPerRow = 0; fBytesPerRow = 0;
fSpace = B_NO_COLOR_SPACE; fSpace = B_NO_COLOR_SPACE;
fFlags = 0; fFlags = 0;
fBitsPerPixel = 0;
fOwner = NULL; fOwner = NULL;
} }
} }
@@ -161,7 +158,6 @@ void
ServerBitmap::_HandleSpace(color_space space, int32 bytesPerRow) ServerBitmap::_HandleSpace(color_space space, int32 bytesPerRow)
{ {
// calculate the minimum bytes per row // calculate the minimum bytes per row
// set fBitsPerPixel
int32 minBPR = 0; int32 minBPR = 0;
switch(space) { switch(space) {
// 32-bit // 32-bit
@@ -183,7 +179,6 @@ ServerBitmap::_HandleSpace(color_space space, int32 bytesPerRow)
case B_CMYA32: case B_CMYA32:
case B_CMYK32: case B_CMYK32:
minBPR = fWidth * 4; minBPR = fWidth * 4;
fBitsPerPixel = 32;
break; break;
// 24-bit // 24-bit
@@ -201,7 +196,6 @@ ServerBitmap::_HandleSpace(color_space space, int32 bytesPerRow)
case B_YCbCr444: case B_YCbCr444:
case B_YUV444: case B_YUV444:
minBPR = fWidth * 3; minBPR = fWidth * 3;
fBitsPerPixel = 24;
break; break;
// 16-bit // 16-bit
@@ -214,27 +208,23 @@ ServerBitmap::_HandleSpace(color_space space, int32 bytesPerRow)
case B_RGB15_BIG: case B_RGB15_BIG:
case B_RGBA15_BIG: case B_RGBA15_BIG:
minBPR = fWidth * 2; minBPR = fWidth * 2;
fBitsPerPixel = 16;
break; break;
case B_YCbCr422: case B_YCbCr422:
case B_YUV422: case B_YUV422:
minBPR = (fWidth + 3) / 4 * 8; minBPR = (fWidth + 3) / 4 * 8;
// TODO: huh? why not simply fWidth * 2 ?!? // TODO: huh? why not simply fWidth * 2 ?!?
fBitsPerPixel = 16;
break; break;
// 8-bit // 8-bit
case B_CMAP8: case B_CMAP8:
case B_GRAY8: case B_GRAY8:
minBPR = fWidth; minBPR = fWidth;
fBitsPerPixel = 8;
break; break;
// 1-bit // 1-bit
case B_GRAY1: case B_GRAY1:
minBPR = (fWidth + 7) / 8; minBPR = (fWidth + 7) / 8;
fBitsPerPixel = 1;
break; break;
// TODO: ??? get a clue what these mean // TODO: ??? get a clue what these mean
@@ -243,12 +233,10 @@ ServerBitmap::_HandleSpace(color_space space, int32 bytesPerRow)
case B_YUV420: case B_YUV420:
case B_YCbCr420: case B_YCbCr420:
minBPR = (fWidth + 3) / 4 * 6; minBPR = (fWidth + 3) / 4 * 6;
fBitsPerPixel = 0;
break; break;
case B_NO_COLOR_SPACE: case B_NO_COLOR_SPACE:
default: default:
fBitsPerPixel = 0;
break; break;
} }
if (minBPR > 0 || bytesPerRow > 0) { if (minBPR > 0 || bytesPerRow > 0) {
+3 -10
View File
@@ -50,8 +50,7 @@ class ServerBitmap {
inline int32 BytesPerRow() const inline int32 BytesPerRow() const
{ return fBytesPerRow; } { return fBytesPerRow; }
inline uint8 BitsPerPixel() const
{ return fBitsPerPixel; }
inline color_space ColorSpace() const inline color_space ColorSpace() const
{ return fSpace; } { return fSpace; }
inline uint32 Flags() const inline uint32 Flags() const
@@ -87,7 +86,6 @@ class ServerBitmap {
protected: protected:
friend class BitmapManager; friend class BitmapManager;
friend class PicturePlayer;
ServerBitmap(BRect rect, color_space space, ServerBitmap(BRect rect, color_space space,
uint32 flags, int32 bytesPerRow = -1, uint32 flags, int32 bytesPerRow = -1,
@@ -95,9 +93,6 @@ protected:
ServerBitmap(const ServerBitmap* bmp); ServerBitmap(const ServerBitmap* bmp);
virtual ~ServerBitmap(); virtual ~ServerBitmap();
//! used by the BitmapManager
// inline void _SetBuffer(void *ptr)
// { fBuffer = (uint8*)ptr; }
bool _Release(); bool _Release();
@@ -117,8 +112,7 @@ protected:
int32 fBytesPerRow; int32 fBytesPerRow;
color_space fSpace; color_space fSpace;
uint32 fFlags; uint32 fFlags;
int fBitsPerPixel;
ServerApp* fOwner; ServerApp* fOwner;
int32 fToken; int32 fToken;
}; };
@@ -148,10 +142,9 @@ ServerBitmap::ShallowCopy(const ServerBitmap* from)
fBuffer = from->fBuffer; fBuffer = from->fBuffer;
fWidth = from->fWidth; fWidth = from->fWidth;
fHeight = from->fHeight; fHeight = from->fHeight;
fBytesPerRow = from->fBytesPerRow; fBytesPerRow = from->fBytesPerRow;
fSpace = from->fSpace; fSpace = from->fSpace;
fFlags = from->fFlags; fFlags = from->fFlags;
fBitsPerPixel = from->fBitsPerPixel;
fToken = from->fToken; fToken = from->fToken;
} }