Davejkane / riv

Riv - The Rust Image Viewer
MIT License
99 stars 10 forks source link

Implement Flip Horizontal and Vertical #92

Closed gurgalex closed 5 years ago

gurgalex commented 5 years ago

This PR closes #88

Only issue I've seen is that flipping while zoomed in requires a bunch of GPU memory. SDL2 fails to render the image saying that it is Out of Memory.

gurgalex commented 5 years ago

I encountered the slowness in Dev builds, but very little in release mode.

On Sun, Jun 2, 2019, 12:11 Davejkane notifications@github.com wrote:

@Davejkane commented on this pull request.

That's really weird with how slow it goes on zoomed flipped images. Is there anything that can be done about that?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Davejkane/riv/pull/92?email_source=notifications&email_token=AG5ANRFU4Y4UXU4UDH2PATLPYP5MHA5CNFSM4HSCXHF2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2KNKGI#pullrequestreview-244634905, or mute the thread https://github.com/notifications/unsubscribe-auth/AG5ANRCHHPBZM7I3SMDXMSTPYP5MHANCNFSM4HSCXHFQ .

Davejkane commented 5 years ago

I always build release mode, and when I flipped an image and then zoomed in, the zooming is way noticeably slower, and almost grinds to a halt while still not crazy zoomed.

gurgalex commented 5 years ago

You're right.

On Sun, Jun 2, 2019, 13:29 Davejkane notifications@github.com wrote:

I always build release mode, and when I flipped an image and then zoomed in, the zooming is way noticeably slower, and almost grinds to a halt while still not crazy zoomed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Davejkane/riv/pull/92?email_source=notifications&email_token=AG5ANRFEC7FLEQ7WFDJINZDPYQGSNA5CNFSM4HSCXHF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWX3LEA#issuecomment-498054544, or mute the thread https://github.com/notifications/unsubscribe-auth/AG5ANRAB3NOIYMX4T7UCCOLPYQGSNANCNFSM4HSCXHFQ .

Davejkane commented 5 years ago

That really fixed it.

gurgalex commented 5 years ago

Switching to hardware acceleration seemed to resolve the slow images.

However, images larger than 16384 in either dimension will no longer be supported by the program. We'd need to render the images in multiple parts.

Failed to render image Texture dimensions are limited to 16384x16384
gurgalex commented 5 years ago

@Davejkane I think my issue should be handled in a separate PR.

Davejkane commented 5 years ago

Haha, where did you even find a picture that big! What do you want the separate PR to be, handling huge images, or handling slow zoom on flipped pictures?

gurgalex commented 5 years ago

@Davejkane The separate issue should be handling images larger than the GPU can render in one go. info here

I took a snapshot with dev tools of a really long blog post. screencapture-hoverbear-org-2016-10-12-rust-state-machine-pattern-2019-05-25-19_57_08