@scratch/scratch-render 12.1.2 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scratch/scratch-render",
3
- "version": "12.1.2",
3
+ "version": "12.2.0",
4
4
  "description": "WebGL Renderer for Scratch 3.0",
5
5
  "author": "Massachusetts Institute of Technology",
6
6
  "license": "AGPL-3.0-only",
@@ -46,7 +46,7 @@
46
46
  "iOS >= 8"
47
47
  ],
48
48
  "dependencies": {
49
- "@scratch/scratch-svg-renderer": "12.1.2",
49
+ "@scratch/scratch-svg-renderer": "12.2.0",
50
50
  "grapheme-breaker": "0.3.2",
51
51
  "hull.js": "0.2.10",
52
52
  "ify-loader": "1.1.0",
@@ -62,12 +62,12 @@
62
62
  "@babel/core": "7.28.5",
63
63
  "@babel/polyfill": "7.12.1",
64
64
  "@babel/preset-env": "7.28.5",
65
- "@scratch/scratch-vm": "12.1.2",
65
+ "@scratch/scratch-vm": "12.2.0",
66
66
  "babel-loader": "9.2.1",
67
67
  "copy-webpack-plugin": "6.4.1",
68
68
  "docdash": "0.4.0",
69
69
  "eslint": "9.39.1",
70
- "eslint-config-scratch": "12.0.38",
70
+ "eslint-config-scratch": "12.0.41",
71
71
  "gh-pages": "1.2.0",
72
72
  "globals": "16.5.0",
73
73
  "html-webpack-plugin": "5.6.5",
@@ -78,8 +78,8 @@
78
78
  "scratch-storage": "5.0.10",
79
79
  "scratch-webpack-configuration": "3.1.0",
80
80
  "semantic-release": "19.0.5",
81
- "tap": "21.4.0",
82
- "terser-webpack-plugin": "5.3.14",
81
+ "tap": "21.5.0",
82
+ "terser-webpack-plugin": "5.3.16",
83
83
  "webpack": "5.103.0",
84
84
  "webpack-cli": "5.1.4",
85
85
  "webpack-dev-server": "5.2.2"
package/src/BitmapSkin.js CHANGED
@@ -69,9 +69,10 @@ class BitmapSkin extends Skin {
69
69
  // memory.
70
70
  let textureData = bitmapData;
71
71
  if (bitmapData instanceof HTMLCanvasElement) {
72
- // Given a HTMLCanvasElement get the image data to pass to webgl and
73
- // Silhouette.
74
- const context = bitmapData.getContext('2d');
72
+ // Given a HTMLCanvasElement, get the image data to pass to WebGL and the Silhouette. The 2D context was
73
+ // likely already created, so `willReadFrequently` is likely ignored here, but it's good documentation and
74
+ // may help if the code path changes someday.
75
+ const context = bitmapData.getContext('2d', {willReadFrequently: true});
75
76
  textureData = context.getImageData(0, 0, bitmapData.width, bitmapData.height);
76
77
  }
77
78