Commit graph

169 commits

Author SHA1 Message Date
Jérôme Gardou 4e6c12189d revert xlate.c from 48471, never meant to be committed.
Sorry.

svn path=/branches/reactos-yarotows/; revision=48472
2010-08-06 22:09:38 +00:00
Jérôme Gardou e84aac6fb8 [WIN32K]
- sync with trunk (48469)

svn path=/branches/reactos-yarotows/; revision=48471
2010-08-06 21:33:37 +00:00
Jérôme Gardou b06db1f05e [WIN32K, GENDIB]
- Did you know that we should ignore alpha channel of pattern in ROPs? You didn't, I didn't, now we do.
[WIN32K]
  - Use BGR palette as default for 24 and 32 bpp bitmaps.

svn path=/branches/reactos-yarotows/; revision=48470
2010-08-06 14:55:44 +00:00
Jérôme Gardou 3f5d90a47a [WIN32K]
- Rewrite NtGdiStretchDIBitsInternal : clearer, faster, stronger (+1 wine test)

svn path=/branches/reactos-yarotows/; revision=48465
2010-08-05 21:12:57 +00:00
Jérôme Gardou 96444b43c2 Sync with trunk (48463)
svn path=/branches/reactos-yarotows/; revision=48464
2010-08-05 21:03:35 +00:00
Jérôme Gardou 5762f7b639 [WIN32K]
- Use lower level function to set bitmap bits in IntSetDIBits.
Fixes rapps icons.

svn path=/branches/reactos-yarotows/; revision=48420
2010-08-02 19:40:42 +00:00
Jérôme Gardou 52e83d06d9 Sync with trunk (r48414)
svn path=/branches/reactos-yarotows/; revision=48419
2010-08-02 19:09:21 +00:00
Jérôme Gardou f65f4b82ff [WIN32K]
- Do not cast RGBQUAD to PALETTEENTRY or the other way around, you idiot.
  - Report success even when we're asked fo 0 ScanLines in NtGdiGetDIBitsInternal.

svn path=/branches/reactos-yarotows/; revision=48417
2010-08-02 17:25:09 +00:00
Jérôme Gardou 4519685bb8 [WIN32K]
- NtGdiGetBitmapBits : Bits we're given are 16 bits aligned.
  - NtGdiGetDIBitsInternal : we must not stretch, for this there is NtGdiStretchDIBitsInternal. Use lower level functions to do the work, there is no need to create HDCs etc...
Now icons are back.

svn path=/branches/reactos-yarotows/; revision=48416
2010-08-02 16:49:51 +00:00
Jérôme Gardou 501947714e [WIN32K]
- Use correct offset in UserLoadImage, create the bitmap using display DC.
  - BITMAP_GetObject : Report BI_BITFIELDS compression when we should.
  - Use a 0 compatible DC when none is given in NtGdiCreateDIBitmapInternal.
This fixes some wine tests. Enjoy.

svn path=/branches/reactos-yarotows/; revision=48415
2010-08-02 14:45:51 +00:00
Jérôme Gardou 0bba315d06 [WIN32K]
- Apply a better fix for correctly report 16 bits alignment for DDBs, and keep them 32 bits aligned as it should be.
  - Reapply Pigglesworth patch, which was correct since mine was not.
Dedicated to tkreuzer, PigglesWorth and lassy, the three guys still on IRC to watch my commits at 3:30 AM.

svn path=/branches/reactos-yarotows/; revision=48408
2010-08-02 01:41:16 +00:00
Jérôme Gardou 53fe62ce9c [WIN32K]
- Colors passed to EngCreatePalette are PALETTEENTRYs, my bad.

svn path=/branches/reactos-yarotows/; revision=48407
2010-08-02 01:09:36 +00:00
Jérôme Gardou a0d32e2d0b [WIN32K]
- DDB are 16 bits aligned.
  - Reset hdc field of the unselected bitmap.
  - Lock it too, so it's not messed with when we unselect it.
  - Move Pattern creation of IntGdiCreateDIBBrush to DIB_CreateDIBSection.

svn path=/branches/reactos-yarotows/; revision=48406
2010-08-02 00:53:25 +00:00
Kamil Hornicek 7d7d9eba48 [WIN32K]
Comply with the 32 bit alignment rule. Fixes hatch brushes.

svn path=/branches/reactos-yarotows/; revision=48396
2010-08-01 13:29:22 +00:00
Jérôme Gardou c2a010f5f1 [WIN32K]
- Revert unwanted change and get back to PAL_BGR for default DIB palette mode.
Now yarotows looks like an OS again.

svn path=/branches/reactos-yarotows/; revision=48390
2010-08-01 12:24:04 +00:00
Jérôme Gardou 787cb5551f [WIN32K]
- Finally get rid of ProbeAndConvertToBitmapV5Info
  - Rewrite renderBITMAPfromDIB, and a good bunch of DIB related functions accordingly.
  - Rewrite BITMAP_CopyBitmap into something simpler.
  - Use already existing DIB functions in IntGdiCreateDIBBrush
  - Use DIB sections in NtGdiStretchDIBitsInternal and NtGdiSetDIBits.
  - Use Bitmap hdc for NtGdiGetDIBitsInternal if there is one.

svn path=/branches/reactos-yarotows/; revision=48389
2010-08-01 12:17:35 +00:00
Jérôme Gardou 147e52c02c [WIN32K]
- Cast Colors to RGBQUAD in EngCreateBitmap, since that's what they are.
  - Copy selected palette of the DC when creating a DIBSection with DIB_PAL_COLORS.
  - Do not try to get Colors in NtGdiGetDIBitsInternal when bpp == 0, this doesn't make any sense.
  - Get rid of SURFACE::dsBitfields and SURFACE::biClrUsed.
  - Use RGB as default palette mod when creating the DIB Palette.

svn path=/branches/reactos-yarotows/; revision=48369
2010-07-30 02:15:46 +00:00
Jérôme Gardou b011aff53b [WIN32K]
- rewrite UserLoadImage so that it uses information from the BITMAPFILEHEADER and probes the right buffer.

svn path=/branches/reactos-yarotows/; revision=48364
2010-07-29 18:01:14 +00:00
Jérôme Gardou fa93ac8293 [WIN32K]
- Get rid of GetBMIFromBitmapV5Info

svn path=/branches/reactos-yarotows/; revision=48360
2010-07-29 16:21:02 +00:00
Jérôme Gardou 5cfcef35dc [WIN32K]
- Rewrite NtGdiGetDIBitsInternal, with WINE as a reference.
  - Get back DIB Section creation to classic BITMAPINFO.
This si the beginnig of the end for all this BITMAPV5INFO stuff.
It is horrible, BITMAPCOREINFO->BITMAPINFO is already made in user mode, and V4 and V5 features are not used so often.

svn path=/branches/reactos-yarotows/; revision=48359
2010-07-29 16:12:43 +00:00
Jérôme Gardou fbcac4b275 [WIN32K]
- More BITMAPINFO->BITMAPV5INFO
  - Do not use PAL_BITFIELDS when creating the DIB palette and we know that it's RGB
  - PSEH-ize NtGdiCreateDIBSection

svn path=/branches/reactos-yarotows/; revision=48248
2010-07-25 11:35:45 +00:00
Jérôme Gardou eaa1cb5487 Sync with trunk (r48123)
svn path=/branches/reactos-yarotows/; revision=48145
2010-07-20 20:09:43 +00:00
Jérôme Gardou f819794d7d Sync with trunk 48067
svn path=/branches/reactos-yarotows/; revision=48068
2010-07-15 20:49:51 +00:00
Jérôme Gardou 84fd5d3369 Push sync to 48046, this time with cursoricon.c
svn path=/branches/reactos-yarotows/; revision=48049
2010-07-14 20:28:06 +00:00
Jérôme Gardou 1b3dfd946f Sync with trunk (r48042), except win32k/ntuser/cursoricon.c
***branch DOES NOT BUILD with this commit***

svn path=/branches/reactos-yarotows/; revision=48048
2010-07-14 20:15:30 +00:00
Jérôme Gardou 8de79262a5 [WIN32K]
- Remove useless chack and comment from UserDrawIconEx

svn path=/branches/reactos-yarotows/; revision=48027
2010-07-13 18:38:19 +00:00
Jérôme Gardou d25782346f [USER32]
- exchange mask and color bitmaps if needed in CreateIconIndirect
[WIN32K]
  - Simplify a bit UserDrawIconEx

svn path=/branches/reactos-yarotows/; revision=48026
2010-07-13 18:32:33 +00:00
Jérôme Gardou 4553986560 Sync with trunk (r48008)
Bets are open : will this break anything?

svn path=/branches/reactos-yarotows/; revision=48024
2010-07-13 17:46:03 +00:00
Timo Kreuzer e279aa2082 Sync to trunk (r47832)
svn path=/branches/reactos-yarotows/; revision=47833
2010-06-23 16:21:41 +00:00
Jérôme Gardou 3dbb216746 [WIN32K]
- apply r47787 to yarotows

svn path=/branches/reactos-yarotows/; revision=47797
2010-06-17 01:34:52 +00:00
Jérôme Gardou 648fe9cf65 [WIN32K]
- Delete useless file once and for all

svn path=/branches/reactos-yarotows/; revision=47796
2010-06-17 01:31:03 +00:00
Jérôme Gardou 2d0dd58947 Hopefully fail to break anything in the process of syncing with trunk (r47786)
svn path=/branches/reactos-yarotows/; revision=47795
2010-06-17 01:25:16 +00:00
Jérôme Gardou bb23cc5ca6 [WIN32K]
- revert part of -r47735, as it's not the good fix (tm)

svn path=/branches/reactos-yarotows/; revision=47789
2010-06-16 18:50:55 +00:00
Timo Kreuzer 5f2d67cb35 Sync to trunk head (r47736)
svn path=/branches/reactos-yarotows/; revision=47746
2010-06-10 20:57:03 +00:00
Jérôme Gardou f57bcb3e25 [GDI32]
- DIB data is not mandatory in CreateDIBitmap
[WIN32K]
  - Simplify GreCreateDIBitmap
  - Surface data should be 16 bits aligned

svn path=/branches/reactos-yarotows/; revision=47735
2010-06-10 14:32:05 +00:00
Jérôme Gardou 52ba1736b3 [WIN32K]
- Split NtGdiCreateDIBitmapInternal with its Gre Counterpart
  - Set bV5ImageSize if it was not already set
  - Probe bits we're given in NtGdiSetDIBits
  - SEHize clipboard image data access
  

svn path=/branches/reactos-yarotows/; revision=47733
2010-06-10 11:36:20 +00:00
Jérôme Gardou 4b10742ca5 [WIN32K]
- check for the type of the DC to restore to decide whether we should restore the surface
Fixes yarotows specific FF3 bug

svn path=/branches/reactos-yarotows/; revision=47731
2010-06-10 00:40:09 +00:00
Timo Kreuzer a8ac489720 [WIN32K]
- Improve readability in SetBMIColor
- Only when BitCount is <= 8, calculate the number of colors in the table
- Fixes a crash with VBox driver

svn path=/branches/reactos-yarotows/; revision=47724
2010-06-09 20:36:04 +00:00
Timo Kreuzer 26a57a2a9f [WIN32K]
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
2010-06-09 18:08:23 +00:00
Timo Kreuzer 02588ba9c0 [WIN32K]
Small bug big effects: Use the correct offset when copying the BITMAPINFO, fixes taskbar icons regression.

svn path=/branches/reactos-yarotows/; revision=47709
2010-06-09 11:22:19 +00:00
Timo Kreuzer 8d819d4de1 [WIN32K]
- 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
2010-06-09 02:57:52 +00:00
Jérôme Gardou 974e9c0c41 [WIN32K]
- 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
2010-06-09 00:08:50 +00:00
Timo Kreuzer 70f1514bfd [WIN32K]
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
2010-06-08 02:27:28 +00:00
Jérôme Gardou 8cecc274d8 [WIN32K]
- 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
2010-06-08 00:40:42 +00:00
Timo Kreuzer f8a49f4c75 [WIN32K]
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
2010-06-07 15:55:03 +00:00
Timo Kreuzer a3214996fc [WIN32K]
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
2010-06-06 22:01:41 +00:00
Timo Kreuzer 9a05924c62 [WIN32K]
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
2010-06-06 20:56:58 +00:00
Timo Kreuzer dd95ec9a50 [WIN32K]
Disable the additional alignment code for now, it breaks selections (text / icons)

svn path=/branches/reactos-yarotows/; revision=47619
2010-06-06 11:11:30 +00:00
Timo Kreuzer b3317b3afb [WIN32K]
Add Windows compatible alignment code.

svn path=/branches/reactos-yarotows/; revision=47618
2010-06-06 09:09:04 +00:00
Timo Kreuzer 6068cac704 [WIN32K]
- Move RLE specific code to it's own file (rlecomp.c)
- Relace BitsPerFormat function with an array of UCHARs
- Rewrite surface creation. Surfaces are now allocated from one central function SURFACE_AllocSurface, which sets the size, iType, iUniq, the handle and the default palette.
- Implement SURFACE_vSetDefaultPalette, which sets the default RGB palette, based on bit depth.
- Implement SURFACE_bSetBitmapBits, wich sets cjBits, pvBits, pvScan0 and lDelta and allocates memory if neccessary.
- Use these functions for EngCreateBitmap, EngCreateDeviceBitmap, EngCreateDeviceSurface and IntCreateBitmap

svn path=/branches/reactos-yarotows/; revision=47612
2010-06-06 07:02:15 +00:00