Fix white flash when takePlayerScreenShot is used with CEF browsers#5004
Open
QueryOfficial wants to merge 1 commit into
Open
Fix white flash when takePlayerScreenShot is used with CEF browsers#5004QueryOfficial wants to merge 1 commit into
QueryOfficial wants to merge 1 commit into
Conversation
…e clearing methods This commit removes the OnPreScreenshot, OnPostScreenshot, and ClearTextures methods from CWebCore and CWebView classes. The changes streamline the code by eliminating unused functionality related to screenshot processing and texture management, improving overall maintainability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove the pre/post screenshot hooks that cleared live CEF render targets before
takePlayerScreenShotcapture. The back buffer is now grabbed as-is afterDrawPreGUIQueue, eliminating the visible white flash when a CEF browser is on screen.Also removes the now-unused
OnPreScreenshot,OnPostScreenshot,ClearTextures, andClearTexturecode paths.Motivation
When the server calls
takePlayerScreenShotwhile a client has a CEF browser displayed viacreateBrowser+dxDrawImage, the player's screen briefly flashes white on every capture.The old flow cleared live CEF textures to white (
0xFF) before reading the back buffer, then triggered an asyncInvalidateto repaint them. That touched the same textures used for on-screen rendering in the same frame, so the flash was visible to the player.This change captures the back buffer without modifying live CEF textures. Screenshot upload continues to work; only the visible flash is removed.
Fixes #4955
Test plan
Create a CEF browser on the client and draw it with
dxDrawImage. CalltakePlayerScreenShotfrom the server repeatedly and confirm no white flash appears on the client.Confirm the server still receives the screenshot with correct game content.
Test downscaled capture with
takePlayerScreenShot(player, 320, 240, ...).Regression: F12 local screenshot still works.
Regression: alt-tab / minimized client still returns
MINIMIZED/DISABLEDresponses as before.Checklist