Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_UpdateWindowSurfaceRects BitBlt the entire surface on Win32. #3663

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

SDL_UpdateWindowSurfaceRects BitBlt the entire surface on Win32. #3663

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 11, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: Windows (All), x86_64

Comments on the original bug report:

On 2020-04-27 03:46:02 +0000, Ryan C. Gordon wrote:

As discussed here:

https://discourse.libsdl.org/t/question-about-implementation-of-sdl-updatewindowsurfacerects/27561

"As you can see this function [WIN_UpdateWindowFramebuffer, in src/video/windows/SDL_windowsframebuffer.c] calls BitBlt on entire screen, even though it accepts the rects. Rects variable is not even used in this function at all. Now my question is why is that the case?"

--ryan.

On 2020-04-27 16:36:55 +0000, Jay Petacat wrote:

From a porter's perspective, I'd be curious to know what UpdateWindowFramebuffer ought to do if the platform does not cleanly support partial updates to the screen. Is the Rects argument intended to be only a hint for optimization, or is it a requirement that the function not "color outside the lines" defined by Rects?

Like Win32, my DOS port ignores the Rects argument, copies the entire surface to the back buffer, then does a page flip. If the area outside of Rects is not supposed to be mutated, there's a potential problem where the back buffer may not match the front buffer. I could first copy that area of the front buffer to the back buffer before the page flip, but that seems counter-productive from a performance perspective.

On 2020-04-29 21:30:03 +0000, Sam Lantinga wrote:

The rects argument is just supposed to be an optimization. Conceptually the entire back buffer is reflected to the front buffer.

On 2020-05-17 20:56:47 +0000, Rene Dudfield wrote:

Created attachment 4346
Windows SDL_UpdateWindowSurfaceRects to only do updates of rects passed in.

Here's a patch.

On 2020-05-18 16:06:05 +0000, Josip Komljenović wrote:

Hi, I am the original poster of the bug on the forum and if I install the patch Rene Dudfield did I get the correct results for SDL_UpdateWindowSurfaceRects function. If this passes your tests I would be glad if you merge it in the next SDL official release. Thank you all for your work on this bug, I know this function is not used very much, so I am really glad you managed to fix it so soon.

On 2020-05-30 04:27:33 +0000, Sam Lantinga wrote:

That patch would not have compiled as-is, so I fixed and committed it:
https://hg.libsdl.org/SDL/rev/ba1ed72249c0

Thanks!

On 2020-05-30 08:38:39 +0000, Rene Dudfield wrote:

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant