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

viewer: Support Retina/HiDPI thumbnails #6025

Merged
merged 1 commit into from
May 19, 2015

Conversation

mcorb
Copy link
Contributor

@mcorb mcorb commented May 16, 2015

Reuse the existing getOutputScale() machinery to render and/or rescale
thumbnail images to the native display resolution. Fixes blurry thumbnails on
HiDPI displays making it a lot easier to make out the content.

@mcorb mcorb force-pushed the retina-thumbnails branch from 70776f2 to 994b415 Compare May 16, 2015 14:20
@mcorb
Copy link
Contributor Author

mcorb commented May 16, 2015

Recommend merging #6026 alongside this to avoid UI stutter on lower end HiDPI systems.

return canvas.getContext('2d');
var ctx = canvas.getContext('2d');
var outputScale = getOutputScale(ctx);
canvas.width = this.canvasWidth * outputScale.sx;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure that canvas.width is an integer, by changing this line to:

canvas.width = (this.canvasWidth * outputScale.sx) | 0;

And similar for canvas.height on the next line.

Reuse the existing getOutputScale() machinery to render and/or rescale
thumbnail images to the native display resolution. Fixes blurry thumbnails on
HiDPI displays making it a lot easier to make out the content.
@mcorb mcorb force-pushed the retina-thumbnails branch from 8d593b8 to 357ee6c Compare May 18, 2015 14:14
@mcorb
Copy link
Contributor Author

mcorb commented May 19, 2015

Thanks for the review comments @Snuffleupagus. All points addressed and commits are now squashed.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/5679bd047e9ce34/output.txt

timvandermeij added a commit that referenced this pull request May 19, 2015
viewer: Support Retina/HiDPI thumbnails
@timvandermeij timvandermeij merged commit 82536f8 into mozilla:master May 19, 2015
@timvandermeij
Copy link
Contributor

Thank you for the patch!

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

Successfully merging this pull request may close these issues.

4 participants