CanvasKit: implement client-supplied dirty rect support for software surface.
Surface clients can now specify a dirty rect that will constrain HTML canvas
repaints to a particular region.
Bug: NONE
Change-Id: Ia77d6e864c061297bfc82cfa09030523052ee0e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293056
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/modules/canvaskit/interface.js b/modules/canvaskit/interface.js
index 7248606..05ff59e 100644
--- a/modules/canvaskit/interface.js
+++ b/modules/canvaskit/interface.js
@@ -1139,7 +1139,7 @@
// We do not dispose() of the SkSurface here, as the client will typically
// call requestAnimationFrame again from within the supplied callback.
// For drawing a single frame, prefer drawOnce().
- this.flush();
+ this.flush(dirtyRect);
}.bind(this));
}
@@ -1155,7 +1155,7 @@
}
callback(this._cached_canvas);
- this.flush();
+ this.flush(dirtyRect);
this.dispose();
}.bind(this));
}