Skip to content

[CSS Paint API] Pass snapped concrete size to paint function #518

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

Merged
merged 6 commits into from
Apr 5, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions css-paint-api/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,11 @@ Note: The user agent can optionally defer drawing images which are <a>paint-inva

The <a>draw a paint image</a> function is invoked by the user agent during the <a>object size
negotiation</a> algorithm which is responsible for rendering an <<image>>, with |snappedConcreteObjectSize|
defined as follows. Let |concreateObjectSize| be the <a>concrete object size</a> of the <a>box</a>, and
|deviceObjectSize| be the |concreateObjectSize| multiplied by the {{PaintWorkletGlobalScope/devicePixelRatio}}.
If the |deviceObjectSize| is non-integral, then adjust it to align with pixel boundary. Finally, set
|snappedConcreateObjectSize| to the adjusted |deviceObjectSize| divided by the
{{PaintWorkletGlobalScope/devicePixelRatio}}.
defined as follows. Let |concreateObjectSize| be the <a>concrete object size</a> of the <a>box</a>.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/concreateObjectSize/concreteObjectSize/ here and below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed :)

The |snappedConcreateObjectSize| is usually the same as the |concreateObjectSize|. However, the
user agent may adjust the size such that it paints to pixel boundaries. If it does, the user agent
should adjust the |snappedConcreateObjectSize| by the proportional change from its original size
such that the <<paint()>> function can adjust the drawing accordingly.

For the purposes of the <a>object size negotiation</a> algorithm, the paint image has no
<a>intrinsic dimensions</a>.
Expand Down