Implement setRenderingIntent and setFlatness for the SVG backend

This mirrors the canvas implementation where we ignore these operators.
This avoids console spam regarding unimplemented operators we're not
interested in.

For the Tracemonkey paper, we're now down to one warning about tiling
patterns which is in fact a valid one.
This commit is contained in:
Tim van der Meij 2019-03-23 23:05:12 +01:00
parent 47d3620d5a
commit 2b18e5a355
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762
2 changed files with 24 additions and 7 deletions

View File

@ -888,14 +888,11 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
ctx.lineDashOffset = dashPhase;
}
},
setRenderingIntent: function CanvasGraphics_setRenderingIntent(intent) {
// Maybe if we one day fully support color spaces this will be important
// for now we can ignore.
// TODO set rendering intent?
setRenderingIntent(intent) {
// This operation is ignored since we haven't found a use case for it yet.
},
setFlatness: function CanvasGraphics_setFlatness(flatness) {
// There's no way to control this with canvas, but we can safely ignore.
// TODO set flatness?
setFlatness(flatness) {
// This operation is ignored since we haven't found a use case for it yet.
},
setGState: function CanvasGraphics_setGState(states) {
for (var i = 0, ii = states.length; i < ii; i++) {

View File

@ -595,6 +595,12 @@ SVGGraphics = class SVGGraphics {
case OPS.setDash:
this.setDash(args[0], args[1]);
break;
case OPS.setRenderingIntent:
this.setRenderingIntent(args[0]);
break;
case OPS.setFlatness:
this.setFlatness(args[0]);
break;
case OPS.setGState:
this.setGState(args[0]);
break;
@ -1188,6 +1194,14 @@ SVGGraphics = class SVGGraphics {
this.current.textHScale = scale / 100;
}
setRenderingIntent(intent) {
// This operation is ignored since we haven't found a use case for it yet.
}
setFlatness(flatness) {
// This operation is ignored since we haven't found a use case for it yet.
}
setGState(states) {
for (const [key, value] of states) {
switch (key) {
@ -1206,6 +1220,12 @@ SVGGraphics = class SVGGraphics {
case 'D':
this.setDash(value[0], value[1]);
break;
case 'RI':
this.setRenderingIntent(value);
break;
case 'FL':
this.setFlatness(value);
break;
case 'Font':
this.setFont(value);
break;