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

OPENGL: Ensure surfaces created by saveScreenshot are the right way up #1939

Merged
merged 2 commits into from Jan 2, 2020

Conversation

@ccawley2011
Copy link
Member

ccawley2011 commented Nov 16, 2019

This removes the need to flip surfaces the right way up in writePNG() or writeBMP().

data.init(width, height, lineSize, &pixels.front(), format);
data.create(width, height, format);
for (uint y = 0; y < height; ++y) {
GL_CALL(glReadPixels(0, height - y - 1, width, 1, GL_RGB, GL_UNSIGNED_BYTE, data.getBasePtr(0, y)));

This comment has been minimized.

Copy link
@bgK

bgK Nov 16, 2019

Member

glReadPixels usually generates a VRAM -> RAM transfer. Having one such transfer per line does not seem to be very good for performance. Perhaps it would be better to have a function that vertically flips a surface in-place on the CPU if we want to remove that responsibility from the image codecs.

This comment has been minimized.

Copy link
@ccawley2011

ccawley2011 Dec 19, 2019

Author Member

OK, done.

@ccawley2011 ccawley2011 force-pushed the ccawley2011:opengl-screenshot branch from 38394f6 to d6f43d9 Dec 19, 2019
@bluegr

This comment has been minimized.

Copy link
Member

bluegr commented Jan 2, 2020

Thanks for addressing the issues mentioned. This is good to be merged now

@bluegr bluegr merged commit d289fa5 into scummvm:master Jan 2, 2020
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
@ccawley2011 ccawley2011 deleted the ccawley2011:opengl-screenshot branch Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.