Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wwww-wwww committed Nov 8, 2019
1 parent 83fae05 commit c369070
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
37 changes: 36 additions & 1 deletion assets/static/includes/subtitles-octopus-worker.js

Large diffs are not rendered by default.

11 changes: 3 additions & 8 deletions assets/static/includes/subtitles-octopus.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,9 @@ var SubtitlesOctopus = function (options) {
var data = self.renderFramesData;
var beforeDrawTime = performance.now();
self.ctx.clearRect(0, 0, self.canvas.width, self.canvas.height);
for (var i = 0; i < data.canvases.length; i++) {
var image = data.canvases[i];
self.bufferCanvas.width = image.w;
self.bufferCanvas.height = image.h;
var imageBuffer = new Uint8ClampedArray(image.buffer);
var imageData = new ImageData(imageBuffer, image.w, image.h);
self.bufferCanvasCtx.putImageData(imageData, 0, 0);
self.ctx.drawImage(self.bufferCanvas, image.x, image.y);
for (var i = 0; i < data.bitmaps.length; i++) {
var image = data.bitmaps[i];
self.ctx.drawImage(image.bitmap, image.x, image.y);
}
if (self.debug) {
var drawTime = Math.round(performance.now() - beforeDrawTime);
Expand Down

0 comments on commit c369070

Please sign in to comment.