@luma.gl/core 9.1.0-beta.8 → 9.1.0-beta.9
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/adapter/canvas-context.d.ts +30 -73
- package/dist/adapter/canvas-context.d.ts.map +1 -1
- package/dist/adapter/canvas-context.js +95 -202
- package/dist/adapter/canvas-context.js.map +1 -1
- package/dist/adapter/device.d.ts +3 -24
- package/dist/adapter/device.d.ts.map +1 -1
- package/dist/adapter/device.js +10 -22
- package/dist/adapter/device.js.map +1 -1
- package/dist/adapter/luma.js +1 -1
- package/dist/adapter/resources/render-pipeline.d.ts +1 -6
- package/dist/adapter/resources/render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/render-pipeline.js +4 -2
- package/dist/adapter/resources/render-pipeline.js.map +1 -1
- package/dist/adapter/resources/vertex-array.d.ts +2 -4
- package/dist/adapter/resources/vertex-array.d.ts.map +1 -1
- package/dist/adapter/resources/vertex-array.js +6 -3
- package/dist/adapter/resources/vertex-array.js.map +1 -1
- package/dist/dist.dev.js +114 -209
- package/dist/dist.min.js +6 -6
- package/dist/gpu-type-utils/texture-format-table.js +1 -1
- package/dist/gpu-type-utils/texture-format-table.js.map +1 -1
- package/dist/gpu-type-utils/texture-formats.d.ts +2 -2
- package/dist/gpu-type-utils/texture-formats.d.ts.map +1 -1
- package/dist/index.cjs +115 -205
- package/dist/index.cjs.map +3 -3
- package/package.json +2 -2
- package/src/adapter/canvas-context.ts +120 -271
- package/src/adapter/device.ts +15 -50
- package/src/adapter/resources/render-pipeline.ts +12 -18
- package/src/adapter/resources/vertex-array.ts +9 -8
- package/src/gpu-type-utils/texture-format-table.ts +1 -1
- package/src/gpu-type-utils/texture-formats.ts +1 -2
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { Device } from "./device.js";
|
|
2
2
|
import type { Framebuffer } from "./resources/framebuffer.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { TextureFormat } from "../gpu-type-utils/texture-formats.js";
|
|
4
4
|
/** Properties for a CanvasContext */
|
|
5
5
|
export type CanvasContextProps = {
|
|
6
|
-
/** Identifier, for debugging */
|
|
7
|
-
id?: string;
|
|
8
6
|
/** If a canvas not supplied, one will be created and added to the DOM. If a string, a canvas with that id will be looked up in the DOM */
|
|
9
7
|
canvas?: HTMLCanvasElement | OffscreenCanvas | string | null;
|
|
10
8
|
/** If new canvas is created, it will be created in the specified container, otherwise is appended as a child of document.body */
|
|
@@ -34,36 +32,20 @@ export type CanvasContextProps = {
|
|
|
34
32
|
export declare abstract class CanvasContext {
|
|
35
33
|
static defaultProps: Required<CanvasContextProps>;
|
|
36
34
|
abstract readonly device: Device;
|
|
37
|
-
abstract readonly handle: unknown;
|
|
38
35
|
readonly id: string;
|
|
39
36
|
readonly props: Required<CanvasContextProps>;
|
|
40
37
|
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
|
|
41
38
|
readonly htmlCanvas?: HTMLCanvasElement;
|
|
42
39
|
readonly offscreenCanvas?: OffscreenCanvas;
|
|
43
40
|
readonly type: 'html-canvas' | 'offscreen-canvas' | 'node';
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/** Visibility is automatically updated (via an IntersectionObserver) */
|
|
53
|
-
isVisible: boolean;
|
|
54
|
-
/** Device pixel ratio. Automatically updated via media queries */
|
|
55
|
-
devicePixelRatio: number;
|
|
56
|
-
/** Exact width of canvas in physical pixels (tracked by a ResizeObserver) */
|
|
57
|
-
pixelWidth: number;
|
|
58
|
-
/** Exact height of canvas in physical pixels (tracked by a ResizeObserver) */
|
|
59
|
-
pixelHeight: number;
|
|
60
|
-
/** Width of drawing buffer: automatically updated if props.autoResize is true */
|
|
61
|
-
drawingBufferWidth: number;
|
|
62
|
-
/** Height of drawing buffer: automatically updated if props.autoResize is true */
|
|
63
|
-
drawingBufferHeight: number;
|
|
64
|
-
protected readonly _resizeObserver: ResizeObserver | undefined;
|
|
65
|
-
protected readonly _intersectionObserver: IntersectionObserver | undefined;
|
|
66
|
-
/** State used by luma.gl classes: TODO - remove */
|
|
41
|
+
/** Format of returned textures: "bgra8unorm", "rgba8unorm" */
|
|
42
|
+
abstract readonly format: TextureFormat;
|
|
43
|
+
/** Default stencil format for depth textures */
|
|
44
|
+
abstract readonly depthStencilFormat: TextureFormat;
|
|
45
|
+
width: number;
|
|
46
|
+
height: number;
|
|
47
|
+
readonly resizeObserver: ResizeObserver | undefined;
|
|
48
|
+
/** State used by luma.gl classes: TODO - move to canvasContext*/
|
|
67
49
|
readonly _canvasSizeInfo: {
|
|
68
50
|
clientWidth: number;
|
|
69
51
|
clientHeight: number;
|
|
@@ -73,35 +55,20 @@ export declare abstract class CanvasContext {
|
|
|
73
55
|
toString(): string;
|
|
74
56
|
constructor(props?: CanvasContextProps);
|
|
75
57
|
/** Returns a framebuffer with properly resized current 'swap chain' textures */
|
|
76
|
-
abstract getCurrentFramebuffer(
|
|
77
|
-
depthStencilFormat?: DepthStencilTextureFormat | false;
|
|
78
|
-
}): Framebuffer;
|
|
58
|
+
abstract getCurrentFramebuffer(): Framebuffer;
|
|
79
59
|
/**
|
|
80
|
-
* Returns the
|
|
81
|
-
*
|
|
82
|
-
* @note This is independent of the canvas' internal drawing buffer size (.width, .height).
|
|
60
|
+
* Returns the current DPR, if props.useDevicePixels is true
|
|
61
|
+
* Device refers to physical
|
|
83
62
|
*/
|
|
84
|
-
|
|
63
|
+
getDevicePixelRatio(useDevicePixels?: boolean | number): number;
|
|
85
64
|
/**
|
|
86
|
-
* Returns the size
|
|
87
|
-
* @note This can be different from the 'CSS' size of a canvas
|
|
88
|
-
*
|
|
65
|
+
* Returns the size of drawing buffer in device pixels.
|
|
66
|
+
* @note This can be different from the 'CSS' size of a canvas, and also from the
|
|
67
|
+
* canvas' internal drawing buffer size (.width, .height).
|
|
68
|
+
* This is the size required to cover the canvas, adjusted for DPR
|
|
89
69
|
*/
|
|
90
70
|
getPixelSize(): [number, number];
|
|
91
|
-
/** Get the drawing buffer size (number of pixels GPU is rendering into, can be different from CSS size) */
|
|
92
|
-
getDrawingBufferSize(): [number, number];
|
|
93
|
-
/** Returns the biggest allowed framebuffer size. @todo Allow the application to limit this? */
|
|
94
|
-
getMaxDrawingBufferSize(): [number, number];
|
|
95
|
-
/** Update the canvas drawing buffer size. Called automatically if props.autoResize is true. */
|
|
96
|
-
setDrawingBufferSize(width: number, height: number): void;
|
|
97
|
-
/** @deprecated - TODO which values should we use for aspect */
|
|
98
71
|
getAspect(): number;
|
|
99
|
-
/**
|
|
100
|
-
* Returns the current DPR (number of physical pixels per CSS pixel), if props.useDevicePixels is true
|
|
101
|
-
* @note This can be a fractional (non-integer) number, e.g. when the user zooms in the browser.
|
|
102
|
-
* @note This function handles the non-HTML canvas cases
|
|
103
|
-
*/
|
|
104
|
-
getDevicePixelRatio(useDevicePixels?: boolean | number): number;
|
|
105
72
|
/**
|
|
106
73
|
* Returns multiplier need to convert CSS size to Device size
|
|
107
74
|
*/
|
|
@@ -115,37 +82,27 @@ export declare abstract class CanvasContext {
|
|
|
115
82
|
width: number;
|
|
116
83
|
height: number;
|
|
117
84
|
};
|
|
118
|
-
/** Performs platform specific updates (WebGPU vs WebGL) */
|
|
119
|
-
protected abstract updateSize(size: [width: number, height: number]): void;
|
|
120
85
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*/
|
|
124
|
-
protected _setAutoCreatedCanvasId(id: string): void;
|
|
125
|
-
/** reacts to our intersection observer */
|
|
126
|
-
protected _handleIntersection(entries: IntersectionObserverEntry[]): void;
|
|
127
|
-
/**
|
|
128
|
-
* Reacts to an observed resize by using the most accurate pixel size information the browser can provide
|
|
129
|
-
* @see https://web.dev/articles/device-pixel-content-box
|
|
130
|
-
* @see https://webgpufundamentals.org/webgpu/lessons/webgpu-resizing-the-canvas.html
|
|
86
|
+
* Use devicePixelRatio to set canvas width and height
|
|
87
|
+
* @note this is a raw port of luma.gl v8 code. Might be worth a review
|
|
131
88
|
*/
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
89
|
+
setDevicePixelRatio(devicePixelRatio: number, options?: {
|
|
90
|
+
width?: number;
|
|
91
|
+
height?: number;
|
|
92
|
+
}): void;
|
|
93
|
+
/** @todo Major hack done to port the CSS methods above, base canvas context should not depend on WebGL */
|
|
94
|
+
getDrawingBufferSize(): [number, number];
|
|
137
95
|
abstract resize(options?: {
|
|
138
96
|
width?: number;
|
|
139
97
|
height?: number;
|
|
140
98
|
useDevicePixels?: boolean | number;
|
|
141
99
|
}): void;
|
|
100
|
+
/** Perform platform specific updates (WebGPU vs WebGL) */
|
|
101
|
+
protected abstract update(): void;
|
|
142
102
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
103
|
+
* Allows subclass constructor to override the canvas id for auto created canvases.
|
|
104
|
+
* This can really help when debugging DOM in apps that create multiple devices
|
|
145
105
|
*/
|
|
146
|
-
|
|
147
|
-
width?: number;
|
|
148
|
-
height?: number;
|
|
149
|
-
}): void;
|
|
106
|
+
protected _setAutoCreatedCanvasId(id: string): void;
|
|
150
107
|
}
|
|
151
108
|
//# sourceMappingURL=canvas-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas-context.d.ts","sourceRoot":"","sources":["../../src/adapter/canvas-context.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,MAAM,EAAC,oBAAiB;AACrC,OAAO,KAAK,EAAC,WAAW,EAAC,mCAAgC;AAGzD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"canvas-context.d.ts","sourceRoot":"","sources":["../../src/adapter/canvas-context.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,MAAM,EAAC,oBAAiB;AACrC,OAAO,KAAK,EAAC,WAAW,EAAC,mCAAgC;AAGzD,OAAO,KAAK,EAAC,aAAa,EAAC,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DAA0D;IAC1D,SAAS,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI;IAEjC;;;OAGG;IACH,SAAS,CAAC,uBAAuB,CAAC,EAAE,EAAE,MAAM;CAK7C"}
|
|
@@ -13,9 +13,8 @@ import { uid } from "../utils/uid.js";
|
|
|
13
13
|
*/
|
|
14
14
|
export class CanvasContext {
|
|
15
15
|
static defaultProps = {
|
|
16
|
-
id: undefined,
|
|
17
16
|
canvas: null,
|
|
18
|
-
width: 800,
|
|
17
|
+
width: 800, // width are height are only used by headless gl
|
|
19
18
|
height: 600,
|
|
20
19
|
useDevicePixels: true,
|
|
21
20
|
autoResize: true,
|
|
@@ -30,25 +29,10 @@ export class CanvasContext {
|
|
|
30
29
|
htmlCanvas;
|
|
31
30
|
offscreenCanvas;
|
|
32
31
|
type;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/** Visibility is automatically updated (via an IntersectionObserver) */
|
|
38
|
-
isVisible = true;
|
|
39
|
-
/** Device pixel ratio. Automatically updated via media queries */
|
|
40
|
-
devicePixelRatio;
|
|
41
|
-
/** Exact width of canvas in physical pixels (tracked by a ResizeObserver) */
|
|
42
|
-
pixelWidth;
|
|
43
|
-
/** Exact height of canvas in physical pixels (tracked by a ResizeObserver) */
|
|
44
|
-
pixelHeight;
|
|
45
|
-
/** Width of drawing buffer: automatically updated if props.autoResize is true */
|
|
46
|
-
drawingBufferWidth;
|
|
47
|
-
/** Height of drawing buffer: automatically updated if props.autoResize is true */
|
|
48
|
-
drawingBufferHeight;
|
|
49
|
-
_resizeObserver;
|
|
50
|
-
_intersectionObserver;
|
|
51
|
-
/** State used by luma.gl classes: TODO - remove */
|
|
32
|
+
width = 1;
|
|
33
|
+
height = 1;
|
|
34
|
+
resizeObserver;
|
|
35
|
+
/** State used by luma.gl classes: TODO - move to canvasContext*/
|
|
52
36
|
_canvasSizeInfo = { clientWidth: 0, clientHeight: 0, devicePixelRatio: 1 };
|
|
53
37
|
toString() {
|
|
54
38
|
return `${this[Symbol.toStringTag]}(${this.id})`;
|
|
@@ -56,14 +40,23 @@ export class CanvasContext {
|
|
|
56
40
|
constructor(props) {
|
|
57
41
|
this.props = { ...CanvasContext.defaultProps, ...props };
|
|
58
42
|
props = this.props;
|
|
59
|
-
this.initialized = this._initializedResolvers.promise;
|
|
60
|
-
// Create a canvas element if needed
|
|
61
43
|
if (!isBrowser()) {
|
|
44
|
+
this.id = 'node-canvas-context';
|
|
45
|
+
this.type = 'node';
|
|
46
|
+
this.width = this.props.width;
|
|
47
|
+
this.height = this.props.height;
|
|
62
48
|
// TODO - does this prevent app from using jsdom style polyfills?
|
|
63
|
-
this.canvas =
|
|
49
|
+
this.canvas = null;
|
|
50
|
+
return;
|
|
64
51
|
}
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
if (!props.canvas) {
|
|
53
|
+
const canvas = createCanvas(props);
|
|
54
|
+
const container = getContainer(props?.container || null);
|
|
55
|
+
container.insertBefore(canvas, container.firstChild);
|
|
56
|
+
this.canvas = canvas;
|
|
57
|
+
if (!props?.visible) {
|
|
58
|
+
this.canvas.style.visibility = 'hidden';
|
|
59
|
+
}
|
|
67
60
|
}
|
|
68
61
|
else if (typeof props.canvas === 'string') {
|
|
69
62
|
this.canvas = getCanvasFromDOM(props.canvas);
|
|
@@ -71,90 +64,31 @@ export class CanvasContext {
|
|
|
71
64
|
else {
|
|
72
65
|
this.canvas = props.canvas;
|
|
73
66
|
}
|
|
74
|
-
if (
|
|
75
|
-
this.id =
|
|
67
|
+
if (this.canvas instanceof HTMLCanvasElement) {
|
|
68
|
+
this.id = this.canvas.id;
|
|
76
69
|
this.type = 'html-canvas';
|
|
77
70
|
this.htmlCanvas = this.canvas;
|
|
78
71
|
}
|
|
79
|
-
else
|
|
80
|
-
this.id =
|
|
72
|
+
else {
|
|
73
|
+
this.id = 'offscreen-canvas';
|
|
81
74
|
this.type = 'offscreen-canvas';
|
|
82
75
|
this.offscreenCanvas = this.canvas;
|
|
83
76
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.devicePixelRatio = globalThis.devicePixelRatio || 1;
|
|
95
|
-
if (typeof HTMLCanvasElement !== 'undefined' && this.canvas instanceof HTMLCanvasElement) {
|
|
96
|
-
// Track visibility changes
|
|
97
|
-
this._intersectionObserver = new IntersectionObserver(entries => this._handleIntersection(entries));
|
|
98
|
-
this._intersectionObserver.observe(this.canvas);
|
|
99
|
-
// Track size changes
|
|
100
|
-
this._resizeObserver = new ResizeObserver(entries => this._handleResize(entries));
|
|
101
|
-
try {
|
|
102
|
-
this._resizeObserver.observe(this.canvas, { box: 'device-pixel-content-box' });
|
|
103
|
-
}
|
|
104
|
-
catch {
|
|
105
|
-
// Safari fallback
|
|
106
|
-
this._resizeObserver.observe(this.canvas, { box: 'content-box' });
|
|
107
|
-
}
|
|
108
|
-
// Track device pixel ratio changes.
|
|
109
|
-
// Defer call to after construction completes to ensure `this.device` is available.
|
|
110
|
-
setTimeout(() => this._observeDevicePixelRatio(), 0);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
// SIZE METHODS
|
|
114
|
-
/**
|
|
115
|
-
* Returns the size covered by the canvas in CSS pixels
|
|
116
|
-
* @note This can be different from the actual device pixel size of a canvas due to DPR scaling, and rounding to integer pixels
|
|
117
|
-
* @note This is independent of the canvas' internal drawing buffer size (.width, .height).
|
|
118
|
-
*/
|
|
119
|
-
getCSSSize() {
|
|
120
|
-
if (typeof HTMLCanvasElement !== 'undefined' && this.canvas instanceof HTMLCanvasElement) {
|
|
121
|
-
return [this.canvas.clientWidth, this.canvas.clientHeight];
|
|
77
|
+
// React to size changes
|
|
78
|
+
if (this.canvas instanceof HTMLCanvasElement && props.autoResize) {
|
|
79
|
+
this.resizeObserver = new ResizeObserver(entries => {
|
|
80
|
+
for (const entry of entries) {
|
|
81
|
+
if (entry.target === this.canvas) {
|
|
82
|
+
this.update();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
this.resizeObserver.observe(this.canvas);
|
|
122
87
|
}
|
|
123
|
-
return [this.pixelWidth, this.pixelHeight];
|
|
124
88
|
}
|
|
125
89
|
/**
|
|
126
|
-
* Returns the
|
|
127
|
-
*
|
|
128
|
-
* @note This is independent of the canvas' internal drawing buffer size (.width, .height).
|
|
129
|
-
*/
|
|
130
|
-
getPixelSize() {
|
|
131
|
-
return [this.pixelWidth, this.pixelHeight];
|
|
132
|
-
}
|
|
133
|
-
/** Get the drawing buffer size (number of pixels GPU is rendering into, can be different from CSS size) */
|
|
134
|
-
getDrawingBufferSize() {
|
|
135
|
-
return [this.drawingBufferWidth, this.drawingBufferHeight];
|
|
136
|
-
}
|
|
137
|
-
/** Returns the biggest allowed framebuffer size. @todo Allow the application to limit this? */
|
|
138
|
-
getMaxDrawingBufferSize() {
|
|
139
|
-
const maxTextureDimension = this.device.limits.maxTextureDimension2D;
|
|
140
|
-
return [maxTextureDimension, maxTextureDimension];
|
|
141
|
-
}
|
|
142
|
-
/** Update the canvas drawing buffer size. Called automatically if props.autoResize is true. */
|
|
143
|
-
setDrawingBufferSize(width, height) {
|
|
144
|
-
this.canvas.width = width;
|
|
145
|
-
this.canvas.height = height;
|
|
146
|
-
this.drawingBufferWidth = width;
|
|
147
|
-
this.drawingBufferHeight = height;
|
|
148
|
-
}
|
|
149
|
-
/** @deprecated - TODO which values should we use for aspect */
|
|
150
|
-
getAspect() {
|
|
151
|
-
const [width, height] = this.getPixelSize();
|
|
152
|
-
return width / height;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Returns the current DPR (number of physical pixels per CSS pixel), if props.useDevicePixels is true
|
|
156
|
-
* @note This can be a fractional (non-integer) number, e.g. when the user zooms in the browser.
|
|
157
|
-
* @note This function handles the non-HTML canvas cases
|
|
90
|
+
* Returns the current DPR, if props.useDevicePixels is true
|
|
91
|
+
* Device refers to physical
|
|
158
92
|
*/
|
|
159
93
|
getDevicePixelRatio(useDevicePixels) {
|
|
160
94
|
if (typeof OffscreenCanvas !== 'undefined' && this.canvas instanceof OffscreenCanvas) {
|
|
@@ -171,6 +105,33 @@ export class CanvasContext {
|
|
|
171
105
|
}
|
|
172
106
|
return useDevicePixels;
|
|
173
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Returns the size of drawing buffer in device pixels.
|
|
110
|
+
* @note This can be different from the 'CSS' size of a canvas, and also from the
|
|
111
|
+
* canvas' internal drawing buffer size (.width, .height).
|
|
112
|
+
* This is the size required to cover the canvas, adjusted for DPR
|
|
113
|
+
*/
|
|
114
|
+
getPixelSize() {
|
|
115
|
+
switch (this.type) {
|
|
116
|
+
case 'node':
|
|
117
|
+
return [this.width, this.height];
|
|
118
|
+
case 'offscreen-canvas':
|
|
119
|
+
return [this.canvas.width, this.canvas.height];
|
|
120
|
+
case 'html-canvas':
|
|
121
|
+
const dpr = this.getDevicePixelRatio();
|
|
122
|
+
const canvas = this.canvas;
|
|
123
|
+
// If not attached to DOM client size can be 0
|
|
124
|
+
return canvas.parentElement
|
|
125
|
+
? [canvas.clientWidth * dpr, canvas.clientHeight * dpr]
|
|
126
|
+
: [this.canvas.width, this.canvas.height];
|
|
127
|
+
default:
|
|
128
|
+
throw new Error(this.type);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
getAspect() {
|
|
132
|
+
const [width, height] = this.getPixelSize();
|
|
133
|
+
return width / height;
|
|
134
|
+
}
|
|
174
135
|
/**
|
|
175
136
|
* Returns multiplier need to convert CSS size to Device size
|
|
176
137
|
*/
|
|
@@ -194,79 +155,11 @@ export class CanvasContext {
|
|
|
194
155
|
const [width, height] = this.getDrawingBufferSize();
|
|
195
156
|
return scalePixels(cssPixel, ratio, width, height, yInvert);
|
|
196
157
|
}
|
|
197
|
-
// IMPLEMENTATION
|
|
198
158
|
/**
|
|
199
|
-
*
|
|
200
|
-
* This can really help when debugging DOM in apps that create multiple devices
|
|
201
|
-
*/
|
|
202
|
-
_setAutoCreatedCanvasId(id) {
|
|
203
|
-
if (this.htmlCanvas?.id === 'lumagl-auto-created-canvas') {
|
|
204
|
-
this.htmlCanvas.id = id;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
/** reacts to our intersection observer */
|
|
208
|
-
_handleIntersection(entries) {
|
|
209
|
-
const entry = entries.find(entry_ => entry_.target === this.canvas);
|
|
210
|
-
if (!entry) {
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
// TODO - store intersection rectangle?
|
|
214
|
-
const isVisible = entry.isIntersecting;
|
|
215
|
-
if (this.isVisible !== isVisible) {
|
|
216
|
-
this.isVisible = isVisible;
|
|
217
|
-
this.device.props.onVisibilityChange(this);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Reacts to an observed resize by using the most accurate pixel size information the browser can provide
|
|
222
|
-
* @see https://web.dev/articles/device-pixel-content-box
|
|
223
|
-
* @see https://webgpufundamentals.org/webgpu/lessons/webgpu-resizing-the-canvas.html
|
|
224
|
-
*/
|
|
225
|
-
_handleResize(entries) {
|
|
226
|
-
const entry = entries.find(entry_ => entry_.target === this.canvas);
|
|
227
|
-
if (!entry) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
// Use the most accurate drawing buffer size information the current browser can provide
|
|
231
|
-
// Note: content box sizes are guaranteed to be integers
|
|
232
|
-
// Note: Safari falls back to contentBoxSize
|
|
233
|
-
const boxWidth = entry.devicePixelContentBoxSize?.[0].inlineSize ||
|
|
234
|
-
entry.contentBoxSize[0].inlineSize * devicePixelRatio;
|
|
235
|
-
const boxHeight = entry.devicePixelContentBoxSize?.[0].blockSize ||
|
|
236
|
-
entry.contentBoxSize[0].blockSize * devicePixelRatio;
|
|
237
|
-
// Update our drawing buffer size variables, saving the old values for logging
|
|
238
|
-
const oldPixelSize = this.getPixelSize();
|
|
239
|
-
// Make sure we don't overflow the maximum supported texture size
|
|
240
|
-
const [maxPixelWidth, maxPixelHeight] = this.getMaxDrawingBufferSize();
|
|
241
|
-
this.pixelWidth = Math.max(1, Math.min(boxWidth, maxPixelWidth));
|
|
242
|
-
this.pixelHeight = Math.max(1, Math.min(boxHeight, maxPixelHeight));
|
|
243
|
-
if (this.props.autoResize) {
|
|
244
|
-
// Update the canvas drawing buffer size
|
|
245
|
-
// TODO - This does not account for props.useDevicePixels
|
|
246
|
-
this.setDrawingBufferSize(this.pixelWidth, this.pixelHeight);
|
|
247
|
-
// Inform the subclass
|
|
248
|
-
this.updateSize(this.getDrawingBufferSize());
|
|
249
|
-
}
|
|
250
|
-
// Resolve the initialized promise
|
|
251
|
-
this._initializedResolvers.resolve();
|
|
252
|
-
this.isInitialized = true;
|
|
253
|
-
// Inform the device
|
|
254
|
-
this.device.props.onResize(this, { oldPixelSize });
|
|
255
|
-
}
|
|
256
|
-
/** Monitor DPR changes */
|
|
257
|
-
_observeDevicePixelRatio() {
|
|
258
|
-
const oldRatio = this.devicePixelRatio;
|
|
259
|
-
this.devicePixelRatio = window.devicePixelRatio;
|
|
260
|
-
// Inform the device
|
|
261
|
-
this.device.props.onDevicePixelRatioChange(this, { oldRatio });
|
|
262
|
-
// Set up a one time query against the current resolution.
|
|
263
|
-
matchMedia(`(resolution: ${this.devicePixelRatio}dppx)`).addEventListener('change', () => this._observeDevicePixelRatio(), { once: true });
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* @deprecated Use devicePixelRatio to set canvas width and height
|
|
159
|
+
* Use devicePixelRatio to set canvas width and height
|
|
267
160
|
* @note this is a raw port of luma.gl v8 code. Might be worth a review
|
|
268
161
|
*/
|
|
269
|
-
|
|
162
|
+
setDevicePixelRatio(devicePixelRatio, options = {}) {
|
|
270
163
|
if (!this.htmlCanvas) {
|
|
271
164
|
return;
|
|
272
165
|
}
|
|
@@ -309,9 +202,28 @@ export class CanvasContext {
|
|
|
309
202
|
}
|
|
310
203
|
}
|
|
311
204
|
}
|
|
205
|
+
// PRIVATE
|
|
206
|
+
/** @todo Major hack done to port the CSS methods above, base canvas context should not depend on WebGL */
|
|
207
|
+
getDrawingBufferSize() {
|
|
208
|
+
// @ts-expect-error This only works for WebGL
|
|
209
|
+
const gl = this.device.gl;
|
|
210
|
+
if (!gl) {
|
|
211
|
+
// use default device pixel ratio
|
|
212
|
+
throw new Error('canvas size');
|
|
213
|
+
}
|
|
214
|
+
return [gl.drawingBufferWidth, gl.drawingBufferHeight];
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Allows subclass constructor to override the canvas id for auto created canvases.
|
|
218
|
+
* This can really help when debugging DOM in apps that create multiple devices
|
|
219
|
+
*/
|
|
220
|
+
_setAutoCreatedCanvasId(id) {
|
|
221
|
+
if (this.htmlCanvas?.id === 'lumagl-auto-created-canvas') {
|
|
222
|
+
this.htmlCanvas.id = id;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
312
225
|
}
|
|
313
226
|
// HELPER FUNCTIONS
|
|
314
|
-
/** Get a container element from a string or DOM element */
|
|
315
227
|
function getContainer(container) {
|
|
316
228
|
if (typeof container === 'string') {
|
|
317
229
|
const element = document.getElementById(container);
|
|
@@ -320,7 +232,7 @@ function getContainer(container) {
|
|
|
320
232
|
}
|
|
321
233
|
return element;
|
|
322
234
|
}
|
|
323
|
-
if (container) {
|
|
235
|
+
else if (container) {
|
|
324
236
|
return container;
|
|
325
237
|
}
|
|
326
238
|
return document.body;
|
|
@@ -328,32 +240,24 @@ function getContainer(container) {
|
|
|
328
240
|
/** Get a Canvas element from DOM id */
|
|
329
241
|
function getCanvasFromDOM(canvasId) {
|
|
330
242
|
const canvas = document.getElementById(canvasId);
|
|
331
|
-
if (
|
|
332
|
-
typeof HTMLCanvasElement !== 'undefined' &&
|
|
333
|
-
!(canvas instanceof HTMLCanvasElement)) {
|
|
243
|
+
if (!(canvas instanceof HTMLCanvasElement)) {
|
|
334
244
|
throw new Error('Object is not a canvas element');
|
|
335
245
|
}
|
|
336
246
|
return canvas;
|
|
337
247
|
}
|
|
338
248
|
/** Create a new canvas */
|
|
339
|
-
function
|
|
249
|
+
function createCanvas(props) {
|
|
340
250
|
const { width, height } = props;
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
newCanvas.style.visibility = 'hidden';
|
|
349
|
-
}
|
|
350
|
-
// Insert the canvas in the DOM
|
|
351
|
-
const container = getContainer(props?.container || null);
|
|
352
|
-
container.insertBefore(newCanvas, container.firstChild);
|
|
353
|
-
return newCanvas;
|
|
251
|
+
const targetCanvas = document.createElement('canvas');
|
|
252
|
+
targetCanvas.id = uid('lumagl-auto-created-canvas');
|
|
253
|
+
targetCanvas.width = width || 1;
|
|
254
|
+
targetCanvas.height = height || 1;
|
|
255
|
+
targetCanvas.style.width = Number.isFinite(width) ? `${width}px` : '100%';
|
|
256
|
+
targetCanvas.style.height = Number.isFinite(height) ? `${height}px` : '100%';
|
|
257
|
+
return targetCanvas;
|
|
354
258
|
}
|
|
355
259
|
/**
|
|
356
|
-
*
|
|
260
|
+
*
|
|
357
261
|
* @param pixel
|
|
358
262
|
* @param ratio
|
|
359
263
|
* @param width
|
|
@@ -402,15 +306,4 @@ function scaleY(y, ratio, height, yInvert) {
|
|
|
402
306
|
? Math.max(0, height - 1 - Math.round(y * ratio))
|
|
403
307
|
: Math.min(Math.round(y * ratio), height - 1);
|
|
404
308
|
}
|
|
405
|
-
// TODO - replace with Promise.withResolvers once we upgrade TS baseline
|
|
406
|
-
function withResolvers() {
|
|
407
|
-
let resolve;
|
|
408
|
-
let reject;
|
|
409
|
-
const promise = new Promise((_resolve, _reject) => {
|
|
410
|
-
resolve = _resolve;
|
|
411
|
-
reject = _reject;
|
|
412
|
-
});
|
|
413
|
-
// @ts-expect-error - in fact these are no used before initialized
|
|
414
|
-
return { promise, resolve, reject };
|
|
415
|
-
}
|
|
416
309
|
//# sourceMappingURL=canvas-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas-context.js","sourceRoot":"","sources":["../../src/adapter/canvas-context.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAC,GAAG,EAAC,wBAAqB;AACjC,OAAO,EAAC,GAAG,EAAC,wBAAqB;AA2BjC;;;;;;GAMG;AACH,MAAM,OAAgB,aAAa;IACjC,MAAM,CAAC,YAAY,GAAiC;QAClD,EAAE,EAAE,SAAU;QACd,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,eAAe,EAAE,IAAI;QACrB,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,MAAM;KACnB,CAAC;IAIO,EAAE,CAAS;IAEX,KAAK,CAA+B;IACpC,MAAM,CAAsC;IAC5C,UAAU,CAAqB;IAC/B,eAAe,CAAmB;IAClC,IAAI,CAA8C;IAEjD,qBAAqB,GAAG,aAAa,EAAQ,CAAC;IAExD,gFAAgF;IAChF,WAAW,CAAgB;IAC3B,aAAa,GAAY,KAAK,CAAC;IAE/B,wEAAwE;IACxE,SAAS,GAAY,IAAI,CAAC;IAE1B,kEAAkE;IAClE,gBAAgB,CAAS;IAEzB,6EAA6E;IAC7E,UAAU,CAAS;IACnB,8EAA8E;IAC9E,WAAW,CAAS;IAEpB,iFAAiF;IACjF,kBAAkB,CAAS;IAC3B,kFAAkF;IAClF,mBAAmB,CAAS;IAET,eAAe,CAA6B;IAC5C,qBAAqB,CAAmC;IAE3E,mDAAmD;IAC1C,eAAe,GAAG,EAAC,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAA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