PVS43: two if with same condition in BBitmap::SetBits
This commit is contained in:
parent
744ab983f3
commit
487d015ab7
@ -216,9 +216,11 @@ get_raw_bytes_per_row(color_space colorSpace, int32 width)
|
||||
case B_YCbCr420: case B_YUV420:
|
||||
bpr = (width + 3) / 4 * 6;
|
||||
break;
|
||||
case B_YUV9:
|
||||
bpr = (width + 15) / 16 * 18;
|
||||
// unsupported
|
||||
case B_NO_COLOR_SPACE:
|
||||
case B_YUV9: case B_YUV12:
|
||||
case B_YUV12:
|
||||
break;
|
||||
}
|
||||
return bpr;
|
||||
@ -1761,10 +1763,10 @@ BBitmap::SetBits(const void *data, int32 length, int32 offset,
|
||||
// ignore source data row padding.
|
||||
} else if (colorSpace == B_CMAP8 && fColorSpace != B_CMAP8)
|
||||
inBPR = width;
|
||||
}
|
||||
// call the sane method, which does the actual work
|
||||
if (error == B_OK)
|
||||
|
||||
// call the sane method, which does the actual work
|
||||
error = ImportBits(data, length, inBPR, offset, colorSpace);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,9 +124,12 @@ get_raw_bytes_per_row(color_space colorSpace, int32 width)
|
||||
case B_YCbCr420: case B_YUV420:
|
||||
bpr = (width + 3) / 4 * 6;
|
||||
break;
|
||||
case B_YUV9:
|
||||
bpr = (width + 15) / 16 * 18;
|
||||
break;
|
||||
// unsupported
|
||||
case B_NO_COLOR_SPACE:
|
||||
case B_YUV9: case B_YUV12:
|
||||
case B_YUV12:
|
||||
break;
|
||||
}
|
||||
return bpr;
|
||||
@ -644,10 +647,10 @@ BBitmap::SetBits(const void* data, int32 length, int32 offset,
|
||||
// ignore source data row padding.
|
||||
inBPR = width;
|
||||
}
|
||||
}
|
||||
// call the sane method, which does the actual work
|
||||
if (error == B_OK)
|
||||
|
||||
// call the sane method, which does the actual work
|
||||
error = ImportBits(data, length, inBPR, offset, colorSpace);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user