Fix OnAcceleratedPaint2() not being called when there's no new texture #1
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.
Description
This pull request fixes libcef_dll wrapped calls of OnAcceleratedPaint2() failing parameter checks if shared_handle is null even when new_texture is false (where this is expected). It's pretty much just adjusting the check to how it was in the initial on-accelerated-paint2 branch.
Motivation and Context
Without this change, OnAcceleratedPaint2() is only called when the texture changed. This currently does not appear to be a problem for obs-browser, admittedly, but since it silently fails in release builds and for the sake of correctness, I believe it's worth fixing.
It might also help in the future when there's going to be some kind of compositing going on (like overlaying PET_POPUP elements as there's a todo-comment for).
And while I don't expect this to be intended or supported use in any way, I've been making use of this CEF fork in my own project. If possible I'd like to avoid maintaining a fork on top of a fork for a couple of changed lines, but I realize I'm on my own making use of your work here.
How Has This Been Tested?
I've tested the change on Windows 10 with obs-browser, as well as in my own project (Desktop+ Browser), by checking if the browser output still works while making sure hardware acceleration and OnAcceleratedPaint2() is being used.
As there are no functional changes for obs-browser, there's not much of an effect there right now, except that OnAcceleratedPaint2() gets called for every frame update again (but always just returns when new_texture is false right now).
Types of changes
Checklist: