@swf2es/render 0.1.34 → 0.1.36

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.
Files changed (45) hide show
  1. package/dist/commands.d.ts +11 -2
  2. package/dist/commands.d.ts.map +1 -1
  3. package/dist/commands.js +36 -6
  4. package/dist/commands.js.map +1 -1
  5. package/dist/geometry.d.ts +62 -5
  6. package/dist/geometry.d.ts.map +1 -1
  7. package/dist/geometry.js +100 -17
  8. package/dist/geometry.js.map +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +1 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/measure.d.ts.map +1 -1
  14. package/dist/measure.js +118 -61
  15. package/dist/measure.js.map +1 -1
  16. package/dist/plan.js +4 -4
  17. package/dist/plan.js.map +1 -1
  18. package/dist/rows.d.ts +4 -0
  19. package/dist/rows.d.ts.map +1 -1
  20. package/dist/rows.js +59 -10
  21. package/dist/rows.js.map +1 -1
  22. package/dist/scene.d.ts.map +1 -1
  23. package/dist/scene.js +37 -5
  24. package/dist/scene.js.map +1 -1
  25. package/dist/webgl/atlas.d.ts +89 -16
  26. package/dist/webgl/atlas.d.ts.map +1 -1
  27. package/dist/webgl/atlas.js +285 -109
  28. package/dist/webgl/atlas.js.map +1 -1
  29. package/dist/webgl/backend.d.ts +5 -3
  30. package/dist/webgl/backend.d.ts.map +1 -1
  31. package/dist/webgl/backend.js +9 -9
  32. package/dist/webgl/backend.js.map +1 -1
  33. package/dist/webgl/draws.js +1 -1
  34. package/dist/webgl/draws.js.map +1 -1
  35. package/package.json +2 -2
  36. package/src/commands.ts +48 -6
  37. package/src/geometry.ts +109 -19
  38. package/src/index.ts +1 -0
  39. package/src/measure.ts +132 -68
  40. package/src/plan.ts +4 -4
  41. package/src/rows.ts +62 -19
  42. package/src/scene.ts +41 -5
  43. package/src/webgl/atlas.ts +334 -118
  44. package/src/webgl/backend.ts +9 -9
  45. package/src/webgl/draws.ts +1 -1
@@ -221,26 +221,26 @@ export class WebGLBackend {
221
221
  }
222
222
 
223
223
  /**
224
- * The context came back after it was lost: everything made again, every
225
- * geometry copied in again from the registry's arrays. The textures were
226
- * lost with it, which their owners add again (Textures.lost). Lost again
224
+ * The context came back after it was lost: everything made again. The
225
+ * geometries whose arrays the registry let go of are lost with it, which
226
+ * their owners add again as they draw them, and those it keeps are copied
227
+ * in again by the next frame (Geometries.lost). The textures were lost
228
+ * too, which their owners add again (Textures.lost). Lost again
227
229
  * meanwhile, it stays stale, for the next restore.
228
230
  */
229
231
  restore(geometries: Geometries): void {
230
232
  this.losses.clear();
231
233
  this.made = this.ready = false;
232
- geometries.added.length = 0;
233
- geometries.removed.length = 0;
234
- geometries.updated.length = 0;
235
- geometries.flattened.length = 0;
234
+ geometries.lost();
235
+ // Lost again already: the atlas keeps the places and settling geometries of the context
236
+ // before, naming ids Geometries.lost removed, till the next restore makes it anew (setUp).
237
+ // Nothing reads them meanwhile, as no frame is drawn or planned while the context is lost.
236
238
  if (this.gl.isContextLost()) {
237
239
  return;
238
240
  }
239
241
 
240
242
  try {
241
243
  this.setUp();
242
- this.atlas.repack(geometries);
243
- this.atlas.repackGlyphs(geometries);
244
244
  this.made = this.ready = true;
245
245
  } catch (e) {
246
246
  this.gaveUp(e);
@@ -855,8 +855,8 @@ export class Draws {
855
855
  last = j;
856
856
  }
857
857
 
858
+ // Places past the count are left from runs before: trimmed, the array would grow again.
858
859
  this.runCount = draws;
859
- this.runPlaces.length = draws;
860
860
 
861
861
  return last;
862
862
  }