@solidtv/renderer 1.5.1 → 1.5.2
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/dist/src/core/CoreNode.js +11 -1
- package/dist/src/core/CoreNode.js.map +1 -1
- package/dist/src/core/CoreTextNode.js +7 -2
- package/dist/src/core/CoreTextNode.js.map +1 -1
- package/dist/src/core/Stage.d.ts +6 -0
- package/dist/src/core/Stage.js +7 -0
- package/dist/src/core/Stage.js.map +1 -1
- package/dist/src/main-api/Renderer.d.ts +23 -0
- package/dist/src/main-api/Renderer.js +2 -0
- package/dist/src/main-api/Renderer.js.map +1 -1
- package/dist/tsconfig.dist.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/core/CoreNode.test.ts +142 -0
- package/src/core/CoreNode.ts +16 -1
- package/src/core/CoreTextNode.test.ts +61 -0
- package/src/core/CoreTextNode.ts +7 -2
- package/src/core/Stage.ts +7 -0
- package/src/main-api/Renderer.ts +26 -0
package/src/main-api/Renderer.ts
CHANGED
|
@@ -296,6 +296,30 @@ export interface RendererRuntimeSettings {
|
|
|
296
296
|
*/
|
|
297
297
|
boundsMargin: number | [number, number, number, number];
|
|
298
298
|
|
|
299
|
+
/**
|
|
300
|
+
* Only submit quads for Nodes that intersect the visible viewport.
|
|
301
|
+
*
|
|
302
|
+
* @remarks
|
|
303
|
+
* Nodes inside the bounds margin (`boundsMargin`) but outside the visible
|
|
304
|
+
* viewport still update and still load their textures (the margin remains
|
|
305
|
+
* the preload runway), but they stay out of the render list until they
|
|
306
|
+
* actually intersect the viewport — no quad writes, texture binds, or draw
|
|
307
|
+
* calls for content the GPU would clip anyway.
|
|
308
|
+
*
|
|
309
|
+
* Set to `false` to restore the previous behavior, where margin-ring Nodes
|
|
310
|
+
* are fully rendered every frame and clipped by the GPU. That keeps
|
|
311
|
+
* render-list membership stable ahead of scrolling at the cost of
|
|
312
|
+
* per-frame CPU for the off-screen ring.
|
|
313
|
+
*
|
|
314
|
+
* Trade-offs when enabled: the `renderable` event and autosize patching
|
|
315
|
+
* fire at viewport entry instead of margin entry, render-list rebuilds
|
|
316
|
+
* move to the visible edge (same frequency, different timing), and
|
|
317
|
+
* margin-ring content inside RTT subtrees is skipped.
|
|
318
|
+
*
|
|
319
|
+
* @defaultValue `true`
|
|
320
|
+
*/
|
|
321
|
+
renderOnlyInViewport: boolean;
|
|
322
|
+
|
|
299
323
|
/**
|
|
300
324
|
* Factor to convert app-authored logical coorindates to device logical coordinates
|
|
301
325
|
*
|
|
@@ -722,6 +746,7 @@ export class RendererMain extends EventEmitter {
|
|
|
722
746
|
appHeight: settings.appHeight || 1080,
|
|
723
747
|
textureMemory: resolvedTxSettings,
|
|
724
748
|
boundsMargin: settings.boundsMargin || 0,
|
|
749
|
+
renderOnlyInViewport: settings.renderOnlyInViewport ?? true,
|
|
725
750
|
deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,
|
|
726
751
|
devicePhysicalPixelRatio:
|
|
727
752
|
settings.devicePhysicalPixelRatio || this.windowDevicePixelRatio() || 1,
|
|
@@ -791,6 +816,7 @@ export class RendererMain extends EventEmitter {
|
|
|
791
816
|
appWidth,
|
|
792
817
|
appHeight,
|
|
793
818
|
boundsMargin: settings.boundsMargin!,
|
|
819
|
+
renderOnlyInViewport: settings.renderOnlyInViewport!,
|
|
794
820
|
clearColor: settings.clearColor!,
|
|
795
821
|
canvas: this.canvas,
|
|
796
822
|
deviceLogicalPixelRatio,
|