If no bitmap buffer size is provided (e.g. allocation path from EngCreateBitmap), do not validate that the size calculation is valid. Should fix some display drivers, like Radeon IGP 320M.
See CORE-13036, CORE-11676
CORE-20231
Tests show this is allowed on Windows and even Wine. Also, official MS
Windows SDK headers indicate that the `CreateHalftonePalette()` `hDC`
parameter is optional, and so can be NULL.
Not allowing a NULL `hDC` caused compatibility issues, breaking applications
like Internet Explorer 8.0 and Microsoft Encarta.
Make `NtGdiCreateHalftonePalette()` accept a NULL `hDC`, fixing its crash
in this case, and only locking it when it's not NULL. Simplify also the
function execution path.
Co-authored-by: Simone Mario Lombardo <[email protected]>
The mask bounds check in `DIB_XXBPP_StretchBlt` allowed `sx == cx` (and similar for `sy`),
reading one pixel past the end of the mask bitmap.
On the contrary, the source-surface check a few lines below already does it right.
- Use shared locks for the display device and PDEV lookup paths.
These functions only walk existing lists and take references, while list updates
and mode-switch paths still use exclusive locking.
This avoids serializing read-only display queries unnecessarily.
- Use shared locks for other read-only NtUser calls.
Use pdc->ptlFillOrigin (which is adjusted by the Window origin already) instead of pdc->pdcattr->ptlBrushOrigin.
Fixes several gdiplus_winetest:brush tests
Improve simplicity for future.
JIRA issue: CORE-8466
- Remove the 1st parameter (PDC) of
TextIntUpdateSize function.
- Remove the 1st parameter (PDC) of
IntRequestFontSize function.
CORE-20553
Fix PolylineTo and PolyBezierTo based on Wine 10.0.
Include starting point in the "POINTS" variable being passed to PolylineTo and PolyBezierTo.
Handle the starting point as the origin for drawing the lines.
A bug fix of FontLink'ed glyph size.
JIRA issue: CORE-20470
- Add FONTLINK_ENTRY structure
and g_FontLinkEntries variable.
- Delete font-link cache mechanism.
- Don't access the registry while
rendering is in progress.
- Request sub-font sizes while
drawing FontLink text.
#8641 introduced some bugs. We revert it.
JIRA issue: CORE-20538
- Delete FONT_LOOKUP_CACHE and
s_FontLookupCacheList.
- Delete FontLookUp_... functions.
- Revert FontLink_PrepareFontInfo and
TextIntRealizeFont functions.
Make code faster and improve readability.
JIRA issue: N/A
- Avoid buffer allocation by using
stack variables if possible.
- Add IntGetFontDefaultChar helper
function and use it.
Follow-up of #8641. Reduce freetype.c lines.
JIRA issue: CORE-19898
- Follow @HBelusca's review in #8641.
- Move some codes in freetype.c into utils.c.
Text rendering speed is justice! Font
search is heavy operation. Adding
cache to it is rational.
JIRA issue: CORE-19898
- Define FONT_LOOKUP_CACHE
structure.
- Add s_FontLookupCacheList
global variable to save cache.
- Use cache in FontLink_PrepareFontInfo
and TextIntRealizeFont.
According to the kerestorefloatingpointstate msdn article shouldn't be on the kernel's responsibility to handle. for the life of me i couldn't figure out why this specific driver does this until finally I tried this on Windows and low and behold on checked builds of windows it actually tells you it does the exact same thing. Investigating deeper I realized win32k just has some extra handling for this dumb case.
Co-authored-by: Hermès BÉLUSCA - MAÏTO <[email protected]>
Co-authored-by: Timo Kreuzer <[email protected]>
This commit attempts to resolve two regressions and improve realhw behavior
A PNP_DETECTED_FATAL_ERROR bug check caused by the monitor device instance being duplicated.
https://jira.reactos.org/browse/CORE-20410
this is mostly due to ChildID being overwritten with the same bus/slot when 2 monitors are attached to one GPU
And video drivers failing to startup after calling VideoPortCreateSecondaryDisplay
Co-authored-by: Dmitry Borisov <[email protected]>
Co-authored-by: Hermès BÉLUSCA - MAÏTO <[email protected]>
- In the `if (!psurf)` code path, unlock in the reverse locking order.
- Move the `SafeInData == NULL` check outside of `_SEH2_TRY` and just
after the `ExAllocatePoolWithTag` call.
- Removing trailing whitespace.
* [WIN32SS] Minimal pass of fixing ExtEscape
Resolves issues with the AMD/ATI GPU Driver and the Intel OpenGL ICD when used in fullscreen mode.
Co-authored-by: Hermès BÉLUSCA - MAÏTO <[email protected]>
Pass it to EXLATEOBJ_vInitXlateFromDCsEx, which uses it (or, if it's CLR_INVALID, the source DC's background color) to initialize the EXLATEOBJ.
Adjust all callers to pass CLR_INVALID instead of 0.
This is mostly an optimization, as translation from RGB to mono are much faster than generic indexed palettes.
It exposes a broken RGB-to-mono translation though, which previously was hidden for DIB sections, which didn't mark the palette as mono, therefore taking the slow index path, which worked correctly.
Don't offset the rectangle's top left point to the current dithering point, since it's already done now in Gre part of the function.
This fixes broken gradient captions after the previous commit, in case when Drv implementation is not provided by a display/video driver and Eng function is used instead.
CORE-14927, CORE-15341
- Offset vertex array to the current DC's coordinates for rectangular gradients. Don't change anything for triangular gradients. This is more correct regarding to how Windows XP/2003 handles that and debugging analysis shows the same behaviour there.
- Additionally, fix checking mode condition for triangles on parameters validation. It should actually be checked for an equalness, not via bitwise "OR", since only one mode type can be set for ulMode parameter for GradientFill() according to MSDN.
This avoids incorrect gradient coordinates passed to DrvGradientFill() in case it's supported by the display/video driver, so now gradients are drawing at the correct position as they should.
Hence, this fixes broken gradients in window captions (always painted at the top left corner) on real hardware with native video drivers (AMD/ATI/Intel/Nvidia etc.). Tested successfully on Asus-F5R notebook with ATI Radeon XPress 1100 + ATI Catalyst 10.2 video driver at least.
CORE-14927, CORE-15341
CORE-20336
Move some code in win32ss/gdi/ntgdi/dibobj.c into win32ss/gdi/gdi32/objects/bitmap.c.
Condition "YSrc = 0;" on "if (Height + YDest + 1 < ScanLines)" which fixes some gdi32:bitmap regressions.