From 09bd3e2b8e46e8dd0ea2d81f03daae4c6fdb8667 Mon Sep 17 00:00:00 2001 From: Xida Chen Date: Tue, 14 Nov 2017 10:48:38 -0500 Subject: [PATCH 1/6] changed to snapped concret size --- css-paint-api/Overview.bs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/css-paint-api/Overview.bs b/css-paint-api/Overview.bs index 944a9ca0..5890687c 100644 --- a/css-paint-api/Overview.bs +++ b/css-paint-api/Overview.bs @@ -451,8 +451,9 @@ Note: The user agent can optionally defer drawing images which are paint-inva The draw a paint image function is invoked by the user agent during the object size -negotiation algorithm which is responsible for rendering an <>, with |concreteObjectSize| -set to the concrete object size of the box. +negotiation algorithm which is responsible for rendering an <>, with |snappedConcreteObjectSize| +set to the rounded concrete object size of the box, divided by the +{{PaintWorkletGlobalScope/devicePixelRatio}}. For the purposes of the object size negotiation algorithm, the paint image has no intrinsic dimensions. @@ -463,15 +464,15 @@ Note: In a future version of the spec, the author could have the ability to spec dimensions based on computed style and size changes. The {{PaintSize}} object represents the size of the image that the author should draw. This is -the concrete object size given by the user agent. +the |snappedConcreteObjectSize| given by the user agent. Note: See [[css-images-3#object-sizing-examples]] for examples on how the concrete object size is calculated. The draw a paint image function may be speculatively invoked by the user agent at any point, -with any |concreteObjectSize|. The resulting image is not displayed. +with any |snappedConcreteObjectSize|. The resulting image is not displayed. -Note: User agents may use any heuristic to speculate a possible future value for |concretObjectSize|, +Note: User agents may use any heuristic to speculate a possible future value for |snappedConcretObjectSize|, for example speculating that the size remains unchanged. Note: Although the image is not displayed, it may still be cached, and subsequent invocations of @@ -488,12 +489,12 @@ interface PaintSize {
When the user agent wants to draw a paint image of a <> function for a |box| into its appropriate stacking level (as defined by the property the CSS property its associated -with), given |concreteObjectSize| it must run the following steps: +with), given |snappedConcreteObjectSize| it must run the following steps: 1. Let |paintFunction| be the <> function on the |box| which the user agent wants to draw. 2. If the paint valid flag for the |paintFunction| is paint-valid, and the - previous invocation had the same |concreteObjectSize|, the user agent may use the + previous invocation had the same |snappedConcreteObjectSize|, the user agent may use the drawn image from the previous invocation. If so it may abort all these steps and use the previously drawn image. @@ -572,7 +573,7 @@ with), given |concreteObjectSize| it must run the following steps: The user agent may also create a WorkletGlobalScope at this time, given the paint {{Worklet}}. - 13. Run invoke a paint callback given |name|, |inputArguments|, |concreteObjectSize|, + 13. Run invoke a paint callback given |name|, |inputArguments|, |snappedConcreteObjectSize|, |workletGlobalScope| optionally in parallel. Note: If the user agent runs invoke a paint callback on a thread in parallel, @@ -581,7 +582,7 @@ with), given |concreteObjectSize| it must run the following steps:
When the user agent wants to invoke a paint callback given |name|, |inputArguments|, -|concreteObjectSize|, and |workletGlobalScope|, it must run the following steps: +|snappedConcreteObjectSize|, and |workletGlobalScope|, it must run the following steps: 1. Let |paintDefinitionMap| be |workletGlobalScope|'s paint definitions map. @@ -630,8 +631,8 @@ When the user agent wants to invoke a paint callback given |name|, |i computed value's for properties listed in |inputProperties|. 8. Let |renderingContext| be the result of create a PaintRenderingContext2D object given: - - "width" - The width given by |concreteObjectSize|. - - "height" - The height given by |concreteObjectSize|. + - "width" - The rounded value of the width given by |snappedConcreteObjectSize|. + - "height" - The rounded value of the height given by |snappedConcreteObjectSize|. - "paintRenderingContext2DSettings" - The PaintRenderingContext2DSettings object given by |definition|. @@ -646,7 +647,7 @@ When the user agent wants to invoke a paint callback given |name|, |i images. 9. Let |paintSize| be a new {{PaintSize}} initialized to the width and height defined by - |concreteObjectSize|. + |snappedConcreteObjectSize|. 10. At this stage the user agent may re-use an image from a previous invocation if |paintSize|, |styleMap|, |inputArguments| are equivalent to that previous invocation. If so let the image From ece4b779bf0421ded8d008269322181be24e97fc Mon Sep 17 00:00:00 2001 From: Xida Chen Date: Tue, 14 Nov 2017 12:59:00 -0500 Subject: [PATCH 2/6] updated rendering context width height --- css-paint-api/Overview.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css-paint-api/Overview.bs b/css-paint-api/Overview.bs index 5890687c..93aad1f0 100644 --- a/css-paint-api/Overview.bs +++ b/css-paint-api/Overview.bs @@ -631,8 +631,8 @@ When the user agent wants to invoke a paint callback given |name|, |i computed value's for properties listed in |inputProperties|. 8. Let |renderingContext| be the result of create a PaintRenderingContext2D object given: - - "width" - The rounded value of the width given by |snappedConcreteObjectSize|. - - "height" - The rounded value of the height given by |snappedConcreteObjectSize|. + - "width" - The width given by |concreteObjectSize|. + - "height" - The height given by |concreteObjectSize|. - "paintRenderingContext2DSettings" - The PaintRenderingContext2DSettings object given by |definition|. From afc97a4482ced0bfd82680e861935dfde9a76410 Mon Sep 17 00:00:00 2001 From: Xida Chen Date: Thu, 16 Nov 2017 11:03:10 -0500 Subject: [PATCH 3/6] change the description of snappedConcreteObjectSize --- css-paint-api/Overview.bs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/css-paint-api/Overview.bs b/css-paint-api/Overview.bs index 93aad1f0..94ed015f 100644 --- a/css-paint-api/Overview.bs +++ b/css-paint-api/Overview.bs @@ -452,7 +452,10 @@ Note: The user agent can optionally defer drawing images which are paint-inva The draw a paint image function is invoked by the user agent during the object size negotiation algorithm which is responsible for rendering an <>, with |snappedConcreteObjectSize| -set to the rounded concrete object size of the box, divided by the +defined as follows. Let |concreateObjectSize| be the concrete object size of the box, 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}}. For the purposes of the object size negotiation algorithm, the paint image has no @@ -631,7 +634,7 @@ When the user agent wants to invoke a paint callback given |name|, |i computed value's for properties listed in |inputProperties|. 8. Let |renderingContext| be the result of create a PaintRenderingContext2D object given: - - "width" - The width given by |concreteObjectSize|. + - "width" - The width given by |concreteObjectSize|. - "height" - The height given by |concreteObjectSize|. - "paintRenderingContext2DSettings" - The PaintRenderingContext2DSettings object given by |definition|. From 5ae88e0ef20a4335a6608bcdce271cf238e7519c Mon Sep 17 00:00:00 2001 From: Xida Chen Date: Thu, 16 Nov 2017 13:46:05 -0500 Subject: [PATCH 4/6] change the description --- css-paint-api/Overview.bs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/css-paint-api/Overview.bs b/css-paint-api/Overview.bs index 94ed015f..93f639c9 100644 --- a/css-paint-api/Overview.bs +++ b/css-paint-api/Overview.bs @@ -452,11 +452,11 @@ Note: The user agent can optionally defer drawing images which are paint-inva The draw a paint image function is invoked by the user agent during the object size negotiation algorithm which is responsible for rendering an <>, with |snappedConcreteObjectSize| -defined as follows. Let |concreateObjectSize| be the concrete object size of the box, 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 concrete object size of the box. +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 <> function can adjust the drawing accordingly. For the purposes of the object size negotiation algorithm, the paint image has no intrinsic dimensions. From 738c81bd860b08b553a2a030e7ab1c42ce45c9a3 Mon Sep 17 00:00:00 2001 From: Xida Chen Date: Thu, 16 Nov 2017 14:17:40 -0500 Subject: [PATCH 5/6] fix typo --- css-paint-api/Overview.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css-paint-api/Overview.bs b/css-paint-api/Overview.bs index 93f639c9..da120298 100644 --- a/css-paint-api/Overview.bs +++ b/css-paint-api/Overview.bs @@ -452,8 +452,8 @@ Note: The user agent can optionally defer drawing images which are paint-inva The draw a paint image function is invoked by the user agent during the object size negotiation algorithm which is responsible for rendering an <>, with |snappedConcreteObjectSize| -defined as follows. Let |concreateObjectSize| be the concrete object size of the box. -The |snappedConcreateObjectSize| is usually the same as the |concreateObjectSize|. However, the +defined as follows. Let |concreteObjectSize| be the concrete object size of the box. +The |snappedConcreateObjectSize| is usually the same as the |concreteObjectSize|. 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 <> function can adjust the drawing accordingly. From 9413d54dcfd77e219ac80ffe3b991f33b0781b94 Mon Sep 17 00:00:00 2001 From: Xida Chen Date: Thu, 16 Nov 2017 14:22:06 -0500 Subject: [PATCH 6/6] fix more typo --- css-paint-api/Overview.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css-paint-api/Overview.bs b/css-paint-api/Overview.bs index da120298..16c2fe4f 100644 --- a/css-paint-api/Overview.bs +++ b/css-paint-api/Overview.bs @@ -453,9 +453,9 @@ Note: The user agent can optionally defer drawing images which are paint-inva The draw a paint image function is invoked by the user agent during the object size negotiation algorithm which is responsible for rendering an <>, with |snappedConcreteObjectSize| defined as follows. Let |concreteObjectSize| be the concrete object size of the box. -The |snappedConcreateObjectSize| is usually the same as the |concreteObjectSize|. However, the +The |snappedConcreteObjectSize| is usually the same as the |concreteObjectSize|. 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 +should adjust the |snappedConcreteObjectSize| by the proportional change from its original size such that the <> function can adjust the drawing accordingly. For the purposes of the object size negotiation algorithm, the paint image has no