Commit graph

58 commits

Author SHA1 Message Date
Timo Kreuzer 61c05f8d3d Add macros WIDTH_BYTES_ALIGN16/32
svn path=/branches/reactos-yarotows/; revision=48675
2010-09-01 12:04:31 +00:00
Timo Kreuzer 0372821ca0 Sync with trunk head (r48654)
svn path=/branches/reactos-yarotows/; revision=48660
2010-08-30 19:55:47 +00:00
Jérôme Gardou 8fc627931b Revert parts of r48547 which have nothing to do with the sync
svn path=/branches/reactos-yarotows/; revision=48553
2010-08-15 14:51:39 +00:00
Jérôme Gardou f9862d34b4 Sync with trunk (r48545)
svn path=/branches/reactos-yarotows/; revision=48547
2010-08-14 15:15:44 +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 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
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 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 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 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
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
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 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
Timo Kreuzer 0c60cdb311 [WIN32K]
- Allocate bitmaps as kernel sections, instead of from paged pool, like it's done in windows.
- Fix SURFACE_Cleanup. It was only freeing the memory for API_BITMAPs. If memory was allocated by a driver it never got freed.
- Add BMF_RLE_HACK flag to free decompressed RLE bits
- Support FL_ZERO_MEMORY in EngAllocSectionMem
- Set SURFOBJ::iType when creating a surface

svn path=/branches/reactos-yarotows/; revision=47606
2010-06-06 03:12:56 +00:00
Timo Kreuzer 160142322e [WIN32K]
Make the SURFACE structure a bit more like the half documented windows version.

svn path=/branches/reactos-yarotows/; revision=47603
2010-06-05 21:19:41 +00:00
Jérôme Gardou de271b9b4f Sync with trunk r47367
svn path=/branches/reactos-yarotows/; revision=47369
2010-05-26 23:20:20 +00:00
Jérôme Gardou 5ba3469f7b [WIN32K]
- merge r47350, slightly modified to get it the yarotows way

svn path=/branches/reactos-yarotows/; revision=47366
2010-05-26 22:29:45 +00:00
Jérôme Gardou 4170ce0625 sync with trunk r47346
svn path=/branches/reactos-yarotows/; revision=47347
2010-05-25 10:27:42 +00:00
Timo Kreuzer 1549a8532e [WIN32K]
Simplify EXLATEOBJ_vInitXlateFromDCs and remove EXLATEOBJ_vInitBrushXlate. Less code, more fun.

svn path=/branches/reactos-yarotows/; revision=47278
2010-05-19 16:23:33 +00:00
Timo Kreuzer 3078dd3c10 sync with trunk (r47268)
svn path=/branches/reactos-yarotows/; revision=47271
2010-05-19 03:44:15 +00:00
Jérôme Gardou 63b50165b2 sync with trunk r47227
svn path=/branches/reactos-yarotows/; revision=47228
2010-05-15 22:30:01 +00:00
Jérôme Gardou b0aa4f5a2c [WIN32K]
- 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
2010-05-14 20:19:46 +00:00
Jérôme Gardou 10e3e81202 [WIN32K]
- 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
2010-05-14 18:51:48 +00:00
Jérôme Gardou 421a63ff44 [WIN32K]
- Get rid of hDIBPalette in SURFACE structure
This allows more code cleanness

svn path=/branches/reactos-yarotows/; revision=47190
2010-05-12 22:56:24 +00:00
Jérôme Gardou db93f2d307 [WIN32K]
- 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
2010-05-08 22:10:41 +00:00
Jérôme Gardou 3d533cb7a2 Sync with trunk r47129
svn path=/branches/reactos-yarotows/; revision=47133
2010-05-08 17:23:51 +00:00
Jérôme Gardou 147736390c Delete win32k.h, it's useless now
svn path=/branches/reactos-yarotows/; revision=47118
2010-05-07 07:44:50 +00:00
Jérôme Gardou 88c9e7c6e8 Sync with trunk (r47116), hopefully without breaking anything.
svn path=/branches/reactos-yarotows/; revision=47117
2010-05-07 07:41:13 +00:00
Jérôme Gardou 2f9569c2e5 [WIN32K]
- really update Text and BackGround brushes when asked to

svn path=/branches/reactos-yarotows/; revision=46966
2010-04-20 20:44:43 +00:00
Jérôme Gardou 82ad88f1ab [WIN32K]
- Get rid of IntEngBitBltEx, it's Exness isn't needed anymore

svn path=/branches/reactos-yarotows/; revision=46940
2010-04-19 15:08:03 +00:00
Jérôme Gardou e918eb7c29 [WIN32K]
- 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
2010-04-19 13:52:37 +00:00
Jérôme Gardou 083f2b4f4a [WIN32K]
- Finally get rid of SURFACE::BitsLock

svn path=/branches/reactos-yarotows/; revision=46935
2010-04-19 00:56:25 +00:00
Jérôme Gardou 62473c84e9 Sync to trunk (r46918)
svn path=/branches/reactos-yarotows/; revision=46920
2010-04-18 14:06:07 +00:00
Jérôme Gardou 663acbc064 [WIN32K]
- For now, limit DC_UnlockDc to a simple GDIOBJ_LockObj
  - More GDIOBJ_LockMultipleObj, DC_vPrepareDCsForBlit and DC_vFinishBlit fun

svn path=/branches/reactos-yarotows/; revision=46906
2010-04-17 15:24:10 +00:00
Jérôme Gardou 0cdfd4399d [WIN32K]
- Introduce DC_vPrepareDCsForBlit and DC_vFinishBlit and use them in NtGdiAlphaBlend
  - Get rid of now unnecessary call for MouseSafetyOnDraw{Start,End} in IntEngAlphaBlend
  - Yet Another Rewrite of GDIOBJ_LockMultipleObjs :-/ and use it in NtGdiAlphaBlend

svn path=/branches/reactos-yarotows/; revision=46902
2010-04-17 14:20:48 +00:00
Jérôme Gardou a4e83efd83 [WIN32K]
- Introduce deadlocks killer GDIOBJ_LockMultipleObjs, unused for now
  - Make the PDEVOBJ DCs list a sorted list
Didicated to Physicus

svn path=/branches/reactos-yarotows/; revision=46891
2010-04-15 22:38:04 +00:00
Jérôme Gardou c3731e5552 [WIN32K]
- get rid of ROS_DC::BitsPerPixel.
1 - It was a hack.
2 - Its use was inconsistent.

svn path=/branches/reactos-yarotows/; revision=46848
2010-04-12 18:44:36 +00:00
Jérôme Gardou c9353947a1 completely revert 46733
svn path=/branches/reactos-yarotows/; revision=46846
2010-04-11 21:32:53 +00:00
Jérôme Gardou 243eeb574a [WIN32K]
-Make direct DC release shared lock on surface each time they're unlocked.
  -Now they don't hold it unless they're locked themselves.
  -Do not create the device surface when switching modes, this is inconsistent with the PDEVOBJ creation, which does not.

*No more "you are freeing a surface which is still hold" debug message when switching modes*

svn path=/branches/reactos-yarotows/; revision=46733
2010-04-05 10:58:43 +00:00
Jérôme Gardou 6638a5b899 Sync with trunk (aka 'I want my virtualbox mouse integration too')
svn path=/branches/reactos-yarotows/; revision=46732
2010-04-05 09:59:21 +00:00
Jérôme Gardou 736c7b0111 [WIN32K]
Unlock/lock surface when locking DC

svn path=/branches/reactos-yarotows/; revision=46697
2010-04-03 16:32:30 +00:00
Timo Kreuzer 705ea2a9c3 [WIN32K]
- EngAcquireSemaphoreShared: update dwEngAcquireCount
- DC_LockDc/DC_UnlockDc: Acquire PDEV lock only for direct DCs, in that case also update the pSurface pointer
- When copying DC states, copy the surface only for memory dcs
- after switching the mode, update system metrics and redraw the desktop window.
- Remove testdraw code.

svn path=/branches/reactos-yarotows/; revision=46658
2010-04-01 22:36:40 +00:00