From d0d02cd56cb646da1f2193e57561b78d5e4b6bdf Mon Sep 17 00:00:00 2001
From: Servo WPT Sync <32481905+servo-wpt-sync@users.noreply.github.com>
Date: Sun, 20 Oct 2024 03:33:44 +0200
Subject: [PATCH] Update web-platform-tests to revision
b'5a9d9349a312e12a950d5f4703cd41609a06f242' (#33923)
Signed-off-by: WPT Sync Bot Test hello hello Test Test passes if there is a filled green square and no red. Test passes if there is a filled green square and no red. Test passes if there is a filled green square and no red.
+
+
+
+
Line3
Line6
Test passes if there is a filled green square.
+Test passes if there is a filled green square.
+ +Test passes if there is a filled green square.
+ +Test passes if there is a filled green square and no red.
+Expected: A green box with an overlapping purple box.
The overlapping portion of the boxes should be bright magenta.
diff --git a/tests/wpt/tests/custom-elements/CustomElementRegistry.html b/tests/wpt/tests/custom-elements/CustomElementRegistry.html
index 5b75fc651fc..87da806bcab 100644
--- a/tests/wpt/tests/custom-elements/CustomElementRegistry.html
+++ b/tests/wpt/tests/custom-elements/CustomElementRegistry.html
@@ -11,6 +11,8 @@
{}
{}
", + "{}
{}
{}
{}
abc
", - "abc
"], + "abc
"], [true], {"inserthtml":[false,false,"",false,false,""]}], ["
{}
{}
12[]34", [["inserthtml","
abc"]], - ["
12abc34", - "
12abc34"], + "
12abc34", [true], {"inserthtml":[false,false,"",false,false,""]}], ["
1[23]4", [["inserthtml","
abc"]], - ["
1abc4", - "
1abc4"], + "
1abc4", [true], {"inserthtml":[false,false,"",false,false,""]}], ["
[1234]", [["inserthtml","
abc"]], - ["
abc", - "
abc"], + "
abc", [true], {"inserthtml":[false,false,"",false,false,""]}], ["
[1234]
",
[["inserthtml","abc"]], - ["
abc
",
- "abc
"],
+ "abc
",
[true],
{"inserthtml":[false,false,"",false,false,""]}],
// Empty inline elements shouldn't be deleted if they are inserted intentionally
["a
{}
ab
ab
", [true], {"inserttext":[false,false,"",false,false,""]}], -// In this case, the element aftera
{}
ab
a
b
c
c
bc
c
bc
A
aB
", "A
aB
A
aB
", "A
aB
A
aB\n
"], + expected: "A
aB
", }, { initialInnerHTML: "AB[]
", @@ -109,9 +125,7 @@ addEventListener("load", () => { insertText: "a", // To keep the style of next typing even after lost focus, the placeholder line break in // the empty paragraph after "insertParagraph" should be wrapped in the . - expected: useBR - ? ["AB
a
", "AB
a
AB
a
", "AB
a
AB
a\n
"], + expected: "AB
a
", }, { initialInnerHTML: "[AB]
", @@ -119,9 +133,8 @@ addEventListener("load", () => { prepare: () => document.execCommand("insertParagraph"), insertText: "a", expected: useBR - ? ["a
", "a
a
", "\n
a
", - "a
\n
a\n
"], + ? "a
" + : ["a
", "\n
a
"], }, { initialInnerHTML: "[]AB
", @@ -149,9 +162,8 @@ addEventListener("load", () => { // To keep the style of next typing even after once the paragraph becomes empty, // the placeholder line break (if there is) should be in . expected: useBR - ? ["AB
a
AB
a
AB
a
AB
a
AB\na
", - "AB\na\n
", "AB\na
AB
a\n
AB
a
AB
a
AB\na
"], }, { initialInnerHTML: "[AB]
", @@ -161,9 +173,8 @@ addEventListener("load", () => { // To keep the style of next typing even after once the paragraph becomes empty, // the placeholder line break (if there is) should be in . expected: useBR - ? ["
a
a
a
a
\na
", "\na\n
", - "
a\n
\na
a
a
\na
"], }, { initialInnerHTML: "[AB]
", @@ -172,9 +183,7 @@ addEventListener("load", () => { insertText: "a", // To keep the style of next typing even after blur, the placeholder line break // (if there is) should be in . - expected: useBR - ? ["a
", "a
a
", "a
a\n
"], + expected: "a
", }, { initialInnerHTML: "A[]
B
", @@ -186,9 +195,7 @@ addEventListener("load", () => { }, insertText: "a", // Moving caret shouldn't cause loosing the style. - expected: useBR - ? ["a
B
", "a
B
"] - : ["a
B
", "a
B
", "a\n
B
"], + expected: "a
B
", }, { initialInnerHTML: "[]A
B
", @@ -200,9 +207,7 @@ addEventListener("load", () => { }, insertText: "a", // Moving caret shouldn't cause loosing the style. - expected: useBR - ? ["a
B
", "a
B
"] - : ["a
B
", "a
B
", "a\n
B
"], + expected: "a
B
", }, { initialInnerHTML: "[A]
B
", @@ -214,9 +219,7 @@ addEventListener("load", () => { }, insertText: "a", // Moving caret shouldn't cause loosing the style. - expected: useBR - ? ["a
B
", "a
B
"] - : ["a
B
", "a
B
", "a\n
B
"], + expected: "a
B
", }, { initialInnerHTML: "A[]", @@ -228,11 +231,12 @@ addEventListener("load", () => { }, insertText: "a", // Moving caret shouldn't cause loosing the style. - expected: useBR - ? ["
A
a
", "A
a
A
a
", "A
a
A
a\n
"], + expected: "A
a
", }, ]) { + if (data.skipIf !== undefined && data.skipIf()) { + continue; + } test(() => { utils.setupEditingHost(data.initialInnerHTML); if (data.prepare) { @@ -244,8 +248,10 @@ addEventListener("load", () => { } else { assert_equals(editingHost.innerHTML, data.expected); } - }, `execCommand("insertText", false, "${data.insertText}") when ${data.initialInnerHTML}${ - data.prepareDescription ? ` and ${data.prepareDescription}` : "" + }, `execCommand("insertText", false, "${data.insertText.replaceAll("\n", "\\n")}") when ${ + data.initialInnerHTML.replaceAll("\n", "\\n") + }${ + data.prepareDescription ? ` and ${data.prepareDescription.replaceAll("\n", "\\n")}` : "" }`); promise_test(async t => { utils.setupEditingHost(data.initialInnerHTML); @@ -260,8 +266,10 @@ addEventListener("load", () => { } else { assert_equals(editingHost.innerHTML, data.expected); } - }, `Typing "${data.insertText}" when ${data.initialInnerHTML}${ - data.prepareDescription ? ` and ${data.prepareDescription}` : "" + }, `Typing "${data.insertText.replaceAll("\n", "\\n")}" when ${ + data.initialInnerHTML.replaceAll("\n", "\\n") + }${ + data.prepareDescription ? ` and ${data.prepareDescription.replaceAll("\n", "\\n")}` : "" }`); } }, {once: true}); diff --git a/tests/wpt/tests/eyedropper/idlharness.https.window.js b/tests/wpt/tests/eyedropper/idlharness.https.window.js new file mode 100644 index 00000000000..891d334e9f6 --- /dev/null +++ b/tests/wpt/tests/eyedropper/idlharness.https.window.js @@ -0,0 +1,7 @@ +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js + +idl_test( + ['eyedropper-api'], + [], +); diff --git a/tests/wpt/tests/fenced-frame/http-localhost-url.https.html b/tests/wpt/tests/fenced-frame/http-localhost-url.https.html new file mode 100644 index 00000000000..a8b16d75c85 --- /dev/null +++ b/tests/wpt/tests/fenced-frame/http-localhost-url.https.html @@ -0,0 +1,25 @@ + +&^>HMkRzyH?X4stq1Xk+mT$!acmh4X)|S!}s!S=jBv={FIcnXjI};31H} zz=4KI2&{L3yT3fFyVtLMws7jbUo+-CRDQ$Xus!E8Gs6L6Axx7wZiMQ+JHGySG;h(= zhg)D_RQEf3Vg32&wzJM}`5(-~Q37Bq6-W|m2-{UP+ + Canvas test: 2d.composite.grid.no_filter.no_shadow.fillRect +2d.composite.grid.no_filter.no_shadow.fillRect
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.html b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.html new file mode 100644 index 00000000000..e14c336868e --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.html @@ -0,0 +1,767 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.no_filter.no_shadow.fillRect +2d.composite.grid.no_filter.no_shadow.fillRect
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.png b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.png new file mode 100644 index 0000000000000000000000000000000000000000..ce392a1dcccc5e06a3d163dff873a5647ecdb65c GIT binary patch literal 1572 zcmeAS@N?(olHy`uVBq!ia0y~yV0-|?Ivi|35$S&kQ9z0<$=lt9;Xep2*t>i(0|V<# zPZ!6KiaBp@Z=85LOr$N)j?Y=$FO+@vgj*3Ccn&o>izk#Uyy%wKs9(xmB3ZC1W#^r} zEOirY)So8YzbbknUm#&KBhXwVP-pt~Qv2^p`*kMAL#tjVSFv4t{7?Dh-{Y6Iy<}u~ zAjxUKz`}us-)M=?kB{%$F7-s~aOTX<%gR2Mu35U~@2ta%_a6I@@qgad+Mgf4?|D}F zT>h|8y~UTmZ`)hz`tKR#$i4cWZ+zzQs^`ABcR#Otz$wAN#6klc_3~BXynGY)Yge+W z8>*lDj!v!@sbpenU|__+NZ~+;`9N;#7l!^E`}fDc@Yugz+y7G1?$E!iH|vi9iTAa) zzc4U-=)vZjvZbrre^xBETxY8HDSWwDrR-{XKkfNHBJ$_X{cpXt`akdN)N|Z->#uw{ zoEi7^K;q^zl^gHxpFVZ}e(t|source-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +Qd-X;zVefx{VFJ37fqW9coyBD@5C7dGA3p1`*50p%wujws#P|Na3L) &^>HMkRzyH?X4stq1Xk+mT$!acmh4X)|S!}s!S=jBv={FIcnXjI};31H} zz=4KI2&{L3yT3fFyVtLMws7jbUo+-CRDQ$Xus!E8Gs6L6Axx7wZiMQ+JHGySG;h(= zhg)D_RQEf3Vg32&wzJM}`5(-~Q37Bq6-W|m2-{UP+ + Canvas test: 2d.composite.grid.no_filter.no_shadow.pattern +2d.composite.grid.no_filter.no_shadow.pattern
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.no_shadow.pattern.html b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.no_shadow.pattern.html new file mode 100644 index 00000000000..6f8159466db --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.no_shadow.pattern.html @@ -0,0 +1,871 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.no_filter.no_shadow.pattern +2d.composite.grid.no_filter.no_shadow.pattern
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.no_shadow.pattern.png b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.no_shadow.pattern.png new file mode 100644 index 0000000000000000000000000000000000000000..ce392a1dcccc5e06a3d163dff873a5647ecdb65c GIT binary patch literal 1572 zcmeAS@N?(olHy`uVBq!ia0y~yV0-|?Ivi|35$S&kQ9z0<$=lt9;Xep2*t>i(0|V<# zPZ!6KiaBp@Z=85LOr$N)j?Y=$FO+@vgj*3Ccn&o>izk#Uyy%wKs9(xmB3ZC1W#^r} zEOirY)So8YzbbknUm#&KBhXwVP-pt~Qv2^p`*kMAL#tjVSFv4t{7?Dh-{Y6Iy<}u~ zAjxUKz`}us-)M=?kB{%$F7-s~aOTX<%gR2Mu35U~@2ta%_a6I@@qgad+Mgf4?|D}F zT>h|8y~UTmZ`)hz`tKR#$i4cWZ+zzQs^`ABcR#Otz$wAN#6klc_3~BXynGY)Yge+W z8>*lDj!v!@sbpenU|__+NZ~+;`9N;#7l!^E`}fDc@Yugz+y7G1?$E!iH|vi9iTAa) zzc4U-=)vZjvZbrre^xBETxY8HDSWwDrR-{XKkfNHBJ$_X{cpXt`akdN)N|Z->#uw{ zoEi7^K;q^zl^gHxpFVZ}e(t|source-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +Qd-X;zVefx{VFJ37fqW9coyBD@5C7dGA3p1`*50p%wujws#P|Na3L) &^>HMkRzyH?X4stq1Xk+mT$!acmh4X)|S!}s!S=jBv={FIcnXjI};31H} zz=4KI2&{L3yT3fFyVtLMws7jbUo+-CRDQ$Xus!E8Gs6L6Axx7wZiMQ+JHGySG;h(= zhg)D_RQEf3Vg32&wzJM}`5(-~Q37Bq6-W|m2-{UP+ + Canvas test: 2d.composite.grid.no_filter.shadow.drawImage +2d.composite.grid.no_filter.shadow.drawImage
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.drawImage.html b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.drawImage.html new file mode 100644 index 00000000000..84527f5a283 --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.drawImage.html @@ -0,0 +1,897 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.no_filter.shadow.drawImage +2d.composite.grid.no_filter.shadow.drawImage
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.drawImage.png b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.drawImage.png new file mode 100644 index 0000000000000000000000000000000000000000..aca03a61b220c1022c65b71dbd092f7b6de3c754 GIT binary patch literal 2314 zcmc2eq7+ypX4+M|43I>=CQy8EEt$>0YRuEGKtO_WD2^19}0-{w2$0pSQRK$x? zu~CszG=!+2*gz7CCCCx5u_O%`f`W-LCILc{h8)|Ct(^?V6n}Mho_D|R`?LGL|Ys zhlN-yv|b1RfCX|(&<+4F8HC|#ZU&=wqYdhuODVLxKRvaNnTbECK*?Ix=YEu8gY^ zo=2)f0-|kn)x%G}y13oSf@5FlwDuIEpymQ=`#ieIM1R$wUxt&D$Z3QIWDXN+!pg^Y z?^source-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +fy zblZvi*CMV6Y}ZJ-+47im<9dYmmpQgnCPl7RJ<6D4h6hY$4?N2*zU0kGUMFj!qM%^2 zFZR{j*EJ%A;6WeRzqZy+Ga5{|HnI{6EmPF%@~aed5qd2*WYcxLiGARI;D#FsB~$GL zbq`08>ms5YMTazfs|T&H5PREIKJ}H{jj`Mvm}@=_Tqk;Z!keDOwQG3$o+amv+v3}P z5!$7W&0P$b%$YrmhX2oU l&;MQJHp>h91u|>~c}KApy5V#=qk4wooqr zz)v>0AHZ<$rDc5+&G&}l7n8`|M4mjM)#YrcGOgxZfjB+%_-NmrA#obr&u`#Iwyc}I ziEu3@F^7uXn;k<9EJ}`9@8gVanQ5@b!yY&E1im~|_8ncBS0|>V^m7D(j9)oug+nd7 zF05s2!grfLlvLd w} zv`hnMBNQVcO{EO5Eu8F|oh9f(b?@JW&%8R%VtQ4CI~SzGI*Lvnj%4#TsQQ&05P?}U z#MU}9nDx0r?`IJCskRx1*(`Ti }3k#~!Bmq@}1%bEUb zB _b@(23RQc&Uh3iCmP-z*Hjcbnp~0P~)4tpo9P zXVIM{`@pu=qC3$|KJD#V>F`s5N`6-YTQlmN1_m@QQ;$l9!(i(=clFGa08^s1+MRAK zCwdqP_S6UG)l|R25zEmXzK^z8BpHf)pRhoNO~OXgKs+!NkBT~8!fX~r+WcIsQ2%RF znLeo+y56`a9cCWL@0zI{<3KZB|Da#_co$zYjIL7fAvxMwGF;3DRVS-C1RgGcM1pF) zAV{uI^`k5YmyXURqjM4!ne@^zaX@nRrHI~M *&&YdUwM`U&@9BE}j8+ xQ^8CL`LS-|$t2^=A2~c5T^Rk%4dage3^H{YyL2ZnOe8n#k-=d>bzjAv_zM@JUbFxJ literal 0 HcmV?d00001 diff --git a/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.fillRect-expected.html b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.fillRect-expected.html new file mode 100644 index 00000000000..e16a5fcf458 --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.fillRect-expected.html @@ -0,0 +1,270 @@ + + + Canvas test: 2d.composite.grid.no_filter.shadow.fillRect +2d.composite.grid.no_filter.shadow.fillRect
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.fillRect.html b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.fillRect.html new file mode 100644 index 00000000000..46bc366c8ac --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.fillRect.html @@ -0,0 +1,819 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.no_filter.shadow.fillRect +2d.composite.grid.no_filter.shadow.fillRect
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.fillRect.png b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.fillRect.png new file mode 100644 index 0000000000000000000000000000000000000000..aca03a61b220c1022c65b71dbd092f7b6de3c754 GIT binary patch literal 2314 zcmc2eq7+ypX4+M|43I>=CQy8EEt$>0YRuEGKtO_WD2^19}0-{w2$0pSQRK$x? zu~CszG=!+2*gz7CCCCx5u_O%`f`W-LCILc{h8)|Ct(^?V6n}Mho_D|R`?LGL|Ys zhlN-yv|b1RfCX|(&<+4F8HC|#ZU&=wqYdhuODVLxKRvaNnTbECK*?Ix=YEu8gY^ zo=2)f0-|kn)x%G}y13oSf@5FlwDuIEpymQ=`#ieIM1R$wUxt&D$Z3QIWDXN+!pg^Y z?^source-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +fy zblZvi*CMV6Y}ZJ-+47im<9dYmmpQgnCPl7RJ<6D4h6hY$4?N2*zU0kGUMFj!qM%^2 zFZR{j*EJ%A;6WeRzqZy+Ga5{|HnI{6EmPF%@~aed5qd2*WYcxLiGARI;D#FsB~$GL zbq`08>ms5YMTazfs|T&H5PREIKJ}H{jj`Mvm}@=_Tqk;Z!keDOwQG3$o+amv+v3}P z5!$7W&0P$b%$YrmhX2oU l&;MQJHp>h91u|>~c}KApy5V#=qk4wooqr zz)v>0AHZ<$rDc5+&G&}l7n8`|M4mjM)#YrcGOgxZfjB+%_-NmrA#obr&u`#Iwyc}I ziEu3@F^7uXn;k<9EJ}`9@8gVanQ5@b!yY&E1im~|_8ncBS0|>V^m7D(j9)oug+nd7 zF05s2!grfLlvLd w} zv`hnMBNQVcO{EO5Eu8F|oh9f(b?@JW&%8R%VtQ4CI~SzGI*Lvnj%4#TsQQ&05P?}U z#MU}9nDx0r?`IJCskRx1*(`Ti }3k#~!Bmq@}1%bEUb zB _b@(23RQc&Uh3iCmP-z*Hjcbnp~0P~)4tpo9P zXVIM{`@pu=qC3$|KJD#V>F`s5N`6-YTQlmN1_m@QQ;$l9!(i(=clFGa08^s1+MRAK zCwdqP_S6UG)l|R25zEmXzK^z8BpHf)pRhoNO~OXgKs+!NkBT~8!fX~r+WcIsQ2%RF znLeo+y56`a9cCWL@0zI{<3KZB|Da#_co$zYjIL7fAvxMwGF;3DRVS-C1RgGcM1pF) zAV{uI^`k5YmyXURqjM4!ne@^zaX@nRrHI~M *&&YdUwM`U&@9BE}j8+ xQ^8CL`LS-|$t2^=A2~c5T^Rk%4dage3^H{YyL2ZnOe8n#k-=d>bzjAv_zM@JUbFxJ literal 0 HcmV?d00001 diff --git a/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.pattern-expected.html b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.pattern-expected.html new file mode 100644 index 00000000000..01e1d4d7b26 --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.pattern-expected.html @@ -0,0 +1,270 @@ + + + Canvas test: 2d.composite.grid.no_filter.shadow.pattern +2d.composite.grid.no_filter.shadow.pattern
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.pattern.html b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.pattern.html new file mode 100644 index 00000000000..e636330c59f --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.pattern.html @@ -0,0 +1,923 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.no_filter.shadow.pattern +2d.composite.grid.no_filter.shadow.pattern
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.pattern.png b/tests/wpt/tests/html/canvas/element/compositing/2d.composite.grid.no_filter.shadow.pattern.png new file mode 100644 index 0000000000000000000000000000000000000000..aca03a61b220c1022c65b71dbd092f7b6de3c754 GIT binary patch literal 2314 zcmc2eq7+ypX4+M|43I>=CQy8EEt$>0YRuEGKtO_WD2^19}0-{w2$0pSQRK$x? zu~CszG=!+2*gz7CCCCx5u_O%`f`W-LCILc{h8)|Ct(^?V6n}Mho_D|R`?LGL|Ys zhlN-yv|b1RfCX|(&<+4F8HC|#ZU&=wqYdhuODVLxKRvaNnTbECK*?Ix=YEu8gY^ zo=2)f0-|kn)x%G}y13oSf@5FlwDuIEpymQ=`#ieIM1R$wUxt&D$Z3QIWDXN+!pg^Y z?^source-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +fy zblZvi*CMV6Y}ZJ-+47im<9dYmmpQgnCPl7RJ<6D4h6hY$4?N2*zU0kGUMFj!qM%^2 zFZR{j*EJ%A;6WeRzqZy+Ga5{|HnI{6EmPF%@~aed5qd2*WYcxLiGARI;D#FsB~$GL zbq`08>ms5YMTazfs|T&H5PREIKJ}H{jj`Mvm}@=_Tqk;Z!keDOwQG3$o+amv+v3}P z5!$7W&0P$b%$YrmhX2oU l&;MQJHp>h91u|>~c}KApy5V#=qk4wooqr zz)v>0AHZ<$rDc5+&G&}l7n8`|M4mjM)#YrcGOgxZfjB+%_-NmrA#obr&u`#Iwyc}I ziEu3@F^7uXn;k<9EJ}`9@8gVanQ5@b!yY&E1im~|_8ncBS0|>V^m7D(j9)oug+nd7 zF05s2!grfLlvLd w} zv`hnMBNQVcO{EO5Eu8F|oh9f(b?@JW&%8R%VtQ4CI~SzGI*Lvnj%4#TsQQ&05P?}U z#MU}9nDx0r?`IJCskRx1*(`Ti }3k#~!Bmq@}1%bEUb zB _b@(23RQc&Uh3iCmP-z*Hjcbnp~0P~)4tpo9P zXVIM{`@pu=qC3$|KJD#V>F`s5N`6-YTQlmN1_m@QQ;$l9!(i(=clFGa08^s1+MRAK zCwdqP_S6UG)l|R25zEmXzK^z8BpHf)pRhoNO~OXgKs+!NkBT~8!fX~r+WcIsQ2%RF znLeo+y56`a9cCWL@0zI{<3KZB|Da#_co$zYjIL7fAvxMwGF;3DRVS-C1RgGcM1pF) zAV{uI^`k5YmyXURqjM4!ne@^zaX@nRrHI~M *&&YdUwM`U&@9BE}j8+ xQ^8CL`LS-|$t2^=A2~c5T^Rk%4dage3^H{YyL2ZnOe8n#k-=d>bzjAv_zM@JUbFxJ literal 0 HcmV?d00001 diff --git a/tests/wpt/tests/html/canvas/element/text/2d.text.draw.fill.basic.png b/tests/wpt/tests/html/canvas/element/text/2d.text.draw.fill.basic.png index 8021427a07dc4ed754e2b3b1357aca7029bb0fe3..70d7b046cb226cfcb2bfeebe3477d3b580d8270a 100644 GIT binary patch delta 1098 zcmV-Q1hxCq2=NGzHh(5bL_t(&f$f-EXjDfS$A7yu#?%W|D^>|sMJ=|r##+&+4^mns zA`Mhg6bWq+3%!^=c%e!t6ucl9@XZVQP_NY}iV$n _TOa1fd6>-n=Re tB}G!v$aP4OpD3G1b-=9gw8WVnw!yfNza=UY zBcYP@jDPyTuksU=OKYZo3TMtYaeB zl-6`ot>^*Fg{ywM$NNwRn_#xZwmT9NAA*zB4~9c2Z14_W?PoPqEyho$wJub%V|ZXl zLtwLa-=41Fkh5R}RKR}t(;LrCcs8FV8I#oxzd$W~08g2HCaNy=aMtf> zRGK-~KT;Ee*>Fbre3nm>uv-Tcn?ug!16hm}gKf&{xxAS~lB_tigiO|57@{1e!(KQA zdw=al?5h@>*CI6uB9dgiEDra)DM;r@wNtB9^^2tPj`^w}h2$;J`bbTHXb#dQk|*a+ zp*>L93|~uGpQ|rOp$L}P4f=!>S|T+GBKtRMAlw#* 2B7gb8o5vJN)D7P!-lj-QjAWmzucZ4?>n?|+ z%Pn<97gMLD1oT2Jtb`I63BzC_EQ7=9tJjrw6%~nzkt~xnTD{4Otb3KILElvMk3y~W zdfEjG{mdgV@h8h fJqV$dXg_d|v3 zTdl^OlGa)Ti(wbk!6oQ`E@+lJgBR?Eh{VL 0gD QwEzGB07*qoM6N<$g0YDY0{{R3 delta 1068 zcmV+{1k?NR2-66VHh&07L_t(&f$iB}h!tfR$MMgqk%GFJrUX(`W`#;*MB$%|HR~pf zK!ifXLNJObiNcDax-x *>PYZMJjX zIdj@McF}y9i}$?qdw%nrXXl;wIkS|Ml$4Z|l$4Z|l$89RNPnng9%uQDZ7k*HMw}l^ zne1vXtLu1%57@^Edg$f^d)denjJZ@MeMssRD}7vG4a4&}f800r&U{hBSj8XpGC9L* z3~ZK3OKsnTgJJv;9aVzM7{`Q^=~uMTnfaZ^@dE?c&rM)83o}E|$_^%mkH^?fJEs}W zXeKf_rC-N I2U&7E93q (r6A$AQ6?(X~@2U55tl#N$r!KLZ zB}{5?Reuy>Qkx`qu|}{bD8Gnk9uI;~t4_@hr@o8!d@zk8Ro&xBw(t^d@#SB*Nez;E z#Tv>4p5o^qJI9oW+wP!wsOr?9&~R0lk(ttPp65`c?e645=G5El3NiU7NyIL8oMm3b zYHH9NkNoMD2En>~xlLvXn>kr4lXmXER3?9s YF7?nRo zTA08>HqenusfS0KVv^&x;Ra4s3C?qz18n7RJe5%#4mZ@h{1}lfVgz`WH{)&@3}G&> zb2aE okKh&h`SjbChtyd zBa^eD|7KGNSy8A-7D>O0H8%B5a$3HSy+OYu%nal}nA{yUfedD)-ha$4)Fg|f-^F@0 zgnyemWN`>Nka|4K4vj^HgUn+{t=N&gOn+BUe%ZINEW{*A(!XM*`|^w*ebu@4zM{J? zHUBg{seC%v&Kg#-noaCX-3u4D)N88D3o)rp(!XNO39(&_Y$R}f2;A6rekNb%=sdbv z9$#pMnA9NYU$H(5vFjTQoEZYoh0d^-7N)b5PiPPS#p>iJyI8}b%=bJ6nv|53lqHmu ml$4Z|l$4Z|l$4bGcl-(V#c^S*`8-(w0000 |sMJ=|r##+&+4^mns zA`Mhg6bWq+3%!^=c%e!t6ucl9@XZVQP_NY}iV$n _TOa1fd6>-n=Re tB}G!v$aP4OpD3G1b-=9gw8WVnw!yfNza=UY zBcYP@jDPyTuksU=OKYZo3TMtYaeB zl-6`ot>^*Fg{ywM$NNwRn_#xZwmT9NAA*zB4~9c2Z14_W?PoPqEyho$wJub%V|ZXl zLtwLa-=41Fkh5R}RKR}t(;LrCcs8FV8I#oxzd$W~08g2HCaNy=aMtf> zRGK-~KT;Ee*>Fbre3nm>uv-Tcn?ug!16hm}gKf&{xxAS~lB_tigiO|57@{1e!(KQA zdw=al?5h@>*CI6uB9dgiEDra)DM;r@wNtB9^^2tPj`^w}h2$;J`bbTHXb#dQk|*a+ zp*>L93|~uGpQ|rOp$L}P4f=!>S|T+GBKtRMAlw#* 2B7gb8o5vJN)D7P!-lj-QjAWmzucZ4?>n?|+ z%Pn<97gMLD1oT2Jtb`I63BzC_EQ7=9tJjrw6%~nzkt~xnTD{4Otb3KILElvMk3y~W zdfEjG{mdgV@h8h fJqV$dXg_d|v3 zTdl^OlGa)Ti(wbk!6oQ`E@+lJgBR?Eh{VL 0gD QwEzGB07*qoM6N<$g0YDY0{{R3 delta 1068 zcmV+{1k?NR2-66VHh&07L_t(&f$iB}h!tfR$MMgqk%GFJrUX(`W`#;*MB$%|HR~pf zK!ifXLNJObiNcDax-x *>PYZMJjX zIdj@McF}y9i}$?qdw%nrXXl;wIkS|Ml$4Z|l$4Z|l$89RNPnng9%uQDZ7k*HMw}l^ zne1vXtLu1%57@^Edg$f^d)denjJZ@MeMssRD}7vG4a4&}f800r&U{hBSj8XpGC9L* z3~ZK3OKsnTgJJv;9aVzM7{`Q^=~uMTnfaZ^@dE?c&rM)83o}E|$_^%mkH^?fJEs}W zXeKf_rC-N I2U&7E93q (r6A$AQ6?(X~@2U55tl#N$r!KLZ zB}{5?Reuy>Qkx`qu|}{bD8Gnk9uI;~t4_@hr@o8!d@zk8Ro&xBw(t^d@#SB*Nez;E z#Tv>4p5o^qJI9oW+wP!wsOr?9&~R0lk(ttPp65`c?e645=G5El3NiU7NyIL8oMm3b zYHH9NkNoMD2En>~xlLvXn>kr4lXmXER3?9s YF7?nRo zTA08>HqenusfS0KVv^&x;Ra4s3C?qz18n7RJe5%#4mZ@h{1}lfVgz`WH{)&@3}G&> zb2aE okKh&h`SjbChtyd zBa^eD|7KGNSy8A-7D>O0H8%B5a$3HSy+OYu%nal}nA{yUfedD)-ha$4)Fg|f-^F@0 zgnyemWN`>Nka|4K4vj^HgUn+{t=N&gOn+BUe%ZINEW{*A(!XM*`|^w*ebu@4zM{J? zHUBg{seC%v&Kg#-noaCX-3u4D)N88D3o)rp(!XNO39(&_Y$R}f2;A6rekNb%=sdbv z9$#pMnA9NYU$H(5vFjTQoEZYoh0d^-7N)b5PiPPS#p>iJyI8}b%=bJ6nv|53lqHmu ml$4Z|l$4Z|l$4bGcl-(V#c^S*`8-(w0000 |sMJ=|r##+&+4^mns zA`Mhg6bWq+3%!^=c%e!t6ucl9@XZVQP_NY}iV$n _TOa1fd6>-n=Re tB}G!v$aP4OpD3G1b-=9gw8WVnw!yfNza=UY zBcYP@jDPyTuksU=OKYZo3TMtYaeB zl-6`ot>^*Fg{ywM$NNwRn_#xZwmT9NAA*zB4~9c2Z14_W?PoPqEyho$wJub%V|ZXl zLtwLa-=41Fkh5R}RKR}t(;LrCcs8FV8I#oxzd$W~08g2HCaNy=aMtf> zRGK-~KT;Ee*>Fbre3nm>uv-Tcn?ug!16hm}gKf&{xxAS~lB_tigiO|57@{1e!(KQA zdw=al?5h@>*CI6uB9dgiEDra)DM;r@wNtB9^^2tPj`^w}h2$;J`bbTHXb#dQk|*a+ zp*>L93|~uGpQ|rOp$L}P4f=!>S|T+GBKtRMAlw#* 2B7gb8o5vJN)D7P!-lj-QjAWmzucZ4?>n?|+ z%Pn<97gMLD1oT2Jtb`I63BzC_EQ7=9tJjrw6%~nzkt~xnTD{4Otb3KILElvMk3y~W zdfEjG{mdgV@h8h fJqV$dXg_d|v3 zTdl^OlGa)Ti(wbk!6oQ`E@+lJgBR?Eh{VL 0gD QwEzGB07*qoM6N<$g0YDY0{{R3 delta 1068 zcmV+{1k?NR2-66VHh&07L_t(&f$iB}h!tfR$MMgqk%GFJrUX(`W`#;*MB$%|HR~pf zK!ifXLNJObiNcDax-x *>PYZMJjX zIdj@McF}y9i}$?qdw%nrXXl;wIkS|Ml$4Z|l$4Z|l$89RNPnng9%uQDZ7k*HMw}l^ zne1vXtLu1%57@^Edg$f^d)denjJZ@MeMssRD}7vG4a4&}f800r&U{hBSj8XpGC9L* z3~ZK3OKsnTgJJv;9aVzM7{`Q^=~uMTnfaZ^@dE?c&rM)83o}E|$_^%mkH^?fJEs}W zXeKf_rC-N I2U&7E93q (r6A$AQ6?(X~@2U55tl#N$r!KLZ zB}{5?Reuy>Qkx`qu|}{bD8Gnk9uI;~t4_@hr@o8!d@zk8Ro&xBw(t^d@#SB*Nez;E z#Tv>4p5o^qJI9oW+wP!wsOr?9&~R0lk(ttPp65`c?e645=G5El3NiU7NyIL8oMm3b zYHH9NkNoMD2En>~xlLvXn>kr4lXmXER3?9s YF7?nRo zTA08>HqenusfS0KVv^&x;Ra4s3C?qz18n7RJe5%#4mZ@h{1}lfVgz`WH{)&@3}G&> zb2aE okKh&h`SjbChtyd zBa^eD|7KGNSy8A-7D>O0H8%B5a$3HSy+OYu%nal}nA{yUfedD)-ha$4)Fg|f-^F@0 zgnyemWN`>Nka|4K4vj^HgUn+{t=N&gOn+BUe%ZINEW{*A(!XM*`|^w*ebu@4zM{J? zHUBg{seC%v&Kg#-noaCX-3u4D)N88D3o)rp(!XNO39(&_Y$R}f2;A6rekNb%=sdbv z9$#pMnA9NYU$H(5vFjTQoEZYoh0d^-7N)b5PiPPS#p>iJyI8}b%=bJ6nv|53lqHmu ml$4Z|l$4Z|l$4bGcl-(V#c^S*`8-(w0000 0-;3>DHy2O7;UWzX)47c43B6D#1N@qEpbX|0}KUu$cSP93j m-=#d8zIF7b7bP_36erlrq5p?SM6h=70o7@{wxlclsOEWA@kMTJVFl+I7wu~S zhq#v(EaWDpGKdGFyVNm;=eUPT(4Cv p&6n8A&DAQGd=BMo`RuXvakMvzS)wVi+&c zJ`W<1Tzn1Z@JzH>0W*1@=HNkoA8ovh>EJa^^JB0)6rz~La?q9|%%E|SO)HkLm8-yf zewGK3NHPpo9lv7=XvryBrLt*3EhRLjn(1r-xA0-)#{f2QJ9wU7MVl3{E=)!@j^#ll zlB|L?EPo*b*vYq2*^CPh-L34V8D}T~??- a!Ru0 dETC!BBoX zRW{IxlQg9<$ASm<@h8xR+RNwge{5tZD5Z)XX@5PrgZ^~m%XtuqB&%TE%O65{AH9 4Kg>y1Gd{dl8Ilu`NHPyr0e|HCpoH2~3(Y Hsu5`O|nxkx|7PRF} z*71uZ4?d zWWJGZ&Sa{1I#uLHg(a^epD~;}FTEyF6Q*%Z+8iR0){JHeM>)jHj7Z3W=JMyXiSCt( zT+x%&oFcB~26|D>JStM@tYr 6(wIYGyIV&g?dU)WTR4-p`~AGccle00 zjAeN4L=Y0&v~1+b`mIthmNz-ewP}xT>L{a@W&D6gLgit;;1jwqnRRIuUZ)2$nL-86 z=2Qf^+3rN~5U+xX3`=#+bMYF*7=N&g2Wb`*YWXhxSW2G^M*Ismg5wFhuAGRZBdZKP zCA~Qk=HfjDrZv8szlQQ#j1T3NA>I83N0S!&WbO~yNjE;qsR;7;WKCcN7r22Uwx%`S zK-aKmEK67u*M)P`Jyftbt-noqoK;{Tdvhw1js`wijrk-Tbw9)047$t<1AjH)SV(RQ zsS3++Q`WPML8 +4E zBmH=XMXX6XM8iZPf;Ej!p}aB6KiS76od5lcpJ&teQ96e51)k#bBsrVT^r9VYxr!R9 y+0LnK2Fi&@OiWBnOiWBnOiWBnOiWBnZul=!n+wy_(&CK(0000 K4Dkz)HGc)BNkl rI~+&o($p=D%ivl4tBH1nXKW9@hp4s zWe%|@hVeM+z<-@w$W1&K!|N;-bC^3gH`;6v-{TE#={AwvoF1%d>T|W7Y-BclK{>T7 z=uCD4Gby5;YD#J5lFq!Av7K^oIV-8-E!y}8ud |r42{-2pJVjlO4@i3{D2?ljbs>y=?@lih<|xh(FgRVlF2;9ek#Fe8tIv| zNUXtnIIrbcTEfJ>ixtt93%Lg@;{h`C;6jdu-!msaWFZ(ueclx`lfQ=Rt$ZPA5sIVz z;_)m`hLPRO*a)){Zs$IVnaT=Y;szRcfhp1Y7l-I4@*tUL%T@GZJvCg*xTHlWiS~=l z@0bV cW!7>l8(GCX)MF^8e-;zj BW!-dbnqx&1HC!MKuS2wCn6jl36V@<2W4@h?;eo^mLV?U5IB$4Tn0n9j1BbX zdVU4oW+S)q9uF`hLVQcu#h;*#zc97%Z<~lnB!BT|Rx!0 C? zO@HTUP{nH<4CaJ{YXX0cj;D;}WO#(hd@$=#Z$8BmUSdD9qZ5%Xi$vFk&+!md+}z>m zd%Q^#H5{RsIedfBG;}cj11or(pON9N_D=_}mkT(>L8?PNl#~8UVItRZfEu3XPc#OD ztC+_KKF{v%6lq7y+OU#Y>|r~Da~TYyiGLD$lA(%z9oiOd2MbskCpbzO$s9J)Og)Pk z9-dC6IU=6KMTk)ww(u^m@yqB$6!(PGxtinAZ7V`O^np0>wP!esXykrM!FQt*x8y}S ztqm(Ut22>49OL{#BHqMT3bD_ojLqTjqc3m9tn3O9iIKsdEa-42i)n15nL!~V&40sg zwy=sttnTpiL!9KDyb7ndgBrfW37Qz%{-x7pktCARC}waUn8o$E-d3ku1*<9HxAf Qk0KHi!A@0kSd )S84 zL_{L#%3u|-kE_6fa5@@?Ptrg!MeGj>xRgCS!wq>~w->R1R+i^VYmyL&P94TmK^5;t zOXp-96^vmFUyZi`y-yuS`4O-4Iy0yRdl C5otdISLQO(G3eMf>Nh4_x;x^R7pyE_=1!=+TxFTAHukfDx)w8iTs5s{RX ol$4Z|l$4Z|l$4Z|l$6ByFI{H?k)#r?0000007*qoM6N<$f=8O!O8@`> diff --git a/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-position.tentative.html b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-position.tentative.html new file mode 100644 index 00000000000..cc6f366e072 --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-position.tentative.html @@ -0,0 +1,54 @@ + + + + Canvas test: 2d.text.measure.text-clusters-position.tentative + + + + + + + +2d.text.measure.text-clusters-position.tentative
+Test that TextMetrics::getTextClusters() returns clusters that are positioned according to the target align and baseline passed as options.
+ + + +Actual output:
+ + ++ + diff --git a/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-range.tentative.html b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-range.tentative.html new file mode 100644 index 00000000000..effa53c4c95 --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-range.tentative.html @@ -0,0 +1,77 @@ + + + +
Canvas test: 2d.text.measure.text-clusters-range.tentative + + + + + + + +2d.text.measure.text-clusters-range.tentative
+Test that getTextClusters() and fillTextCluster() correctly render different ranges of the input text.
+ + + +Actual output:
+ + ++ + diff --git a/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-align.tentative-expected.html b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-align.tentative-expected.html new file mode 100644 index 00000000000..967ae7e4636 --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-align.tentative-expected.html @@ -0,0 +1,77 @@ + + + +
Canvas test: 2d.text.measure.text-clusters-rendering-align.tentative +2d.text.measure.text-clusters-rendering-align.tentative
+Test that fillTextCluster() correctly positions the text, taking into account the textAlign from the context at the time the text was measured.
+ ++ +diff --git a/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-align.tentative.html b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-align.tentative.html new file mode 100644 index 00000000000..159efb4fee4 --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-align.tentative.html @@ -0,0 +1,90 @@ + + + + +ctx_align_left+ + + + + +ctx_align_center+ + + + + +ctx_align_right+ + + + +Canvas test: 2d.text.measure.text-clusters-rendering-align.tentative +2d.text.measure.text-clusters-rendering-align.tentative
+Test that fillTextCluster() correctly positions the text, taking into account the textAlign from the context at the time the text was measured.
+ ++ +diff --git a/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-baseline.tentative-expected.html b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-baseline.tentative-expected.html new file mode 100644 index 00000000000..2dffe90aadc --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-baseline.tentative-expected.html @@ -0,0 +1,87 @@ + + + +ctx_align_left+ + + + + +ctx_align_center+ + + + + +ctx_align_right+ + + + +Canvas test: 2d.text.measure.text-clusters-rendering-baseline.tentative +2d.text.measure.text-clusters-rendering-baseline.tentative
+Test that fillTextCluster() correctly positions the text, taking into account the textBaseline from the context at the time the text was measured.
+ ++ +diff --git a/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-baseline.tentative.html b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-baseline.tentative.html new file mode 100644 index 00000000000..c20e076a351 --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-baseline.tentative.html @@ -0,0 +1,116 @@ + + + + +ctx_baseline_top+ + + + + +ctx_baseline_middle+ + + + + +ctx_baseline_bottom+ + + + + +ctx_baseline_alphabetic+ + + + +Canvas test: 2d.text.measure.text-clusters-rendering-baseline.tentative +2d.text.measure.text-clusters-rendering-baseline.tentative
+Test that fillTextCluster() correctly positions the text, taking into account the textBaseline from the context at the time the text was measured.
+ ++ +diff --git a/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-font-change.tentative-expected.html b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-font-change.tentative-expected.html new file mode 100644 index 00000000000..9a9443962df --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-font-change.tentative-expected.html @@ -0,0 +1,22 @@ + + + +ctx_baseline_top+ + + + + +ctx_baseline_middle+ + + + + +ctx_baseline_bottom+ + + + + +ctx_baseline_alphabetic+ + + + +Canvas test: 2d.text.measure.text-clusters-rendering-font-change.tentative +2d.text.measure.text-clusters-rendering-font-change.tentative
+Test that fillTextCluster() renders in the font used originally when the text was measured, even if the font set on the context has changed since.
+ + diff --git a/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-font-change.tentative.html b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-font-change.tentative.html new file mode 100644 index 00000000000..a927cfcd330 --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/text/2d.text.measure.text-clusters-rendering-font-change.tentative.html @@ -0,0 +1,27 @@ + + + + +Canvas test: 2d.text.measure.text-clusters-rendering-font-change.tentative +2d.text.measure.text-clusters-rendering-font-change.tentative
+Test that fillTextCluster() renders in the font used originally when the text was measured, even if the font set on the context has changed since.
+ + diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.drawImage-expected.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.drawImage-expected.html new file mode 100644 index 00000000000..eea78248a83 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.drawImage-expected.html @@ -0,0 +1,270 @@ + + +Canvas test: 2d.composite.grid.filter.no_shadow.drawImage +2d.composite.grid.filter.no_shadow.drawImage
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.drawImage.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.drawImage.html new file mode 100644 index 00000000000..72b23aeeafb --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.drawImage.html @@ -0,0 +1,949 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.filter.no_shadow.drawImage +2d.composite.grid.filter.no_shadow.drawImage
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.drawImage.png b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.drawImage.png new file mode 100644 index 0000000000000000000000000000000000000000..2318c1ec94e401b19677b4c4b5e7badff8cea77e GIT binary patch literal 2291 zcmdT_Yfuws6y1OY6$5sr6$KP(r{eektwI`k1Qi8p4OFqw0)il*Usource-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +5dxw_2qOwr1S=_oKu8esP#y^;K)P%mO{zFlQQDdQ>F(^^ot^KSJ@=e@ z&YliH`@rYh%m)Af?&s^h3jkn!hHK4SGs7EOUD&sVn_2h{A8$Z!JTKRkQ2=1>FMi&e z15*n}1Sp){;icxI7yC}^M*G(1aQA#siwV2BRcP(C+2YF<>Du5`{;QnRV7@}@T&WG( zCo{aF@EM~d;XCUqh4Hl(j-Q~(VJic2^-ss;EY hr|9h(pN@z{1O9n1k2!J@Xd>CJe1j`*J1+f2W3#DY&OX z_&YteO@Z!P7v0>UUoo-i_|eJ@bfkjDTrZG_&RudZI7@4zBg;<|>!gmv)--$l#K4Z` zS}sF#_a|A3vj55;glpf3xuY*|gLJV?+H&Q+7F8)0lLnV{z4_&j)&X-?h5>T}-UV%@ z1r42*j(58GMRgD~mReQQ*|BC+c`P_l(AO5VuTlIpx1$j8efLFdB|p?>j|_WPMR=;C zPwINSSTwEyMv@Tz7L4wnS v=Rbcr&Xlj`{?DJ|QARk`}9ui6$(v^~AEfhFy?U(Q|4PQ#yR1m{;g}Myy4o zRULTDREyf%B h0kU-Pks<@OI$yQqPD1-TGL--mW{M?PS;sdoCl={ zr0|AjzdM5(suE{uYTc-!A?7L+2j@DhgHj|ibtAk*L3s#jpHE1PZNDC*X>Gr4@|m3U zTB)FxqEUl16LJN2APRS#zOPTBh(+5r@ihe{wV(@$z6rZfri|U5q>61yYKA*ZYKl4y znkA}5MqtI5ORlF9L1F-sV?{%=KYXuZjWjW4dwS%{^8Zqeg3_hpLM(2dR Cw!O#Kpg9->=Yoid#4eU8A%a9xf6ee1t#V6e$|1!c2QbDhQZ<$xqSmHZ@ZSvV zza`~2pS?^cV??10qWjJi hg*CnkLuc&t?9yP>Zk8}NK zRmdcwg7 J{3+r7gm2~6vcbnHMIm-%f&do#9#o%j + + + + + + Canvas test: 2d.composite.grid.filter.no_shadow.drawImage +2d.composite.grid.filter.no_shadow.drawImage
+ + + ++ ++ diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.drawImage.worker.js b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.drawImage.worker.js new file mode 100644 index 00000000000..45329fcd9c8 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.drawImage.worker.js @@ -0,0 +1,685 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.grid.filter.no_shadow.drawImage +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'source-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'source-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'source-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'source-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'destination-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'destination-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'destination-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'destination-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'lighter' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'copy' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'xor' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'multiply' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'screen' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'overlay' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'darken' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'lighten' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'color-dodge' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'color-burn' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'hard-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'soft-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'difference' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'exclusion' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'hue' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'saturation' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'color' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'luminosity' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.fillRect-expected.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.fillRect-expected.html new file mode 100644 index 00000000000..08ed3566fd1 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.fillRect-expected.html @@ -0,0 +1,270 @@ + + +source-over+ + + + + + +source-in+ + + + + + +source-out+ + + + + + +source-atop+ + + + + + +destination-over+ + + + + + +destination-in+ + + + + + +destination-out+ + + + + + +destination-atop+ + + + + + +lighter+ + + + + + +copy+ + + + + + +xor+ + + + + + +multiply+ + + + + + +screen+ + + + + + +overlay+ + + + + + +darken+ + + + + + +lighten+ + + + + + +color-dodge+ + + + + + +color-burn+ + + + + + +hard-light+ + + + + + +soft-light+ + + + + + +difference+ + + + + + +exclusion+ + + + + + +hue+ + + + + + +saturation+ + + + + + +color+ + + + + + +luminosity+ + + + + +Canvas test: 2d.composite.grid.filter.no_shadow.fillRect +2d.composite.grid.filter.no_shadow.fillRect
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.fillRect.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.fillRect.html new file mode 100644 index 00000000000..3f8fdc8164d --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.fillRect.html @@ -0,0 +1,871 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.filter.no_shadow.fillRect +2d.composite.grid.filter.no_shadow.fillRect
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.fillRect.png b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.fillRect.png new file mode 100644 index 0000000000000000000000000000000000000000..2318c1ec94e401b19677b4c4b5e7badff8cea77e GIT binary patch literal 2291 zcmdT_Yfuws6y1OY6$5sr6$KP(r{eektwI`k1Qi8p4OFqw0)il*Usource-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +5dxw_2qOwr1S=_oKu8esP#y^;K)P%mO{zFlQQDdQ>F(^^ot^KSJ@=e@ z&YliH`@rYh%m)Af?&s^h3jkn!hHK4SGs7EOUD&sVn_2h{A8$Z!JTKRkQ2=1>FMi&e z15*n}1Sp){;icxI7yC}^M*G(1aQA#siwV2BRcP(C+2YF<>Du5`{;QnRV7@}@T&WG( zCo{aF@EM~d;XCUqh4Hl(j-Q~(VJic2^-ss;EY hr|9h(pN@z{1O9n1k2!J@Xd>CJe1j`*J1+f2W3#DY&OX z_&YteO@Z!P7v0>UUoo-i_|eJ@bfkjDTrZG_&RudZI7@4zBg;<|>!gmv)--$l#K4Z` zS}sF#_a|A3vj55;glpf3xuY*|gLJV?+H&Q+7F8)0lLnV{z4_&j)&X-?h5>T}-UV%@ z1r42*j(58GMRgD~mReQQ*|BC+c`P_l(AO5VuTlIpx1$j8efLFdB|p?>j|_WPMR=;C zPwINSSTwEyMv@Tz7L4wnS v=Rbcr&Xlj`{?DJ|QARk`}9ui6$(v^~AEfhFy?U(Q|4PQ#yR1m{;g}Myy4o zRULTDREyf%B h0kU-Pks<@OI$yQqPD1-TGL--mW{M?PS;sdoCl={ zr0|AjzdM5(suE{uYTc-!A?7L+2j@DhgHj|ibtAk*L3s#jpHE1PZNDC*X>Gr4@|m3U zTB)FxqEUl16LJN2APRS#zOPTBh(+5r@ihe{wV(@$z6rZfri|U5q>61yYKA*ZYKl4y znkA}5MqtI5ORlF9L1F-sV?{%=KYXuZjWjW4dwS%{^8Zqeg3_hpLM(2dR Cw!O#Kpg9->=Yoid#4eU8A%a9xf6ee1t#V6e$|1!c2QbDhQZ<$xqSmHZ@ZSvV zza`~2pS?^cV??10qWjJi hg*CnkLuc&t?9yP>Zk8}NK zRmdcwg7 J{3+r7gm2~6vcbnHMIm-%f&do#9#o%j + + + + + + Canvas test: 2d.composite.grid.filter.no_shadow.fillRect +2d.composite.grid.filter.no_shadow.fillRect
+ + + ++ ++ diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.fillRect.worker.js b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.fillRect.worker.js new file mode 100644 index 00000000000..dff55436a40 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.fillRect.worker.js @@ -0,0 +1,607 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.grid.filter.no_shadow.fillRect +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'source-over' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'source-in' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'source-out' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'source-atop' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'destination-over' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'destination-in' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'destination-out' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'destination-atop' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'lighter' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'copy' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'xor' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'multiply' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'screen' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'overlay' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'darken' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'lighten' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'color-dodge' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'color-burn' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'hard-light' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'soft-light' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'difference' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'exclusion' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'hue' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'saturation' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'color' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'luminosity' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.pattern-expected.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.pattern-expected.html new file mode 100644 index 00000000000..22c84f42e89 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.pattern-expected.html @@ -0,0 +1,270 @@ + + +source-over+ + + + + + +source-in+ + + + + + +source-out+ + + + + + +source-atop+ + + + + + +destination-over+ + + + + + +destination-in+ + + + + + +destination-out+ + + + + + +destination-atop+ + + + + + +lighter+ + + + + + +copy+ + + + + + +xor+ + + + + + +multiply+ + + + + + +screen+ + + + + + +overlay+ + + + + + +darken+ + + + + + +lighten+ + + + + + +color-dodge+ + + + + + +color-burn+ + + + + + +hard-light+ + + + + + +soft-light+ + + + + + +difference+ + + + + + +exclusion+ + + + + + +hue+ + + + + + +saturation+ + + + + + +color+ + + + + + +luminosity+ + + + + +Canvas test: 2d.composite.grid.filter.no_shadow.pattern +2d.composite.grid.filter.no_shadow.pattern
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.pattern.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.pattern.html new file mode 100644 index 00000000000..0bb970ab3f8 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.pattern.html @@ -0,0 +1,975 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.filter.no_shadow.pattern +2d.composite.grid.filter.no_shadow.pattern
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.pattern.png b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.pattern.png new file mode 100644 index 0000000000000000000000000000000000000000..2318c1ec94e401b19677b4c4b5e7badff8cea77e GIT binary patch literal 2291 zcmdT_Yfuws6y1OY6$5sr6$KP(r{eektwI`k1Qi8p4OFqw0)il*Usource-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +5dxw_2qOwr1S=_oKu8esP#y^;K)P%mO{zFlQQDdQ>F(^^ot^KSJ@=e@ z&YliH`@rYh%m)Af?&s^h3jkn!hHK4SGs7EOUD&sVn_2h{A8$Z!JTKRkQ2=1>FMi&e z15*n}1Sp){;icxI7yC}^M*G(1aQA#siwV2BRcP(C+2YF<>Du5`{;QnRV7@}@T&WG( zCo{aF@EM~d;XCUqh4Hl(j-Q~(VJic2^-ss;EY hr|9h(pN@z{1O9n1k2!J@Xd>CJe1j`*J1+f2W3#DY&OX z_&YteO@Z!P7v0>UUoo-i_|eJ@bfkjDTrZG_&RudZI7@4zBg;<|>!gmv)--$l#K4Z` zS}sF#_a|A3vj55;glpf3xuY*|gLJV?+H&Q+7F8)0lLnV{z4_&j)&X-?h5>T}-UV%@ z1r42*j(58GMRgD~mReQQ*|BC+c`P_l(AO5VuTlIpx1$j8efLFdB|p?>j|_WPMR=;C zPwINSSTwEyMv@Tz7L4wnS v=Rbcr&Xlj`{?DJ|QARk`}9ui6$(v^~AEfhFy?U(Q|4PQ#yR1m{;g}Myy4o zRULTDREyf%B h0kU-Pks<@OI$yQqPD1-TGL--mW{M?PS;sdoCl={ zr0|AjzdM5(suE{uYTc-!A?7L+2j@DhgHj|ibtAk*L3s#jpHE1PZNDC*X>Gr4@|m3U zTB)FxqEUl16LJN2APRS#zOPTBh(+5r@ihe{wV(@$z6rZfri|U5q>61yYKA*ZYKl4y znkA}5MqtI5ORlF9L1F-sV?{%=KYXuZjWjW4dwS%{^8Zqeg3_hpLM(2dR Cw!O#Kpg9->=Yoid#4eU8A%a9xf6ee1t#V6e$|1!c2QbDhQZ<$xqSmHZ@ZSvV zza`~2pS?^cV??10qWjJi hg*CnkLuc&t?9yP>Zk8}NK zRmdcwg7 J{3+r7gm2~6vcbnHMIm-%f&do#9#o%j + + + + + + Canvas test: 2d.composite.grid.filter.no_shadow.pattern +2d.composite.grid.filter.no_shadow.pattern
+ + + ++ ++ diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.pattern.worker.js b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.pattern.worker.js new file mode 100644 index 00000000000..d3e79cd2d15 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.no_shadow.pattern.worker.js @@ -0,0 +1,711 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.grid.filter.no_shadow.pattern +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'source-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'source-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'source-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'source-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'destination-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'destination-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'destination-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'destination-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'lighter' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'copy' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'xor' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'multiply' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'screen' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'overlay' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'darken' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'lighten' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'color-dodge' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'color-burn' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'hard-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'soft-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'difference' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'exclusion' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'hue' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'saturation' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'color' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + // No shadow. + + ctx.globalCompositeOperation = 'luminosity' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.drawImage-expected.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.drawImage-expected.html new file mode 100644 index 00000000000..2072348f904 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.drawImage-expected.html @@ -0,0 +1,270 @@ + + +source-over+ + + + + + +source-in+ + + + + + +source-out+ + + + + + +source-atop+ + + + + + +destination-over+ + + + + + +destination-in+ + + + + + +destination-out+ + + + + + +destination-atop+ + + + + + +lighter+ + + + + + +copy+ + + + + + +xor+ + + + + + +multiply+ + + + + + +screen+ + + + + + +overlay+ + + + + + +darken+ + + + + + +lighten+ + + + + + +color-dodge+ + + + + + +color-burn+ + + + + + +hard-light+ + + + + + +soft-light+ + + + + + +difference+ + + + + + +exclusion+ + + + + + +hue+ + + + + + +saturation+ + + + + + +color+ + + + + + +luminosity+ + + + + +Canvas test: 2d.composite.grid.filter.shadow.drawImage +2d.composite.grid.filter.shadow.drawImage
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.drawImage.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.drawImage.html new file mode 100644 index 00000000000..5c9e992c7ce --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.drawImage.html @@ -0,0 +1,1001 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.filter.shadow.drawImage +2d.composite.grid.filter.shadow.drawImage
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.drawImage.png b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.drawImage.png new file mode 100644 index 0000000000000000000000000000000000000000..fde787731168e3a2565ca15d6da5e160a03ef484 GIT binary patch literal 4085 zcmZ`+3piBi8y^+6b*cULw}sGUQLCuLsource-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +NsQr)GxHyIYsJ%?XP)zX-#PDl&i9_*@Av+`-%p>kRryxq zTL=WAa{QQ$BLpHhEc@^JMnN{CDe*ohJ1JbWx3z&t7mf!Md@2O8uK2jkA?K)U{tzr- za}P%G1N6})-nt|4DXU`>u5Bu`*&4g*hl_V1*RJpk<>mjVY-l_ZHXwh@Ppv`4z|%wX zT6!8`fAF?FX@?qvUIaI8Pw18J_?3O^F4}MFe**0Ot9xe~G`1-w(jwAAz#NoB2(0tC z^Oi_v6U}()-3?ZI;TqX1K_In{Uh(&6{1LrztlY;1S2fo3J_P)(RcM>8{d+D1GGV)F z6J*sl-jHv$#K>)_XIF`hP9>b|${O&5Q#uETttUdp8o7G{e<`F1ZGY&|sqOf7$?Y)^ zg&4@E_%eRbu~ZL~_+4zN-kWBQ&}npZceniueQWq7+y>3DAt-J-v2%Zmg=BQp2O&In z9{bk=apatZ8y=X4pDY@gOShDcWvK0etXW?VS$`0+`XEG386vl4$wbT}QB3WJcH%m? z4hoIHlgbOqP2!j;5A( z0jJqMIb}pK2V8kR>;8bY^w+tmSY)-So|RknH1Fc9viqjLSWa?sx zUb2$z=$h6gY-SPaSgn@kKg%yK4FYC+!D2VDz_ z-S)??qLD}{`OR^cGev@$dkCiupn|h6s9-!ZuUXJ3!wR 8&ND7GE|Q` zsfdtT(b99v0r9!C3%LGGYSu`@LuF{zS83@lR%Ncv^?}WCSe4c@(?DWe_p_%p?fGu| zZd)<`j3~NcmVM#|(7*z_NM!32%2*b@t}_TVq0}^KaGBGC=e;pg9-9NiFN8BKOm`h5 z>dCySVNu@l!parat|bICF>E=$Jc*(P0DDummp~lTiOg_!&@5#>n@J~%*CB`AhnR=r zWw$A*gIT5*-c7S6><)R2oubDP@arf-Miq!s?7^CJALxhCsLd*F)VXSmRIGEGJoHO% z2BW)kyM;iED~XZY@`XU0u3Bp#lKu|~q`1(Vi;0#gbtxuHWpmubhs$_Ok0H#od!_-! zm#Ub|$CG+2v{0^=9@I) `>e&ruX;Vy@5yND@SZ9`3GE&&E0+ a@Uu_p=E@xxvj2C9I3*UYW7Z9fs4JODK=TJR~mQ3YZx3nj8^)Wda?f>-FUR zl~i8jUY-OYnWSBpg+mPf(a|r~{Ws==j` >U7239Bl#+rbK*vHC_Js$(~aIL zL~F?SRJb~`hxK3%uo&t??@N3{q6Tw&c!B0MM|nX_Z$iJ$(gi5(0L^~N2)ZNqX~v0q zTO+G)7%(sv2%oN6qR+C|_=i*wNX(q$yNFFHjufS--tuA?d@9pMMkp_Jp+P?OQWtVN zX{+3q^6Nd2x7~8D`59y|3L!j-B l z^z#=L&gj3My39b!Ys==F!+2!$)g*?%!srwk%W*yoa%+gJN-`cTEftjW1d_V~Rz9i( z%gPM_C8!y$-*N@~qFX!|w;DE_cW*AY)$I4=c&p093;Q7wCgc&5vJa8`Hj9G~4-9?W zsXSJLO}B185JlmvdEu172CP!AOiadAVQ|vdF<0v(Z%!HC)~fua&DjyQVqqu3H@M39 zuw5ObcKtcisLD=pv~&9wi1Y8iENn}V=$KRt4UBj=1~S#4ZTC$*h(oOh4$ UU^tOCy9Tm5eUNOQ26C`;^e}ihw)5ajB75em&`D?hOcVy%SwZ{-2n_ZV= zS~2u`T>3PRonV@!UF!8L*^L@TeYl%#Z>XzT>ifSqpup1;)QI$Wi(X4ehYl+LScCHl z^l$645jIt3cly%fcmgkD0n3qHXx?Aidzy+j=0Uws-^0t7A!bW`RaTj6aa!~M^H#u4 zzcQW*f|?h4-HaX%I@0y-Wn0;V`i6jpV+_(Hezm=Itnt9JI>~+03;attEUGvGaPa-= zcX}!Lep waR2Z%Hr;=dNrc_bTI>yV0?YqAXqV946L-c3e|L~t zFa`on)NSW2r7N^$fn%RZcbB3#c Nn>eKQH>gPoKw72 qt_V>Q*pv6iZ$!^cWj0``-~TP)KN zfn4Os%UXUChRYsB*h=weRr`R`u-V!?K-g{j`TQ{7wzO1s>Iu@4mQt9OyvaIpY 7 z`1d5XGE{Aa2=qp5=(ekLL=K=P-#WhbPCBoFw5Yxp8aKDE2D_7hP1MoqU#$tRl8tPi zaz&0!w6)rZ*=G#T&TudoI-flZTFoP8TZOe5E>!Al-|Q*HI*$*!1b1i+Hh${kD05b? zBs*_=_7Rlmy H&3Cf zUP<&KHg+?s%^3iO?;H5o>;3>B*KYjPO#ia5Z-5Nf5&tC?B#Cfr*e!NhvV!miRb1qS z#Jp90COR(mfq_xa`D0NIp(?U|1v#`r{Pr*$&dS_d?sKvG8L1yhfZot)lzY{;1#@^m zqWT$*jFHkbOfO)fG3=?iM!JPSsf@N<2G{?)Q>mMeLT<$it|c`?PiR#SNbJvY0M?i? zG*!El)qp$hE)1GqG;q7;-@=%!8mcivKFc*eX4!5;->n&EUdGW^5Z!DQ+Am~Sv|DoP zo4*QyWN`Pm%4=7b*CR?xx + + + + + + Canvas test: 2d.composite.grid.filter.shadow.drawImage +2d.composite.grid.filter.shadow.drawImage
+ + + ++ ++ diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.drawImage.worker.js b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.drawImage.worker.js new file mode 100644 index 00000000000..9a9c2f93632 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.drawImage.worker.js @@ -0,0 +1,737 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.grid.filter.shadow.drawImage +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'lighter' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'copy' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'xor' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'multiply' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'screen' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'overlay' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'darken' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'lighten' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color-dodge' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color-burn' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'hard-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'soft-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'difference' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'exclusion' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'hue' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'saturation' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'luminosity' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.fillRect-expected.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.fillRect-expected.html new file mode 100644 index 00000000000..1e119bcbde5 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.fillRect-expected.html @@ -0,0 +1,270 @@ + + +source-over+ + + + + + +source-in+ + + + + + +source-out+ + + + + + +source-atop+ + + + + + +destination-over+ + + + + + +destination-in+ + + + + + +destination-out+ + + + + + +destination-atop+ + + + + + +lighter+ + + + + + +copy+ + + + + + +xor+ + + + + + +multiply+ + + + + + +screen+ + + + + + +overlay+ + + + + + +darken+ + + + + + +lighten+ + + + + + +color-dodge+ + + + + + +color-burn+ + + + + + +hard-light+ + + + + + +soft-light+ + + + + + +difference+ + + + + + +exclusion+ + + + + + +hue+ + + + + + +saturation+ + + + + + +color+ + + + + + +luminosity+ + + + + +Canvas test: 2d.composite.grid.filter.shadow.fillRect +2d.composite.grid.filter.shadow.fillRect
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.fillRect.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.fillRect.html new file mode 100644 index 00000000000..0f6b88fd5e9 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.fillRect.html @@ -0,0 +1,923 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.filter.shadow.fillRect +2d.composite.grid.filter.shadow.fillRect
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.fillRect.png b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.fillRect.png new file mode 100644 index 0000000000000000000000000000000000000000..fde787731168e3a2565ca15d6da5e160a03ef484 GIT binary patch literal 4085 zcmZ`+3piBi8y^+6b*cULw}sGUQLCuLsource-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +NsQr)GxHyIYsJ%?XP)zX-#PDl&i9_*@Av+`-%p>kRryxq zTL=WAa{QQ$BLpHhEc@^JMnN{CDe*ohJ1JbWx3z&t7mf!Md@2O8uK2jkA?K)U{tzr- za}P%G1N6})-nt|4DXU`>u5Bu`*&4g*hl_V1*RJpk<>mjVY-l_ZHXwh@Ppv`4z|%wX zT6!8`fAF?FX@?qvUIaI8Pw18J_?3O^F4}MFe**0Ot9xe~G`1-w(jwAAz#NoB2(0tC z^Oi_v6U}()-3?ZI;TqX1K_In{Uh(&6{1LrztlY;1S2fo3J_P)(RcM>8{d+D1GGV)F z6J*sl-jHv$#K>)_XIF`hP9>b|${O&5Q#uETttUdp8o7G{e<`F1ZGY&|sqOf7$?Y)^ zg&4@E_%eRbu~ZL~_+4zN-kWBQ&}npZceniueQWq7+y>3DAt-J-v2%Zmg=BQp2O&In z9{bk=apatZ8y=X4pDY@gOShDcWvK0etXW?VS$`0+`XEG386vl4$wbT}QB3WJcH%m? z4hoIHlgbOqP2!j;5A( z0jJqMIb}pK2V8kR>;8bY^w+tmSY)-So|RknH1Fc9viqjLSWa?sx zUb2$z=$h6gY-SPaSgn@kKg%yK4FYC+!D2VDz_ z-S)??qLD}{`OR^cGev@$dkCiupn|h6s9-!ZuUXJ3!wR 8&ND7GE|Q` zsfdtT(b99v0r9!C3%LGGYSu`@LuF{zS83@lR%Ncv^?}WCSe4c@(?DWe_p_%p?fGu| zZd)<`j3~NcmVM#|(7*z_NM!32%2*b@t}_TVq0}^KaGBGC=e;pg9-9NiFN8BKOm`h5 z>dCySVNu@l!parat|bICF>E=$Jc*(P0DDummp~lTiOg_!&@5#>n@J~%*CB`AhnR=r zWw$A*gIT5*-c7S6><)R2oubDP@arf-Miq!s?7^CJALxhCsLd*F)VXSmRIGEGJoHO% z2BW)kyM;iED~XZY@`XU0u3Bp#lKu|~q`1(Vi;0#gbtxuHWpmubhs$_Ok0H#od!_-! zm#Ub|$CG+2v{0^=9@I) `>e&ruX;Vy@5yND@SZ9`3GE&&E0+ a@Uu_p=E@xxvj2C9I3*UYW7Z9fs4JODK=TJR~mQ3YZx3nj8^)Wda?f>-FUR zl~i8jUY-OYnWSBpg+mPf(a|r~{Ws==j` >U7239Bl#+rbK*vHC_Js$(~aIL zL~F?SRJb~`hxK3%uo&t??@N3{q6Tw&c!B0MM|nX_Z$iJ$(gi5(0L^~N2)ZNqX~v0q zTO+G)7%(sv2%oN6qR+C|_=i*wNX(q$yNFFHjufS--tuA?d@9pMMkp_Jp+P?OQWtVN zX{+3q^6Nd2x7~8D`59y|3L!j-B l z^z#=L&gj3My39b!Ys==F!+2!$)g*?%!srwk%W*yoa%+gJN-`cTEftjW1d_V~Rz9i( z%gPM_C8!y$-*N@~qFX!|w;DE_cW*AY)$I4=c&p093;Q7wCgc&5vJa8`Hj9G~4-9?W zsXSJLO}B185JlmvdEu172CP!AOiadAVQ|vdF<0v(Z%!HC)~fua&DjyQVqqu3H@M39 zuw5ObcKtcisLD=pv~&9wi1Y8iENn}V=$KRt4UBj=1~S#4ZTC$*h(oOh4$ UU^tOCy9Tm5eUNOQ26C`;^e}ihw)5ajB75em&`D?hOcVy%SwZ{-2n_ZV= zS~2u`T>3PRonV@!UF!8L*^L@TeYl%#Z>XzT>ifSqpup1;)QI$Wi(X4ehYl+LScCHl z^l$645jIt3cly%fcmgkD0n3qHXx?Aidzy+j=0Uws-^0t7A!bW`RaTj6aa!~M^H#u4 zzcQW*f|?h4-HaX%I@0y-Wn0;V`i6jpV+_(Hezm=Itnt9JI>~+03;attEUGvGaPa-= zcX}!Lep waR2Z%Hr;=dNrc_bTI>yV0?YqAXqV946L-c3e|L~t zFa`on)NSW2r7N^$fn%RZcbB3#c Nn>eKQH>gPoKw72 qt_V>Q*pv6iZ$!^cWj0``-~TP)KN zfn4Os%UXUChRYsB*h=weRr`R`u-V!?K-g{j`TQ{7wzO1s>Iu@4mQt9OyvaIpY 7 z`1d5XGE{Aa2=qp5=(ekLL=K=P-#WhbPCBoFw5Yxp8aKDE2D_7hP1MoqU#$tRl8tPi zaz&0!w6)rZ*=G#T&TudoI-flZTFoP8TZOe5E>!Al-|Q*HI*$*!1b1i+Hh${kD05b? zBs*_=_7Rlmy H&3Cf zUP<&KHg+?s%^3iO?;H5o>;3>B*KYjPO#ia5Z-5Nf5&tC?B#Cfr*e!NhvV!miRb1qS z#Jp90COR(mfq_xa`D0NIp(?U|1v#`r{Pr*$&dS_d?sKvG8L1yhfZot)lzY{;1#@^m zqWT$*jFHkbOfO)fG3=?iM!JPSsf@N<2G{?)Q>mMeLT<$it|c`?PiR#SNbJvY0M?i? zG*!El)qp$hE)1GqG;q7;-@=%!8mcivKFc*eX4!5;->n&EUdGW^5Z!DQ+Am~Sv|DoP zo4*QyWN`Pm%4=7b*CR?xx + + + + + + Canvas test: 2d.composite.grid.filter.shadow.fillRect +2d.composite.grid.filter.shadow.fillRect
+ + + ++ ++ diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.fillRect.worker.js b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.fillRect.worker.js new file mode 100644 index 00000000000..f495009b301 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.fillRect.worker.js @@ -0,0 +1,659 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.grid.filter.shadow.fillRect +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-over' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-in' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-out' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-atop' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-over' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-in' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-out' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-atop' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'lighter' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'copy' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'xor' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'multiply' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'screen' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'overlay' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'darken' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'lighten' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color-dodge' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color-burn' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'hard-light' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'soft-light' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'difference' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'exclusion' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'hue' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'saturation' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'luminosity' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.pattern-expected.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.pattern-expected.html new file mode 100644 index 00000000000..f45fe82c302 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.pattern-expected.html @@ -0,0 +1,270 @@ + + +source-over+ + + + + + +source-in+ + + + + + +source-out+ + + + + + +source-atop+ + + + + + +destination-over+ + + + + + +destination-in+ + + + + + +destination-out+ + + + + + +destination-atop+ + + + + + +lighter+ + + + + + +copy+ + + + + + +xor+ + + + + + +multiply+ + + + + + +screen+ + + + + + +overlay+ + + + + + +darken+ + + + + + +lighten+ + + + + + +color-dodge+ + + + + + +color-burn+ + + + + + +hard-light+ + + + + + +soft-light+ + + + + + +difference+ + + + + + +exclusion+ + + + + + +hue+ + + + + + +saturation+ + + + + + +color+ + + + + + +luminosity+ + + + + +Canvas test: 2d.composite.grid.filter.shadow.pattern +2d.composite.grid.filter.shadow.pattern
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.pattern.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.pattern.html new file mode 100644 index 00000000000..e89aff9196d --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.pattern.html @@ -0,0 +1,1027 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.filter.shadow.pattern +2d.composite.grid.filter.shadow.pattern
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.pattern.png b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.pattern.png new file mode 100644 index 0000000000000000000000000000000000000000..fde787731168e3a2565ca15d6da5e160a03ef484 GIT binary patch literal 4085 zcmZ`+3piBi8y^+6b*cULw}sGUQLCuLsource-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +NsQr)GxHyIYsJ%?XP)zX-#PDl&i9_*@Av+`-%p>kRryxq zTL=WAa{QQ$BLpHhEc@^JMnN{CDe*ohJ1JbWx3z&t7mf!Md@2O8uK2jkA?K)U{tzr- za}P%G1N6})-nt|4DXU`>u5Bu`*&4g*hl_V1*RJpk<>mjVY-l_ZHXwh@Ppv`4z|%wX zT6!8`fAF?FX@?qvUIaI8Pw18J_?3O^F4}MFe**0Ot9xe~G`1-w(jwAAz#NoB2(0tC z^Oi_v6U}()-3?ZI;TqX1K_In{Uh(&6{1LrztlY;1S2fo3J_P)(RcM>8{d+D1GGV)F z6J*sl-jHv$#K>)_XIF`hP9>b|${O&5Q#uETttUdp8o7G{e<`F1ZGY&|sqOf7$?Y)^ zg&4@E_%eRbu~ZL~_+4zN-kWBQ&}npZceniueQWq7+y>3DAt-J-v2%Zmg=BQp2O&In z9{bk=apatZ8y=X4pDY@gOShDcWvK0etXW?VS$`0+`XEG386vl4$wbT}QB3WJcH%m? z4hoIHlgbOqP2!j;5A( z0jJqMIb}pK2V8kR>;8bY^w+tmSY)-So|RknH1Fc9viqjLSWa?sx zUb2$z=$h6gY-SPaSgn@kKg%yK4FYC+!D2VDz_ z-S)??qLD}{`OR^cGev@$dkCiupn|h6s9-!ZuUXJ3!wR 8&ND7GE|Q` zsfdtT(b99v0r9!C3%LGGYSu`@LuF{zS83@lR%Ncv^?}WCSe4c@(?DWe_p_%p?fGu| zZd)<`j3~NcmVM#|(7*z_NM!32%2*b@t}_TVq0}^KaGBGC=e;pg9-9NiFN8BKOm`h5 z>dCySVNu@l!parat|bICF>E=$Jc*(P0DDummp~lTiOg_!&@5#>n@J~%*CB`AhnR=r zWw$A*gIT5*-c7S6><)R2oubDP@arf-Miq!s?7^CJALxhCsLd*F)VXSmRIGEGJoHO% z2BW)kyM;iED~XZY@`XU0u3Bp#lKu|~q`1(Vi;0#gbtxuHWpmubhs$_Ok0H#od!_-! zm#Ub|$CG+2v{0^=9@I) `>e&ruX;Vy@5yND@SZ9`3GE&&E0+ a@Uu_p=E@xxvj2C9I3*UYW7Z9fs4JODK=TJR~mQ3YZx3nj8^)Wda?f>-FUR zl~i8jUY-OYnWSBpg+mPf(a|r~{Ws==j` >U7239Bl#+rbK*vHC_Js$(~aIL zL~F?SRJb~`hxK3%uo&t??@N3{q6Tw&c!B0MM|nX_Z$iJ$(gi5(0L^~N2)ZNqX~v0q zTO+G)7%(sv2%oN6qR+C|_=i*wNX(q$yNFFHjufS--tuA?d@9pMMkp_Jp+P?OQWtVN zX{+3q^6Nd2x7~8D`59y|3L!j-B l z^z#=L&gj3My39b!Ys==F!+2!$)g*?%!srwk%W*yoa%+gJN-`cTEftjW1d_V~Rz9i( z%gPM_C8!y$-*N@~qFX!|w;DE_cW*AY)$I4=c&p093;Q7wCgc&5vJa8`Hj9G~4-9?W zsXSJLO}B185JlmvdEu172CP!AOiadAVQ|vdF<0v(Z%!HC)~fua&DjyQVqqu3H@M39 zuw5ObcKtcisLD=pv~&9wi1Y8iENn}V=$KRt4UBj=1~S#4ZTC$*h(oOh4$ UU^tOCy9Tm5eUNOQ26C`;^e}ihw)5ajB75em&`D?hOcVy%SwZ{-2n_ZV= zS~2u`T>3PRonV@!UF!8L*^L@TeYl%#Z>XzT>ifSqpup1;)QI$Wi(X4ehYl+LScCHl z^l$645jIt3cly%fcmgkD0n3qHXx?Aidzy+j=0Uws-^0t7A!bW`RaTj6aa!~M^H#u4 zzcQW*f|?h4-HaX%I@0y-Wn0;V`i6jpV+_(Hezm=Itnt9JI>~+03;attEUGvGaPa-= zcX}!Lep waR2Z%Hr;=dNrc_bTI>yV0?YqAXqV946L-c3e|L~t zFa`on)NSW2r7N^$fn%RZcbB3#c Nn>eKQH>gPoKw72 qt_V>Q*pv6iZ$!^cWj0``-~TP)KN zfn4Os%UXUChRYsB*h=weRr`R`u-V!?K-g{j`TQ{7wzO1s>Iu@4mQt9OyvaIpY 7 z`1d5XGE{Aa2=qp5=(ekLL=K=P-#WhbPCBoFw5Yxp8aKDE2D_7hP1MoqU#$tRl8tPi zaz&0!w6)rZ*=G#T&TudoI-flZTFoP8TZOe5E>!Al-|Q*HI*$*!1b1i+Hh${kD05b? zBs*_=_7Rlmy H&3Cf zUP<&KHg+?s%^3iO?;H5o>;3>B*KYjPO#ia5Z-5Nf5&tC?B#Cfr*e!NhvV!miRb1qS z#Jp90COR(mfq_xa`D0NIp(?U|1v#`r{Pr*$&dS_d?sKvG8L1yhfZot)lzY{;1#@^m zqWT$*jFHkbOfO)fG3=?iM!JPSsf@N<2G{?)Q>mMeLT<$it|c`?PiR#SNbJvY0M?i? zG*!El)qp$hE)1GqG;q7;-@=%!8mcivKFc*eX4!5;->n&EUdGW^5Z!DQ+Am~Sv|DoP zo4*QyWN`Pm%4=7b*CR?xx + + + + + + Canvas test: 2d.composite.grid.filter.shadow.pattern +2d.composite.grid.filter.shadow.pattern
+ + + ++ ++ diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.pattern.worker.js b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.pattern.worker.js new file mode 100644 index 00000000000..d960d0d5401 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.filter.shadow.pattern.worker.js @@ -0,0 +1,763 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.grid.filter.shadow.pattern +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'lighter' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'copy' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'xor' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'multiply' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'screen' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'overlay' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'darken' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'lighten' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color-dodge' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color-burn' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'hard-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'soft-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'difference' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'exclusion' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'hue' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'saturation' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + ctx.filter = 'drop-shadow(5px -5px 0px rgb(255, 154, 0))' + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'luminosity' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.drawImage-expected.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.drawImage-expected.html new file mode 100644 index 00000000000..923d8360a9d --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.drawImage-expected.html @@ -0,0 +1,270 @@ + + +source-over+ + + + + + +source-in+ + + + + + +source-out+ + + + + + +source-atop+ + + + + + +destination-over+ + + + + + +destination-in+ + + + + + +destination-out+ + + + + + +destination-atop+ + + + + + +lighter+ + + + + + +copy+ + + + + + +xor+ + + + + + +multiply+ + + + + + +screen+ + + + + + +overlay+ + + + + + +darken+ + + + + + +lighten+ + + + + + +color-dodge+ + + + + + +color-burn+ + + + + + +hard-light+ + + + + + +soft-light+ + + + + + +difference+ + + + + + +exclusion+ + + + + + +hue+ + + + + + +saturation+ + + + + + +color+ + + + + + +luminosity+ + + + + +Canvas test: 2d.composite.grid.no_filter.no_shadow.drawImage +2d.composite.grid.no_filter.no_shadow.drawImage
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.drawImage.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.drawImage.html new file mode 100644 index 00000000000..54a53b46576 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.drawImage.html @@ -0,0 +1,949 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.no_filter.no_shadow.drawImage +2d.composite.grid.no_filter.no_shadow.drawImage
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.drawImage.png b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.drawImage.png new file mode 100644 index 0000000000000000000000000000000000000000..ce392a1dcccc5e06a3d163dff873a5647ecdb65c GIT binary patch literal 1572 zcmeAS@N?(olHy`uVBq!ia0y~yV0-|?Ivi|35$S&kQ9z0<$=lt9;Xep2*t>i(0|V<# zPZ!6KiaBp@Z=85LOr$N)j?Y=$FO+@vgj*3Ccn&o>izk#Uyy%wKs9(xmB3ZC1W#^r} zEOirY)So8YzbbknUm#&KBhXwVP-pt~Qv2^p`*kMAL#tjVSFv4t{7?Dh-{Y6Iy<}u~ zAjxUKz`}us-)M=?kB{%$F7-s~aOTX<%gR2Mu35U~@2ta%_a6I@@qgad+Mgf4?|D}F zT>h|8y~UTmZ`)hz`tKR#$i4cWZ+zzQs^`ABcR#Otz$wAN#6klc_3~BXynGY)Yge+W z8>*lDj!v!@sbpenU|__+NZ~+;`9N;#7l!^E`}fDc@Yugz+y7G1?$E!iH|vi9iTAa) zzc4U-=)vZjvZbrre^xBETxY8HDSWwDrR-{XKkfNHBJ$_X{cpXt`akdN)N|Z->#uw{ zoEi7^K;q^zl^gHxpFVZ}e(t|source-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +Qd-X;zVefx{VFJ37fqW9coyBD@5C7dGA3p1`*50p%wujws#P|Na3L) &^>HMkRzyH?X4stq1Xk+mT$!acmh4X)|S!}s!S=jBv={FIcnXjI};31H} zz=4KI2&{L3yT3fFyVtLMws7jbUo+-CRDQ$Xus!E8Gs6L6Axx7wZiMQ+JHGySG;h(= zhg)D_RQEf3Vg32&wzJM}`5(-~Q37Bq6-W|m2-{UP+ + + + + + Canvas test: 2d.composite.grid.no_filter.no_shadow.drawImage +2d.composite.grid.no_filter.no_shadow.drawImage
+ + + ++ ++ diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.drawImage.worker.js b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.drawImage.worker.js new file mode 100644 index 00000000000..de1686a76e8 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.drawImage.worker.js @@ -0,0 +1,685 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.grid.no_filter.no_shadow.drawImage +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'source-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'source-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'source-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'source-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'destination-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'destination-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'destination-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'destination-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'lighter' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'copy' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'xor' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'multiply' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'screen' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'overlay' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'darken' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'lighten' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'color-dodge' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'color-burn' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'hard-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'soft-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'difference' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'exclusion' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'hue' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'saturation' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'color' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'luminosity' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.fillRect-expected.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.fillRect-expected.html new file mode 100644 index 00000000000..c809e56cac3 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.fillRect-expected.html @@ -0,0 +1,270 @@ + + +source-over+ + + + + + +source-in+ + + + + + +source-out+ + + + + + +source-atop+ + + + + + +destination-over+ + + + + + +destination-in+ + + + + + +destination-out+ + + + + + +destination-atop+ + + + + + +lighter+ + + + + + +copy+ + + + + + +xor+ + + + + + +multiply+ + + + + + +screen+ + + + + + +overlay+ + + + + + +darken+ + + + + + +lighten+ + + + + + +color-dodge+ + + + + + +color-burn+ + + + + + +hard-light+ + + + + + +soft-light+ + + + + + +difference+ + + + + + +exclusion+ + + + + + +hue+ + + + + + +saturation+ + + + + + +color+ + + + + + +luminosity+ + + + + +Canvas test: 2d.composite.grid.no_filter.no_shadow.fillRect +2d.composite.grid.no_filter.no_shadow.fillRect
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.html new file mode 100644 index 00000000000..e69af8a79a9 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.html @@ -0,0 +1,871 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.no_filter.no_shadow.fillRect +2d.composite.grid.no_filter.no_shadow.fillRect
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.png b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.png new file mode 100644 index 0000000000000000000000000000000000000000..ce392a1dcccc5e06a3d163dff873a5647ecdb65c GIT binary patch literal 1572 zcmeAS@N?(olHy`uVBq!ia0y~yV0-|?Ivi|35$S&kQ9z0<$=lt9;Xep2*t>i(0|V<# zPZ!6KiaBp@Z=85LOr$N)j?Y=$FO+@vgj*3Ccn&o>izk#Uyy%wKs9(xmB3ZC1W#^r} zEOirY)So8YzbbknUm#&KBhXwVP-pt~Qv2^p`*kMAL#tjVSFv4t{7?Dh-{Y6Iy<}u~ zAjxUKz`}us-)M=?kB{%$F7-s~aOTX<%gR2Mu35U~@2ta%_a6I@@qgad+Mgf4?|D}F zT>h|8y~UTmZ`)hz`tKR#$i4cWZ+zzQs^`ABcR#Otz$wAN#6klc_3~BXynGY)Yge+W z8>*lDj!v!@sbpenU|__+NZ~+;`9N;#7l!^E`}fDc@Yugz+y7G1?$E!iH|vi9iTAa) zzc4U-=)vZjvZbrre^xBETxY8HDSWwDrR-{XKkfNHBJ$_X{cpXt`akdN)N|Z->#uw{ zoEi7^K;q^zl^gHxpFVZ}e(t|source-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +Qd-X;zVefx{VFJ37fqW9coyBD@5C7dGA3p1`*50p%wujws#P|Na3L) &^>HMkRzyH?X4stq1Xk+mT$!acmh4X)|S!}s!S=jBv={FIcnXjI};31H} zz=4KI2&{L3yT3fFyVtLMws7jbUo+-CRDQ$Xus!E8Gs6L6Axx7wZiMQ+JHGySG;h(= zhg)D_RQEf3Vg32&wzJM}`5(-~Q37Bq6-W|m2-{UP+ + + + + + Canvas test: 2d.composite.grid.no_filter.no_shadow.fillRect +2d.composite.grid.no_filter.no_shadow.fillRect
+ + + ++ ++ diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.worker.js b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.worker.js new file mode 100644 index 00000000000..cb60645b704 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.fillRect.worker.js @@ -0,0 +1,607 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.grid.no_filter.no_shadow.fillRect +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'source-over' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'source-in' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'source-out' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'source-atop' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'destination-over' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'destination-in' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'destination-out' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'destination-atop' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'lighter' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'copy' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'xor' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'multiply' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'screen' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'overlay' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'darken' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'lighten' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'color-dodge' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'color-burn' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'hard-light' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'soft-light' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'difference' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'exclusion' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'hue' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'saturation' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'color' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'luminosity' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.pattern-expected.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.pattern-expected.html new file mode 100644 index 00000000000..f052442a637 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.pattern-expected.html @@ -0,0 +1,270 @@ + + +source-over+ + + + + + +source-in+ + + + + + +source-out+ + + + + + +source-atop+ + + + + + +destination-over+ + + + + + +destination-in+ + + + + + +destination-out+ + + + + + +destination-atop+ + + + + + +lighter+ + + + + + +copy+ + + + + + +xor+ + + + + + +multiply+ + + + + + +screen+ + + + + + +overlay+ + + + + + +darken+ + + + + + +lighten+ + + + + + +color-dodge+ + + + + + +color-burn+ + + + + + +hard-light+ + + + + + +soft-light+ + + + + + +difference+ + + + + + +exclusion+ + + + + + +hue+ + + + + + +saturation+ + + + + + +color+ + + + + + +luminosity+ + + + + +Canvas test: 2d.composite.grid.no_filter.no_shadow.pattern +2d.composite.grid.no_filter.no_shadow.pattern
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.pattern.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.pattern.html new file mode 100644 index 00000000000..b6008b7c79f --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.pattern.html @@ -0,0 +1,975 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.no_filter.no_shadow.pattern +2d.composite.grid.no_filter.no_shadow.pattern
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.pattern.png b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.pattern.png new file mode 100644 index 0000000000000000000000000000000000000000..ce392a1dcccc5e06a3d163dff873a5647ecdb65c GIT binary patch literal 1572 zcmeAS@N?(olHy`uVBq!ia0y~yV0-|?Ivi|35$S&kQ9z0<$=lt9;Xep2*t>i(0|V<# zPZ!6KiaBp@Z=85LOr$N)j?Y=$FO+@vgj*3Ccn&o>izk#Uyy%wKs9(xmB3ZC1W#^r} zEOirY)So8YzbbknUm#&KBhXwVP-pt~Qv2^p`*kMAL#tjVSFv4t{7?Dh-{Y6Iy<}u~ zAjxUKz`}us-)M=?kB{%$F7-s~aOTX<%gR2Mu35U~@2ta%_a6I@@qgad+Mgf4?|D}F zT>h|8y~UTmZ`)hz`tKR#$i4cWZ+zzQs^`ABcR#Otz$wAN#6klc_3~BXynGY)Yge+W z8>*lDj!v!@sbpenU|__+NZ~+;`9N;#7l!^E`}fDc@Yugz+y7G1?$E!iH|vi9iTAa) zzc4U-=)vZjvZbrre^xBETxY8HDSWwDrR-{XKkfNHBJ$_X{cpXt`akdN)N|Z->#uw{ zoEi7^K;q^zl^gHxpFVZ}e(t|source-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +Qd-X;zVefx{VFJ37fqW9coyBD@5C7dGA3p1`*50p%wujws#P|Na3L) &^>HMkRzyH?X4stq1Xk+mT$!acmh4X)|S!}s!S=jBv={FIcnXjI};31H} zz=4KI2&{L3yT3fFyVtLMws7jbUo+-CRDQ$Xus!E8Gs6L6Axx7wZiMQ+JHGySG;h(= zhg)D_RQEf3Vg32&wzJM}`5(-~Q37Bq6-W|m2-{UP+ + + + + + Canvas test: 2d.composite.grid.no_filter.no_shadow.pattern +2d.composite.grid.no_filter.no_shadow.pattern
+ + + ++ ++ diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.pattern.worker.js b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.pattern.worker.js new file mode 100644 index 00000000000..e1479261ce2 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.no_shadow.pattern.worker.js @@ -0,0 +1,711 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.grid.no_filter.no_shadow.pattern +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'source-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'source-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'source-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'source-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'destination-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'destination-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'destination-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'destination-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'lighter' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'copy' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'xor' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'multiply' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'screen' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'overlay' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'darken' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'lighten' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'color-dodge' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'color-burn' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'hard-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'soft-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'difference' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'exclusion' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'hue' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'saturation' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'color' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + // No shadow. + + ctx.globalCompositeOperation = 'luminosity' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage-expected.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage-expected.html new file mode 100644 index 00000000000..ad07c35d310 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage-expected.html @@ -0,0 +1,270 @@ + + +source-over+ + + + + + +source-in+ + + + + + +source-out+ + + + + + +source-atop+ + + + + + +destination-over+ + + + + + +destination-in+ + + + + + +destination-out+ + + + + + +destination-atop+ + + + + + +lighter+ + + + + + +copy+ + + + + + +xor+ + + + + + +multiply+ + + + + + +screen+ + + + + + +overlay+ + + + + + +darken+ + + + + + +lighten+ + + + + + +color-dodge+ + + + + + +color-burn+ + + + + + +hard-light+ + + + + + +soft-light+ + + + + + +difference+ + + + + + +exclusion+ + + + + + +hue+ + + + + + +saturation+ + + + + + +color+ + + + + + +luminosity+ + + + + +Canvas test: 2d.composite.grid.no_filter.shadow.drawImage +2d.composite.grid.no_filter.shadow.drawImage
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage.html new file mode 100644 index 00000000000..d25f183aeb8 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage.html @@ -0,0 +1,1001 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.no_filter.shadow.drawImage +2d.composite.grid.no_filter.shadow.drawImage
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage.png b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage.png new file mode 100644 index 0000000000000000000000000000000000000000..aca03a61b220c1022c65b71dbd092f7b6de3c754 GIT binary patch literal 2314 zcmc2eq7+ypX4+M|43I>=CQy8EEt$>0YRuEGKtO_WD2^19}0-{w2$0pSQRK$x? zu~CszG=!+2*gz7CCCCx5u_O%`f`W-LCILc{h8)|Ct(^?V6n}Mho_D|R`?LGL|Ys zhlN-yv|b1RfCX|(&<+4F8HC|#ZU&=wqYdhuODVLxKRvaNnTbECK*?Ix=YEu8gY^ zo=2)f0-|kn)x%G}y13oSf@5FlwDuIEpymQ=`#ieIM1R$wUxt&D$Z3QIWDXN+!pg^Y z?^source-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +fy zblZvi*CMV6Y}ZJ-+47im<9dYmmpQgnCPl7RJ<6D4h6hY$4?N2*zU0kGUMFj!qM%^2 zFZR{j*EJ%A;6WeRzqZy+Ga5{|HnI{6EmPF%@~aed5qd2*WYcxLiGARI;D#FsB~$GL zbq`08>ms5YMTazfs|T&H5PREIKJ}H{jj`Mvm}@=_Tqk;Z!keDOwQG3$o+amv+v3}P z5!$7W&0P$b%$YrmhX2oU l&;MQJHp>h91u|>~c}KApy5V#=qk4wooqr zz)v>0AHZ<$rDc5+&G&}l7n8`|M4mjM)#YrcGOgxZfjB+%_-NmrA#obr&u`#Iwyc}I ziEu3@F^7uXn;k<9EJ}`9@8gVanQ5@b!yY&E1im~|_8ncBS0|>V^m7D(j9)oug+nd7 zF05s2!grfLlvLd w} zv`hnMBNQVcO{EO5Eu8F|oh9f(b?@JW&%8R%VtQ4CI~SzGI*Lvnj%4#TsQQ&05P?}U z#MU}9nDx0r?`IJCskRx1*(`Ti }3k#~!Bmq@}1%bEUb zB _b@(23RQc&Uh3iCmP-z*Hjcbnp~0P~)4tpo9P zXVIM{`@pu=qC3$|KJD#V>F`s5N`6-YTQlmN1_m@QQ;$l9!(i(=clFGa08^s1+MRAK zCwdqP_S6UG)l|R25zEmXzK^z8BpHf)pRhoNO~OXgKs+!NkBT~8!fX~r+WcIsQ2%RF znLeo+y56`a9cCWL@0zI{<3KZB|Da#_co$zYjIL7fAvxMwGF;3DRVS-C1RgGcM1pF) zAV{uI^`k5YmyXURqjM4!ne@^zaX@nRrHI~M *&&YdUwM`U&@9BE}j8+ xQ^8CL`LS-|$t2^=A2~c5T^Rk%4dage3^H{YyL2ZnOe8n#k-=d>bzjAv_zM@JUbFxJ literal 0 HcmV?d00001 diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage.w.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage.w.html new file mode 100644 index 00000000000..c66b467d627 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage.w.html @@ -0,0 +1,1368 @@ + + + + + + + Canvas test: 2d.composite.grid.no_filter.shadow.drawImage +2d.composite.grid.no_filter.shadow.drawImage
+ + + ++ ++ diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage.worker.js b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage.worker.js new file mode 100644 index 00000000000..c7827238f69 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.drawImage.worker.js @@ -0,0 +1,737 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.grid.no_filter.shadow.drawImage +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'lighter' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'copy' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'xor' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'multiply' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'screen' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'overlay' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'darken' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'lighten' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color-dodge' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color-burn' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'hard-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'soft-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'difference' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'exclusion' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'hue' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'saturation' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'luminosity' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.drawImage(img_canvas, 5, 5, 50, 30); +}, ""); + +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect-expected.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect-expected.html new file mode 100644 index 00000000000..e16a5fcf458 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect-expected.html @@ -0,0 +1,270 @@ + + +source-over+ + + + + + +source-in+ + + + + + +source-out+ + + + + + +source-atop+ + + + + + +destination-over+ + + + + + +destination-in+ + + + + + +destination-out+ + + + + + +destination-atop+ + + + + + +lighter+ + + + + + +copy+ + + + + + +xor+ + + + + + +multiply+ + + + + + +screen+ + + + + + +overlay+ + + + + + +darken+ + + + + + +lighten+ + + + + + +color-dodge+ + + + + + +color-burn+ + + + + + +hard-light+ + + + + + +soft-light+ + + + + + +difference+ + + + + + +exclusion+ + + + + + +hue+ + + + + + +saturation+ + + + + + +color+ + + + + + +luminosity+ + + + + +Canvas test: 2d.composite.grid.no_filter.shadow.fillRect +2d.composite.grid.no_filter.shadow.fillRect
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect.html new file mode 100644 index 00000000000..3fdbfa72caf --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect.html @@ -0,0 +1,923 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.no_filter.shadow.fillRect +2d.composite.grid.no_filter.shadow.fillRect
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect.png b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect.png new file mode 100644 index 0000000000000000000000000000000000000000..aca03a61b220c1022c65b71dbd092f7b6de3c754 GIT binary patch literal 2314 zcmc2eq7+ypX4+M|43I>=CQy8EEt$>0YRuEGKtO_WD2^19}0-{w2$0pSQRK$x? zu~CszG=!+2*gz7CCCCx5u_O%`f`W-LCILc{h8)|Ct(^?V6n}Mho_D|R`?LGL|Ys zhlN-yv|b1RfCX|(&<+4F8HC|#ZU&=wqYdhuODVLxKRvaNnTbECK*?Ix=YEu8gY^ zo=2)f0-|kn)x%G}y13oSf@5FlwDuIEpymQ=`#ieIM1R$wUxt&D$Z3QIWDXN+!pg^Y z?^source-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +fy zblZvi*CMV6Y}ZJ-+47im<9dYmmpQgnCPl7RJ<6D4h6hY$4?N2*zU0kGUMFj!qM%^2 zFZR{j*EJ%A;6WeRzqZy+Ga5{|HnI{6EmPF%@~aed5qd2*WYcxLiGARI;D#FsB~$GL zbq`08>ms5YMTazfs|T&H5PREIKJ}H{jj`Mvm}@=_Tqk;Z!keDOwQG3$o+amv+v3}P z5!$7W&0P$b%$YrmhX2oU l&;MQJHp>h91u|>~c}KApy5V#=qk4wooqr zz)v>0AHZ<$rDc5+&G&}l7n8`|M4mjM)#YrcGOgxZfjB+%_-NmrA#obr&u`#Iwyc}I ziEu3@F^7uXn;k<9EJ}`9@8gVanQ5@b!yY&E1im~|_8ncBS0|>V^m7D(j9)oug+nd7 zF05s2!grfLlvLd w} zv`hnMBNQVcO{EO5Eu8F|oh9f(b?@JW&%8R%VtQ4CI~SzGI*Lvnj%4#TsQQ&05P?}U z#MU}9nDx0r?`IJCskRx1*(`Ti }3k#~!Bmq@}1%bEUb zB _b@(23RQc&Uh3iCmP-z*Hjcbnp~0P~)4tpo9P zXVIM{`@pu=qC3$|KJD#V>F`s5N`6-YTQlmN1_m@QQ;$l9!(i(=clFGa08^s1+MRAK zCwdqP_S6UG)l|R25zEmXzK^z8BpHf)pRhoNO~OXgKs+!NkBT~8!fX~r+WcIsQ2%RF znLeo+y56`a9cCWL@0zI{<3KZB|Da#_co$zYjIL7fAvxMwGF;3DRVS-C1RgGcM1pF) zAV{uI^`k5YmyXURqjM4!ne@^zaX@nRrHI~M *&&YdUwM`U&@9BE}j8+ xQ^8CL`LS-|$t2^=A2~c5T^Rk%4dage3^H{YyL2ZnOe8n#k-=d>bzjAv_zM@JUbFxJ literal 0 HcmV?d00001 diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect.w.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect.w.html new file mode 100644 index 00000000000..519631612f0 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect.w.html @@ -0,0 +1,1290 @@ + + + + + + + Canvas test: 2d.composite.grid.no_filter.shadow.fillRect +2d.composite.grid.no_filter.shadow.fillRect
+ + + ++ ++ diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect.worker.js b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect.worker.js new file mode 100644 index 00000000000..217fe38a8de --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.fillRect.worker.js @@ -0,0 +1,659 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.grid.no_filter.shadow.fillRect +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-over' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-in' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-out' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-atop' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-over' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-in' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-out' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-atop' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'lighter' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'copy' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'xor' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'multiply' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'screen' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'overlay' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'darken' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'lighten' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color-dodge' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color-burn' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'hard-light' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'soft-light' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'difference' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'exclusion' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'hue' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'saturation' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'luminosity' + + ctx.fillStyle = 'rgb(52, 255, 52)'; + ctx.fillRect(5, 5, 50, 30); +}, ""); + +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern-expected.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern-expected.html new file mode 100644 index 00000000000..01e1d4d7b26 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern-expected.html @@ -0,0 +1,270 @@ + + +source-over+ + + + + + +source-in+ + + + + + +source-out+ + + + + + +source-atop+ + + + + + +destination-over+ + + + + + +destination-in+ + + + + + +destination-out+ + + + + + +destination-atop+ + + + + + +lighter+ + + + + + +copy+ + + + + + +xor+ + + + + + +multiply+ + + + + + +screen+ + + + + + +overlay+ + + + + + +darken+ + + + + + +lighten+ + + + + + +color-dodge+ + + + + + +color-burn+ + + + + + +hard-light+ + + + + + +soft-light+ + + + + + +difference+ + + + + + +exclusion+ + + + + + +hue+ + + + + + +saturation+ + + + + + +color+ + + + + + +luminosity+ + + + + +Canvas test: 2d.composite.grid.no_filter.shadow.pattern +2d.composite.grid.no_filter.shadow.pattern
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern.html new file mode 100644 index 00000000000..d9df6be84f1 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern.html @@ -0,0 +1,1027 @@ + + + + + +source-over++ + + +
source-in++ + + +
source-out++ + + +
source-atop++ + + +
destination-over++ + + +
destination-in++ + + +
destination-out++ + + +
destination-atop++ + + +
lighter++ + + +
copy++ + + +
xor++ + + +
multiply++ + + +
screen++ + + +
overlay++ + + +
darken++ + + +
lighten++ + + +
color-dodge++ + + +
color-burn++ + + +
hard-light++ + + +
soft-light++ + + +
difference++ + + +
exclusion++ + + +
hue++ + + +
saturation++ + + +
color++ + + +
luminosity++ + +
Canvas test: 2d.composite.grid.no_filter.shadow.pattern +2d.composite.grid.no_filter.shadow.pattern
+ + ++ +diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern.png b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern.png new file mode 100644 index 0000000000000000000000000000000000000000..aca03a61b220c1022c65b71dbd092f7b6de3c754 GIT binary patch literal 2314 zcmc2eq7+ypX4+M|43I>=CQy8EEt$>0YRuEGKtO_WD2^19}0-{w2$0pSQRK$x? zu~CszG=!+2*gz7CCCCx5u_O%`f`W-LCILc{h8)|Ct(^?V6n}Mho_D|R`?LGL|Ys zhlN-yv|b1RfCX|(&<+4F8HC|#ZU&=wqYdhuODVLxKRvaNnTbECK*?Ix=YEu8gY^ zo=2)f0-|kn)x%G}y13oSf@5FlwDuIEpymQ=`#ieIM1R$wUxt&D$Z3QIWDXN+!pg^Y z?^source-over+ + + + + +source-in+ + + + + +source-out+ + + + + +source-atop+ + + + + +destination-over+ + + + + +destination-in+ + + + + +destination-out+ + + + + +destination-atop+ + + + + +lighter+ + + + + +copy+ + + + + +xor+ + + + + +multiply+ + + + + +screen+ + + + + +overlay+ + + + + +darken+ + + + + +lighten+ + + + + +color-dodge+ + + + + +color-burn+ + + + + +hard-light+ + + + + +soft-light+ + + + + +difference+ + + + + +exclusion+ + + + + +hue+ + + + + +saturation+ + + + + +color+ + + + + +luminosity+ + + + +fy zblZvi*CMV6Y}ZJ-+47im<9dYmmpQgnCPl7RJ<6D4h6hY$4?N2*zU0kGUMFj!qM%^2 zFZR{j*EJ%A;6WeRzqZy+Ga5{|HnI{6EmPF%@~aed5qd2*WYcxLiGARI;D#FsB~$GL zbq`08>ms5YMTazfs|T&H5PREIKJ}H{jj`Mvm}@=_Tqk;Z!keDOwQG3$o+amv+v3}P z5!$7W&0P$b%$YrmhX2oU l&;MQJHp>h91u|>~c}KApy5V#=qk4wooqr zz)v>0AHZ<$rDc5+&G&}l7n8`|M4mjM)#YrcGOgxZfjB+%_-NmrA#obr&u`#Iwyc}I ziEu3@F^7uXn;k<9EJ}`9@8gVanQ5@b!yY&E1im~|_8ncBS0|>V^m7D(j9)oug+nd7 zF05s2!grfLlvLd w} zv`hnMBNQVcO{EO5Eu8F|oh9f(b?@JW&%8R%VtQ4CI~SzGI*Lvnj%4#TsQQ&05P?}U z#MU}9nDx0r?`IJCskRx1*(`Ti }3k#~!Bmq@}1%bEUb zB _b@(23RQc&Uh3iCmP-z*Hjcbnp~0P~)4tpo9P zXVIM{`@pu=qC3$|KJD#V>F`s5N`6-YTQlmN1_m@QQ;$l9!(i(=clFGa08^s1+MRAK zCwdqP_S6UG)l|R25zEmXzK^z8BpHf)pRhoNO~OXgKs+!NkBT~8!fX~r+WcIsQ2%RF znLeo+y56`a9cCWL@0zI{<3KZB|Da#_co$zYjIL7fAvxMwGF;3DRVS-C1RgGcM1pF) zAV{uI^`k5YmyXURqjM4!ne@^zaX@nRrHI~M *&&YdUwM`U&@9BE}j8+ xQ^8CL`LS-|$t2^=A2~c5T^Rk%4dage3^H{YyL2ZnOe8n#k-=d>bzjAv_zM@JUbFxJ literal 0 HcmV?d00001 diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern.w.html b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern.w.html new file mode 100644 index 00000000000..5c698e8c760 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern.w.html @@ -0,0 +1,1394 @@ + + + + + + + Canvas test: 2d.composite.grid.no_filter.shadow.pattern +2d.composite.grid.no_filter.shadow.pattern
+ + + ++ ++ diff --git a/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern.worker.js b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern.worker.js new file mode 100644 index 00000000000..f26657b5214 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/compositing/2d.composite.grid.no_filter.shadow.pattern.worker.js @@ -0,0 +1,763 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.grid.no_filter.shadow.pattern +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'source-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-over' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-in' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-out' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'destination-atop' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'lighter' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'copy' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'xor' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'multiply' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'screen' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'overlay' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'darken' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'lighten' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color-dodge' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color-burn' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'hard-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'soft-light' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'difference' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'exclusion' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'hue' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'saturation' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'color' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +test(t => { + const canvas = new OffscreenCanvas(80, 60); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgb(0, 102, 255)'; + ctx.fillRect(15, 15, 50, 30); + + ctx.translate(25, 20); + ctx.rotate(Math.PI / 2); + ctx.scale(0.6, 1.2); + ctx.translate(-25, -20); + + ctx.globalAlpha = 0.5; + + // No filter. + ctx.shadowOffsetX = 20; + ctx.shadowOffsetY = 20; + ctx.shadowColor = 'rgb(154, 0, 154)'; + + ctx.globalCompositeOperation = 'luminosity' + + const img_canvas = new OffscreenCanvas(80, 60); + const img_ctx = img_canvas.getContext('2d'); + img_ctx.fillStyle = 'rgb(52, 255, 52)'; + img_ctx.fillRect(0, 0, 80, 60); + ctx.fillStyle = ctx.createPattern(img_canvas, 'repeat'); + ctx.fillRect(5, 5, 50, 30); +}, ""); + +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic.png b/tests/wpt/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic.png index 8021427a07dc4ed754e2b3b1357aca7029bb0fe3..70d7b046cb226cfcb2bfeebe3477d3b580d8270a 100644 GIT binary patch delta 1098 zcmV-Q1hxCq2=NGzHh(5bL_t(&f$f-EXjDfS$A7yu#?%W|D^>|sMJ=|r##+&+4^mns zA`Mhg6bWq+3%!^=c%e!t6ucl9@XZVQP_NY}iV$nsource-over+ + + + + + +source-in+ + + + + + +source-out+ + + + + + +source-atop+ + + + + + +destination-over+ + + + + + +destination-in+ + + + + + +destination-out+ + + + + + +destination-atop+ + + + + + +lighter+ + + + + + +copy+ + + + + + +xor+ + + + + + +multiply+ + + + + + +screen+ + + + + + +overlay+ + + + + + +darken+ + + + + + +lighten+ + + + + + +color-dodge+ + + + + + +color-burn+ + + + + + +hard-light+ + + + + + +soft-light+ + + + + + +difference+ + + + + + +exclusion+ + + + + + +hue+ + + + + + +saturation+ + + + + + +color+ + + + + + +luminosity+ + + + + +_TOa1fd6>-n=Re tB}G!v$aP4OpD3G1b-=9gw8WVnw!yfNza=UY zBcYP@jDPyTuksU=OKYZo3TMtYaeB zl-6`ot>^*Fg{ywM$NNwRn_#xZwmT9NAA*zB4~9c2Z14_W?PoPqEyho$wJub%V|ZXl zLtwLa-=41Fkh5R}RKR}t(;LrCcs8FV8I#oxzd$W~08g2HCaNy=aMtf> zRGK-~KT;Ee*>Fbre3nm>uv-Tcn?ug!16hm}gKf&{xxAS~lB_tigiO|57@{1e!(KQA zdw=al?5h@>*CI6uB9dgiEDra)DM;r@wNtB9^^2tPj`^w}h2$;J`bbTHXb#dQk|*a+ zp*>L93|~uGpQ|rOp$L}P4f=!>S|T+GBKtRMAlw#* 2B7gb8o5vJN)D7P!-lj-QjAWmzucZ4?>n?|+ z%Pn<97gMLD1oT2Jtb`I63BzC_EQ7=9tJjrw6%~nzkt~xnTD{4Otb3KILElvMk3y~W zdfEjG{mdgV@h8h fJqV$dXg_d|v3 zTdl^OlGa)Ti(wbk!6oQ`E@+lJgBR?Eh{VL