skia2/modules/canvaskit/pathops.js
Kevin Lubick 933ea8c301 [canvaskit] Add build flag for pathops
This fixes up some other build flag options:
 - font-specific js code is correctly omitted when no_font is set
 - SKP serialization is only compiled in debug (or with flag).


Bug: skia:9733
Change-Id: Ifdbd2ddac278cfcefa842f6d4826d5429b6ed64b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262137
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-01-06 13:10:43 +00:00

17 lines
444 B
JavaScript

// Adds in the code to use pathops with SkPath
CanvasKit._extraInitializations = CanvasKit._extraInitializations || [];
CanvasKit._extraInitializations.push(function() {
CanvasKit.SkPath.prototype.op = function(otherPath, op) {
if (this._op(otherPath, op)) {
return this;
}
return null;
};
CanvasKit.SkPath.prototype.simplify = function() {
if (this._simplify()) {
return this;
}
return null;
};
});