diff options
author | Jeremy Chen <jeremychen@mozilla.com> | 2017-10-18 19:02:10 +0800 |
---|---|---|
committer | Jeremy Chen <jeremychen@mozilla.com> | 2017-10-20 15:04:43 +0800 |
commit | d7a5f224082341f7dbb8cb66c9bdc0f5cacc64ff (patch) | |
tree | 5a94d6ee4775900e5ba2897276413dcf61c7b46e /components/script/layout_image.rs | |
parent | 21926e0008d2ae67ad21b73f080eadc2ef82d958 (diff) | |
download | servo-d7a5f224082341f7dbb8cb66c9bdc0f5cacc64ff.tar.gz servo-d7a5f224082341f7dbb8cb66c9bdc0f5cacc64ff.zip |
stylo: Avoid using InterpolateMatrix as a fallback for matched transform function pair.
In the current implementation, if there is any interpolation error in a matched
transform function pair, we fall-back to use InterpolateMatrix unconditionally.
However, the error could be caused by:
1. mismatched transform function pair
2. matched transform function pair within at least one undecomposable matrix.
Using InterpolateMatrix for case 1 makes sense, however, using InterpolateMatrix
for case 2 does not. According to the spec, we should just report error for
case 2, and let the caller do the fallback procedure. Using InterpolateMatrix
for case 2 will go through more unnecessary code path, and produce more memory
usage and calculation cost, which should be avoidable.
In this patch, we add an extra pass to check if a transform function pair have
matched operations in advance. With this information, we can easily tell whether
the interpolation error in a equal-length transform function pair is caused by
case 1 or case 2. So, we can avoid the unnecessary cost.
Gecko bug: Bug 1399049
Diffstat (limited to 'components/script/layout_image.rs')
0 files changed, 0 insertions, 0 deletions