@galacean/engine-rhi-webgl 2.0.0-alpha.38 → 2.0.0-alpha.39

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": "@galacean/engine-rhi-webgl",
3
- "version": "2.0.0-alpha.38",
3
+ "version": "2.0.0-alpha.39",
4
4
  "repository": {
5
5
  "url": "https://github.com/galacean/engine.git"
6
6
  },
@@ -18,11 +18,11 @@
18
18
  "types/**/*"
19
19
  ],
20
20
  "dependencies": {
21
- "@galacean/engine-core": "2.0.0-alpha.38",
22
- "@galacean/engine-math": "2.0.0-alpha.38"
21
+ "@galacean/engine-core": "2.0.0-alpha.39",
22
+ "@galacean/engine-math": "2.0.0-alpha.39"
23
23
  },
24
24
  "devDependencies": {
25
- "@galacean/engine-design": "2.0.0-alpha.38"
25
+ "@galacean/engine-design": "2.0.0-alpha.39"
26
26
  },
27
27
  "scripts": {
28
28
  "b:types": "tsc"
@@ -1,35 +1,31 @@
1
1
  import { Canvas } from "@galacean/engine-core";
2
- import { Vector2 } from "@galacean/engine-math";
3
2
  type OffscreenCanvas = any;
4
3
  /**
5
4
  * The canvas used on the web, which can support HTMLCanvasElement and OffscreenCanvas.
6
5
  */
7
6
  export declare class WebCanvas extends Canvas {
7
+ private static _devicePixelContentBoxSupported?;
8
+ private static _supportsDevicePixelContentBox;
8
9
  _webCanvas: HTMLCanvasElement | OffscreenCanvas;
9
- private _scale;
10
+ private _resizeObserver?;
11
+ private _autoResolutionScale;
12
+ private _resolutionDirty;
13
+ private _pendingDevicePixelWidth;
14
+ private _pendingDevicePixelHeight;
10
15
  /**
11
- * The scale of canvas, the value is visible width/height divide the render width/height.
12
- * @remarks Need to re-assign after modification to ensure that the modification takes effect.
16
+ * @inheritdoc
17
+ *
18
+ * @remarks
19
+ * The canvas must have a CSS-constrained display size; otherwise auto-resolution disables itself.
13
20
  */
14
- get scale(): Vector2;
15
- set scale(value: Vector2);
16
- /**
17
- * Resize the rendering size according to the clientWidth and clientHeight of the canvas.
18
- * @param pixelRatio - Pixel ratio
19
- */
20
- resizeByClientSize(pixelRatio?: number): void;
21
+ setAutoResolution(scale?: number): void;
21
22
  /**
22
23
  * Create a web canvas.
23
24
  * @param webCanvas - Web native canvas
24
25
  */
25
26
  constructor(webCanvas: HTMLCanvasElement | OffscreenCanvas);
26
- /**
27
- * Set scale.
28
- * @param x - Scale along the X axis
29
- * @param y - Scale along the Y axis
30
- */
31
- setScale(x: number, y: number): void;
32
- protected _onWidthChanged(value: number): void;
33
- protected _onHeightChange(value: number): void;
27
+ private _setResolutionByClientSizeFallback;
28
+ protected _exitAutoResolution(): void;
29
+ protected _onResolutionChanged(width: number, height: number): void;
34
30
  }
35
31
  export {};
@@ -2,7 +2,7 @@ import { Engine, EngineConfiguration } from "@galacean/engine-core";
2
2
  import { WebGLGraphicDeviceOptions } from "./";
3
3
  import { WebCanvas } from "./WebCanvas";
4
4
  /**
5
- * WebGL platform engine,support includes WebGL1.0 and WebGL2.0.
5
+ * WebGL platform engine, supports WebGL 1.0 and WebGL 2.0.
6
6
  */
7
7
  export declare class WebGLEngine extends Engine {
8
8
  /**
@@ -12,12 +12,12 @@ export declare class WebGLEngine extends Engine {
12
12
  */
13
13
  static create(configuration: WebGLEngineConfiguration): Promise<WebGLEngine>;
14
14
  /**
15
- * Web canvas.
15
+ * The web canvas the engine renders to.
16
16
  */
17
17
  get canvas(): WebCanvas;
18
18
  }
19
19
  /**
20
- * WebGL engine configuration.
20
+ * Options for `WebGLEngine.create()`.
21
21
  */
22
22
  export interface WebGLEngineConfiguration extends EngineConfiguration {
23
23
  /** Canvas element or canvas id. */