Commit f297829c authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

[PaintWorklet] Add some comments for effective_zoom_

It is not obvious why we need to account for effective_zoom_ for the
shadows in the CSS Paint API, but not for line width. This CL adds some
comments to ensure the knowledge won't be lost.

Bug: None
Change-Id: Ibc5086449a929af0d7877874aaec482a2487ab92
Reviewed-on: https://chromium-review.googlesource.com/1090791
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565346}
parent 3028a826
...@@ -69,6 +69,11 @@ bool PaintRenderingContext2D::ParseColorOrCurrentColor( ...@@ -69,6 +69,11 @@ bool PaintRenderingContext2D::ParseColorOrCurrentColor(
return ::blink::ParseColorOrCurrentColor(color, color_string, nullptr); return ::blink::ParseColorOrCurrentColor(color, color_string, nullptr);
} }
// We need to account for the |effective_zoom_| for shadow effects only, and not
// for line width. This is because the line width is affected by skia's current
// transform matrix (CTM) while shadows are not. The skia's CTM combines both
// the canvas context transform and the CSS layout transform. That means, the
// |effective_zoom_| is implictly applied to line width through CTM.
double PaintRenderingContext2D::shadowBlur() const { double PaintRenderingContext2D::shadowBlur() const {
return BaseRenderingContext2D::shadowBlur() / effective_zoom_; return BaseRenderingContext2D::shadowBlur() / effective_zoom_;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment