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

DRAFT/Discovery: render elements to 2d canvas #4024

Closed

Conversation

dvoytenko
Copy link

@dvoytenko dvoytenko commented Jan 3, 2020

Summary

Partial for #3803

A quick exploration for 2d rendering for editor elements. The main goal is the contrast detection, but could also be useful for page thumbnail generation.

There's not much unexpected here. The only smallish caveats:

  1. Everything should always be untainted. We should get this for free for fonts and for all media coming from media library.
  2. We always have to wait for media and fonts to load before rendering. So, the rendering is a single-critical-path queue.
  3. Rendering of wrapped/centered/tokenized HTML with correct line height is will be a headache. So it depends on how "perfect" we need the rendered canvas to be comparing to HTML version. For contrast detection and even thumbnails, arguably, we need only a good approximate quality.

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@googlebot googlebot added the cla: yes Signed the Google CLA label Jan 3, 2020
@swissspidy swissspidy added the Stories Stories Editor label Jan 6, 2020
@dvoytenko dvoytenko changed the title Discovery: render elements to 2d canvas DRAFT/Discovery: render elements to 2d canvas Jan 8, 2020
@swissspidy swissspidy closed this Feb 18, 2020
@swissspidy swissspidy added AMP Stories (obsolete) and removed Stories Stories Editor labels Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Signed the Google CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants