[ros-dev] [ros-diffs] [greatlrd] 33783: revert my last change
aleksey at reactos.org
Sun Jun 1 09:54:14 CEST 2008
And even more, James, there are live real cases during reactos start
up process that DIB_GetDIBWidthBytes is called with negative width.
On Jun 1, 2008, at 1:31 AM, James Tabor wrote:
> eng/surface.c:149: NewBitmap = EngCreateBitmap(Size,
> DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(Format)), Format, 0,
> Are you all aware that DIB_GetDIBWidthBytes is called again in
> IntCreateBitmap? Follow the flow.
> No wonder bitmaps is fubared!
> Please someone fix this!
> On Sat, May 31, 2008 at 1:41 PM, James Tabor
> <jimtabor.rosdev at gmail.com> wrote:
>> I checked this and it is all wrong,,,,, I reverted part of
>> revision 19267:
>> Replacing the code with the original wine code that behaves like
>> "Windows code" but should be called inside EngCreateBitmap if
>> Width = DIB_GetDIBWidthBytes( lWidth, iFormat); .
>> As it should be:
>> INT FASTCALL DIB_GetDIBWidthBytes (INT width, INT depth)
>> // return ((width * depth + 31) & ~31) >> 3;
>> int words;
>> case 1: words = (width + 31) / 32; break;
>> case 4: words = (width + 7) / 8; break;
>> case 8: words = (width + 3) / 4; break;
>> case 15:
>> case 16: words = (width + 1) / 2; break;
>> case 24: words = (width * 3 + 3)/4; break;
>> DPRINT1("(%d): Unsupported depth\n", depth );
>> /* fall through */
>> case 32:
>> words = width;
>> return 4 * words;
> Ros-dev mailing list
> Ros-dev at reactos.org
More information about the Ros-dev