Skip to content

Commit

Permalink
Merge pull request #590 from exyte/fix/393-Improve-mask-support
Browse files Browse the repository at this point in the history
#393 Improve mask support
  • Loading branch information
ystrot authored May 31, 2019
2 parents 91483c0 + d8a8ac9 commit f7c7b86
Show file tree
Hide file tree
Showing 11 changed files with 581 additions and 24 deletions.
24 changes: 24 additions & 0 deletions Macaw.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,12 @@
A74C82412297DC220085A832 /* shapes-rect-02-t-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C82402297DC220085A832 /* shapes-rect-02-t-manual.reference */; };
A74C832C229FB7690085A832 /* color-prop-04-t-manual-osx.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C832B229FB7690085A832 /* color-prop-04-t-manual-osx.svg */; };
A74C832E229FBA4C0085A832 /* color-prop-04-t-manual-osx.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C832D229FBA4C0085A832 /* color-prop-04-t-manual-osx.reference */; };
A74C8307229E9CCE0085A832 /* masking-filter-01-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C8305229E9CCD0085A832 /* masking-filter-01-f-manual.svg */; };
A74C8308229E9CCE0085A832 /* masking-mask-02-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C8306229E9CCE0085A832 /* masking-mask-02-f-manual.svg */; };
A74C830B229E9D700085A832 /* masking-filter-01-f-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C8309229E9D6F0085A832 /* masking-filter-01-f-manual.reference */; };
A74C830C229E9D700085A832 /* masking-mask-02-f-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C830A229E9D700085A832 /* masking-mask-02-f-manual.reference */; };
A74C8324229EB7150085A832 /* masking-path-13-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C8323229EB7150085A832 /* masking-path-13-f-manual.svg */; };
A74C8326229EB77B0085A832 /* masking-path-13-f-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C8325229EB77B0085A832 /* masking-path-13-f-manual.reference */; };
A7E675561EC4213500BD9ECB /* NodeBoundsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7E675551EC4213500BD9ECB /* NodeBoundsTests.swift */; };
C410148E1F834D290022EE44 /* style.svg in Resources */ = {isa = PBXBuildFile; fileRef = C410148D1F834D280022EE44 /* style.svg */; };
C4153A8F1F8793DE001BA5EE /* small-logo.png in Resources */ = {isa = PBXBuildFile; fileRef = C4153A8E1F8793DD001BA5EE /* small-logo.png */; };
Expand Down Expand Up @@ -976,6 +982,12 @@
A74C82402297DC220085A832 /* shapes-rect-02-t-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "shapes-rect-02-t-manual.reference"; sourceTree = "<group>"; };
A74C832B229FB7690085A832 /* color-prop-04-t-manual-osx.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "color-prop-04-t-manual-osx.svg"; sourceTree = "<group>"; };
A74C832D229FBA4C0085A832 /* color-prop-04-t-manual-osx.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "color-prop-04-t-manual-osx.reference"; sourceTree = "<group>"; };
A74C8305229E9CCD0085A832 /* masking-filter-01-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "masking-filter-01-f-manual.svg"; sourceTree = "<group>"; };
A74C8306229E9CCE0085A832 /* masking-mask-02-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "masking-mask-02-f-manual.svg"; sourceTree = "<group>"; };
A74C8309229E9D6F0085A832 /* masking-filter-01-f-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "masking-filter-01-f-manual.reference"; sourceTree = "<group>"; };
A74C830A229E9D700085A832 /* masking-mask-02-f-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "masking-mask-02-f-manual.reference"; sourceTree = "<group>"; };
A74C8323229EB7150085A832 /* masking-path-13-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "masking-path-13-f-manual.svg"; sourceTree = "<group>"; };
A74C8325229EB77B0085A832 /* masking-path-13-f-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "masking-path-13-f-manual.reference"; sourceTree = "<group>"; };
A7E675551EC4213500BD9ECB /* NodeBoundsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NodeBoundsTests.swift; path = Bounds/NodeBoundsTests.swift; sourceTree = "<group>"; };
C410148D1F834D280022EE44 /* style.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = style.svg; sourceTree = "<group>"; };
C4153A8E1F8793DD001BA5EE /* small-logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "small-logo.png"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1475,6 +1487,12 @@
5B7E79DD20D2781A00C50BCF /* masking-intro-01-f-manual.svg */,
5B7E79CC20CBE69600C50BCF /* masking-path-02-b-manual.reference */,
5B7E79CD20CBE69700C50BCF /* masking-path-02-b-manual.svg */,
A74C8325229EB77B0085A832 /* masking-path-13-f-manual.reference */,
A74C8323229EB7150085A832 /* masking-path-13-f-manual.svg */,
A74C8309229E9D6F0085A832 /* masking-filter-01-f-manual.reference */,
A74C8305229E9CCD0085A832 /* masking-filter-01-f-manual.svg */,
A74C830A229E9D700085A832 /* masking-mask-02-f-manual.reference */,
A74C8306229E9CCE0085A832 /* masking-mask-02-f-manual.svg */,
5B1AE19E20B6A669007EECCB /* metadata-example-01-t-manual.reference */,
5B1AE22A20B6A669007EECCB /* metadata-example-01-t-manual.svg */,
5B1AE20C20B6A669007EECCB /* painting-control-01-f-manual.reference */,
Expand Down Expand Up @@ -1841,6 +1859,7 @@
5B1AE2A420B6A669007EECCB /* paths-data-12-t-manual.reference in Resources */,
57CAB1361D7832E000FD8E47 /* triangle.svg in Resources */,
5B7E79CF20CBE69700C50BCF /* masking-path-02-b-manual.svg in Resources */,
A74C830C229E9D700085A832 /* masking-mask-02-f-manual.reference in Resources */,
5BFEF5D620BC1C1F008DAC11 /* paths-data-18-f-manual.svg in Resources */,
A74C81ED229284790085A832 /* struct-use-01-t-manual.svg in Resources */,
5B1AE23620B6A669007EECCB /* paths-data-07-t-manual.svg in Resources */,
Expand Down Expand Up @@ -1890,10 +1909,12 @@
A74C82052296BFC60085A832 /* paths-data-20-f-manual.reference in Resources */,
5B1AE29020B6A669007EECCB /* painting-stroke-08-t-manual.svg in Resources */,
5B1AE2A720B6A669007EECCB /* paths-data-09-t-manual.svg in Resources */,
A74C830B229E9D700085A832 /* masking-filter-01-f-manual.reference in Resources */,
5B1AE2AB20B6A669007EECCB /* painting-stroke-08-t-manual.reference in Resources */,
A74C82352297D8B40085A832 /* shapes-rect-07-f-manual.svg in Resources */,
5B1AE2A520B6A669007EECCB /* coords-trans-02-t-manual.reference in Resources */,
5B1AE23220B6A669007EECCB /* text-align-01-b-manual.svg in Resources */,
A74C8308229E9CCE0085A832 /* masking-mask-02-f-manual.svg in Resources */,
5B1AE2B220B6A669007EECCB /* types-basic-01-f-manual.svg in Resources */,
58944BDA20AC8A9A00657640 /* logo_base64.txt in Resources */,
5B1AE2C520B6A669007EECCB /* coords-trans-02-t-manual.svg in Resources */,
Expand All @@ -1907,6 +1928,7 @@
A74C822C2297D5350085A832 /* coords-trans-10-f-manual.reference in Resources */,
5B1AE24520B6A669007EECCB /* struct-frag-01-t-manual.reference in Resources */,
5B1AE25B20B6A669007EECCB /* painting-stroke-01-t-manual.svg in Resources */,
A74C8324229EB7150085A832 /* masking-path-13-f-manual.svg in Resources */,
A74C823E2297DB2C0085A832 /* shapes-rect-03-t-manual.reference in Resources */,
5BAE2047208E163D006BF277 /* viewBox.reference in Resources */,
5B1AE2C120B6A669007EECCB /* painting-stroke-04-t-manual.svg in Resources */,
Expand Down Expand Up @@ -2048,6 +2070,7 @@
5B1AE2D220B6A669007EECCB /* struct-group-01-t-manual.svg in Resources */,
5B1AE2B520B6A669007EECCB /* coords-trans-09-t-manual.reference in Resources */,
5B3713A320BE9D8A004BB6EE /* shapes-grammar-01-f-manual.reference in Resources */,
A74C8326229EB77B0085A832 /* masking-path-13-f-manual.reference in Resources */,
57CAB1321D7832E000FD8E47 /* polygon.svg in Resources */,
5BAE203A208E163D006BF277 /* rect.reference in Resources */,
5BAE2044208E163D006BF277 /* style.reference in Resources */,
Expand All @@ -2066,6 +2089,7 @@
5B1AE27A20B6A669007EECCB /* coords-transformattr-01-f-manual.reference in Resources */,
5B1AE24C20B6A669007EECCB /* metadata-example-01-t-manual.reference in Resources */,
5B1AE29720B6A669007EECCB /* render-elems-01-t-manual.svg in Resources */,
A74C8307229E9CCE0085A832 /* masking-filter-01-f-manual.svg in Resources */,
5B1AE26220B6A669007EECCB /* coords-transformattr-02-f-manual.svg in Resources */,
5B1AE28F20B6A669007EECCB /* shapes-polyline-02-t-manual.svg in Resources */,
5B1AE24420B6A669007EECCB /* shapes-rect-05-f-manual.reference in Resources */,
Expand Down
22 changes: 17 additions & 5 deletions MacawTests/MacawSVGTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -696,15 +696,27 @@ class MacawSVGTests: XCTestCase {
validateJSON("shapes-grammar-01-f-manual")
}

func testMaskingPath02() {
validateJSON("masking-path-02-b-manual")
func testPserversGrad03() {
validateJSON("pservers-grad-03-b-manual")
}

func testMaskingIntro01() {
validateJSON("masking-intro-01-f-manual")
}

func testPserversGrad03() {
validateJSON("pservers-grad-03-b-manual")

func testMaskingFilter01() {
validateJSON("masking-filter-01-f-manual")
}

func testMaskingPath02() {
validateJSON("masking-path-02-b-manual")
}

func testMaskingPath13() {
validateJSON("masking-path-13-f-manual")
}

func testMaskingMask02() {
validateJSON("masking-mask-02-f-manual")
}
}
12 changes: 6 additions & 6 deletions MacawTests/w3c-test-suite.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ There are [521 SVG tests](https://github.com/web-platform-tests/wpt/tree/master/
* [switch/object](https://www.w3.org/TR/SVG11/backward.html) (7)

The rest 306 tests can be split into following categories:
* 35.3% passed (108)
* 38.6% passed (118)
* 14.1% filters (43) [#390](https://github.com/exyte/Macaw/issues/390)
* 8.5% images (26) [wpt issue](https://github.com/web-platform-tests/wpt/issues/11178)
* 2.6% markers (8) [#392](https://github.com/exyte/Macaw/issues/392)
* 20.6% text (63) [#391](https://github.com/exyte/Macaw/issues/391)
* 19.0% blocked by issues (58)
* 15.7% blocked by issues (48)

Status of each test:

Expand Down Expand Up @@ -118,9 +118,9 @@ Status of each test:
|[fonts-kern-01-t-manual](w3cSVGTests/fonts-kern-01-t-manual.svg) | [#391](https://github.com/exyte/Macaw/issues/391) |
|[fonts-overview-201-t-manual](w3cSVGTests/fonts-overview-201-t-manual.svg) | [#391](https://github.com/exyte/Macaw/issues/391) |
|[imp-path-01-f-manual](w3cSVGTests/imp-path-01-f-manual.svg) | [#392](https://github.com/exyte/Macaw/issues/392) |
|[masking-filter-01-f-manual](w3cSVGTests/masking-filter-01-f-manual.svg) | [#393](https://github.com/exyte/Macaw/issues/393) |
|[masking-intro-01-f-manual](w3cSVGTests/masking-intro-01-f-manual.svg) ||
|[masking-mask-02-f-manual](w3cSVGTests/masking-mask-02-f-manual.svg) | [#393](https://github.com/exyte/Macaw/issues/393) |
|[masking-filter-01-f-manual](w3cSVGTests/masking-filter-01-f-manual.svg) | |
|[masking-intro-01-f-manual](w3cSVGTests/masking-intro-01-f-manual.svg) | |
|[masking-mask-02-f-manual](w3cSVGTests/masking-mask-02-f-manual.svg) | |
|[masking-opacity-01-b-manual](w3cSVGTests/masking-opacity-01-b-manual.svg) | [#393](https://github.com/exyte/Macaw/issues/393) |
|[masking-path-01-b-manual](w3cSVGTests/masking-path-01-b-manual.svg) | [#393](https://github.com/exyte/Macaw/issues/393) |
|[masking-path-02-b-manual](w3cSVGTests/masking-path-02-b-manual.svg) ||
Expand All @@ -132,7 +132,7 @@ Status of each test:
|[masking-path-08-b-manual](w3cSVGTests/masking-path-08-b-manual.svg) | [#393](https://github.com/exyte/Macaw/issues/393) |
|[masking-path-10-b-manual](w3cSVGTests/masking-path-10-b-manual.svg) | [#393](https://github.com/exyte/Macaw/issues/393) |
|[masking-path-11-b-manual](w3cSVGTests/masking-path-11-b-manual.svg) | [wpt issue](https://github.com/web-platform-tests/wpt/issues/11178) |
|[masking-path-13-f-manual](w3cSVGTests/masking-path-13-f-manual.svg) | [#393](https://github.com/exyte/Macaw/issues/393) |
|[masking-path-13-f-manual](w3cSVGTests/masking-path-13-f-manual.svg) | |
|[masking-path-14-f-manual](w3cSVGTests/masking-path-14-f-manual.svg) | [#393](https://github.com/exyte/Macaw/issues/393) |
|[metadata-example-01-t-manual](w3cSVGTests/metadata-example-01-t-manual.svg) ||
|[painting-control-01-f-manual](w3cSVGTests/painting-control-01-f-manual.svg) ||
Expand Down
152 changes: 152 additions & 0 deletions MacawTests/w3cSVGTests/masking-filter-01-f-manual.reference
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"contents" : [
{
"contents" : [
{
"contents" : [
{
"align" : "min",
"baseline" : "bottom",
"fill" : {
"type" : "Color",
"val" : 0
},
"font" : {
"name" : "SVGFreeSansASCII,sans-serif",
"size" : 18,
"weight" : "normal"
},
"node" : "Text",
"place" : "1, 0, 0, 1, 10, 35",
"text" : "Testing 'filter' applied to 'mask'"
},
{
"contents" : [
{
"fill" : {
"type" : "Color",
"val" : 32768
},
"form" : {
"h" : 100,
"type" : "Rect",
"w" : 100,
"x" : 0,
"y" : 0
},
"mask" : {
"fill" : {
"type" : "Color",
"val" : 16777215
},
"form" : {
"h" : 100,
"type" : "Rect",
"w" : 100,
"x" : 0,
"y" : 0
},
"node" : "Shape"
},
"node" : "Shape"
},
{
"fill" : {
"type" : "Color",
"val" : 16711680
},
"form" : {
"h" : 99,
"type" : "Rect",
"w" : 99,
"x" : 101,
"y" : 101
},
"mask" : {
"fill" : {
"type" : "Color",
"val" : 16777215
},
"form" : {
"h" : 100,
"type" : "Rect",
"w" : 100,
"x" : 0,
"y" : 0
},
"node" : "Shape"
},
"node" : "Shape"
}
],
"node" : "Group",
"place" : "1, 0, 0, 1, 10, 50"
}
],
"node" : "Group"
}
],
"node" : "Group"
},
{
"contents" : [
{
"align" : "min",
"baseline" : "bottom",
"fill" : {
"type" : "Color",
"val" : 0
},
"font" : {
"name" : "SVGFreeSansASCII,sans-serif",
"size" : 32,
"weight" : "normal"
},
"node" : "Text",
"place" : "1, 0, 0, 1, 10, 340",
"text" : "$Revision: 1.7 $"
}
],
"node" : "Group"
},
{
"form" : {
"h" : 358,
"type" : "Rect",
"w" : 478,
"x" : 1,
"y" : 1
},
"node" : "Shape",
"stroke" : {
"cap" : "butt",
"dashes" : [

],
"fill" : {
"type" : "Color",
"val" : 0
},
"join" : "miter",
"width" : 1
}
}
],
"layout" : {
"scalingMode" : "meet",
"svgSize" : {
"height" : "100.0%",
"width" : "100.0%"
},
"viewBox" : {
"h" : 360,
"type" : "Rect",
"w" : 480,
"x" : 0,
"y" : 0
},
"xAligningMode" : "mid",
"yAligningMode" : "mid"
},
"node" : "Canvas"
}
Loading

0 comments on commit f7c7b86

Please sign in to comment.