If pbmiSrc->bmiHeader.bV5ClrUsed is 0, calculate the number of colors from the bit depth. Fixes black taskbar icons with vbox driver on 8 bpp
svn path=/branches/reactos-yarotows/; revision=47719
Small bug big effects: Use the correct offset when copying the BITMAPINFO, fixes taskbar icons regression.
svn path=/branches/reactos-yarotows/; revision=47709
- Initialize the palettes before creating any bitmaps.
- Replace SURFACE_vSetDefaultPalette with an array of default palettes.
- Check iFormat in SURFACE_AllocSurface
svn path=/branches/reactos-yarotows/; revision=47703
- More BITMAPV5INFO fun
- Probe max size we are asked for when converting to V5 Info
[USER32] [WIN32K]
- CreateDIBitmap : Move safety handling to win32k, where it belongs. More code cleanness!
svn path=/branches/reactos-yarotows/; revision=47701
NtGdiGetDIBitsInternal: don't use the unsafe usermode pointer after the BITMAPINFO has been converted and protect writing back the result with SEH.
svn path=/branches/reactos-yarotows/; revision=47692
- remove duplicate prototypes.
- Add missing trail to debug print
- replace some now superfluous checks on bitmap palette with sanity ASSERTS
- begin using BITMAPV5HEADER as a default bitmap format, and introduce conversion to and from everything prior that.
Congratulations to BITMAPCOREHEADER, for its backward compatibility personal failure.
svn path=/branches/reactos-yarotows/; revision=47690
Introduce GreCreateBitmapEx, which has the extended functionality needed by some callers, GreCreateBitmap calls GreCreateBitmapEx to keep the simple syntax. Use it in DIB_CreateDIBSection to fix build. Also pass the size of the image (still ignored), which is needed for compressed bitmaps (we currently assume that RLEs take as much space as an uncompressed bitmap)
svn path=/branches/reactos-yarotows/; revision=47663
Rewrite the bitmap API. There were a lot of bugs. NtGdiCreateBitmap allowed a negative height, leading to either topdown or bottomup bitmaps, a behaviour that Windows doesn't have. The function copied the bitmap bits directly from the caller to the bitmap using RtlCopyMemory, ignoring different scanline length and direction (resulting in bitmaps being upside down), not SEH protected. This function (IntSetBitmapBits) is replaced by a better solution UnsafeSetBitmapBits, that takes these things into account. The name is chosen to give a hint that the function can/should be SEH protected. IntSetBitmapBits is still there, as its retarded behaviour is actually required in some places. There were also IntCreateBitmap and IntGdiCreateBitmap, now both being replaced by GreCreateBitmap. The code that set the palette is removed, as it's already done in SURFACE_AllocSurface, here gpalRGB is replaced with gpalBGR, fixing some inverted color issues. The alignment correction in SURFACE_bSetBitmapBits is reapplied, now that the callers are behaving as they are supposed to do.
svn path=/branches/reactos-yarotows/; revision=47641
Make the bitmap data for the extpens (making extpens bitmaps is a bad idea anyway) 4 bytes long instead of 3, to fulfill alignment requirements.
svn path=/branches/reactos-yarotows/; revision=47638
- clean up some debugging code
- set NULL owner when setting BASEFLAG_READY_TO_DIE, so that the handle can be freed.
svn path=/branches/reactos-yarotows/; revision=47217
- clean up some unused code
- use GDIOBJ_IncrementShareCount on Timo suggestion
- use ppdev semaphore as sort criterion in DC_vPrepareDCsForBlit, spotted by Timo
- Get ownership before freeing the object in GDIOBJ_ShareUnlockObjByPtr, as whoever set it ready to die had the right to
svn path=/branches/reactos-yarotows/; revision=47205
- IntGdiCreateBitmap : assign a default palette to the bitmap created
- Use IntCreateBitmap where we already have a bitmap to assign
- delete all mono bitmaps related hacks in xlateobj implementation, as now all bitmaps should have a palette
Fixes last immediately visible glitches when switching modes
svn path=/branches/reactos-yarotows/; revision=47203
- remove a comment which is not true anymore
[USER32]
- Create a bitmap which is compatible with the bitmap'we are copying in CreateSmallIcon
Icons are back in taskbar
svn path=/branches/reactos-yarotows/; revision=47143
- Set NULL owner to copied bitmap when creating indirect icons
- Rewrite UserDrawIconEx, inspired from wine code
- fix palette creation for 16 bits DIB
- Always assign a palette to bitmap created with BITMAP_CopyBitmap and IntCreateCompatibeBitmap.
[USER32]
- Use DIB section when creating icons
- Use something called "header"
Now mode switching is almost glitchless.
svn path=/branches/reactos-yarotows/; revision=47140
- attach devinfo->hpalDefault to the pdevobj after enabling it
- attach this palette to surfaces attached to this pdevobj through EngModifySurface
- use this palette in several place
Partially fixes icon drawing after mode switch
svn path=/branches/reactos-yarotows/; revision=47137
- Allow NtGdiDeleteObjectApp to delete a permanent DC, as windows does it.
This is not exactly what windows does, but no one should use a DeletedDC'ed DC anyway.
Fixes "No! You Naughty Application" debug spam and some wine tests
svn path=/branches/reactos-yarotows/; revision=47131
- Call DC_vPrepareDCsForBlit in IntRectangle with device coordinates instead of in NtGdiRectangle with logical coordinates. Fixes updating mouse pointer.
- Update TODO.txt
svn path=/branches/reactos-yarotows/; revision=46986
- Use the attached surface bits depth when creating a compatible DC
[USER32]
- use a display DC for loading images
svn path=/branches/reactos-yarotows/; revision=46981
- Remove an ASSERT in DC_Cleanup
- Improve code in PDEVOBJ_vSwitchPdev (code shamelessly stolen from Jerome's earlier commit)
- Fix up GDIINFO in PDEVOBJ_bEnablePDEV instead of EngpCreatePDEV
- Update TODO.txt
svn path=/branches/reactos-yarotows/; revision=46975
- revert unwanted change from r46964
- Use MouseSafetyOnDrawStart/End in GreExtTextOutW when we already hold the blit lock
svn path=/branches/reactos-yarotows/; revision=46969
- Revert r46960 : the correct way to go is to mark brushes as dirty and update them where needed
- Do so in GreExtTextOutW, NtGdiBitBlt, NtGdiStrecthBltMask and IntPatBlt
- Add a small hack to GreEstTextOutW so we hold the Blit lock when needed without too much pain.
svn path=/branches/reactos-yarotows/; revision=46964
- Update direct DCs surface before blit if needed
- call directly ppdev in MouseSafetyOnDraw{Start,End}
- use directly the PDEVOBJ surface in mouse operations
- Add some mouse-related sanity checks
svn path=/branches/reactos-yarotows/; revision=46937
- Do not create a PDEVOBJ for nothing at startup
- Create the surface for real in IntCreatePrimarySurface
svn path=/branches/reactos-yarotows/; revision=46930
- Use DC_vPrepareForBlit, DC_vFinishBlit in GreTextOutputW
- So we can get rid of MouseSafetyOnDraw{Start,End} in IntEngMaskBlt
svn path=/branches/reactos-yarotows/; revision=46911
- apply policy into DC_vPrepareDCsForBlit as in GDIOBJ_LockMultipleObjects before Physicus sees this :-D
- GDIOBJ_LockObj : return NULL when handle is NULL : more speed, less debug output
svn path=/branches/reactos-yarotows/; revision=46909