Skip to content

Commit

Permalink
IDL: Rename old GPUCanvasCompositingAlphaMode to new GPUCanvasAlphaMo…
Browse files Browse the repository at this point in the history
  • Loading branch information
juj committed Aug 17, 2022
1 parent 361a014 commit 3d248b3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions idl/webgpu.idl
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ interface GPUCanvasContext {
GPUTexture getCurrentTexture();
};

enum GPUCanvasCompositingAlphaMode {
enum GPUCanvasAlphaMode {
"opaque",
"premultiplied"
};
Expand All @@ -1103,8 +1103,8 @@ dictionary GPUCanvasConfiguration {
GPUTextureUsageFlags usage = 0x10; // GPUTextureUsage.RENDER_ATTACHMENT
sequence<GPUTextureFormat> viewFormats = [];
GPUPredefinedColorSpace colorSpace = "srgb";
GPUCanvasCompositingAlphaMode compositingAlphaMode = "opaque";
GPUExtent3D size;
GPUCanvasAlphaMode alphaMode = "opaque";
};

enum GPUDeviceLostReason {
Expand Down
2 changes: 1 addition & 1 deletion lib/lib_webgpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const WGpuStorageTextureBindingLayout WGPU_STORAGE_TEXTURE_BINDING_LAYOUT_DEFAUL
const WGpuCanvasConfiguration WGPU_CANVAS_CONFIGURATION_DEFAULT_INITIALIZER = {
.usage = WGPU_TEXTURE_USAGE_RENDER_ATTACHMENT,
.colorSpace = WGPU_PREDEFINED_COLOR_SPACE_SRGB,
.compositingAlphaMode = WGPU_CANVAS_COMPOSITING_ALPHA_MODE_OPAQUE,
.alphaMode = WGPU_CANVAS_ALPHA_MODE_OPAQUE,
.size = WGPU_EXTENT_3D_DEFAULT_INITIALIZER
};

Expand Down
14 changes: 7 additions & 7 deletions lib/lib_webgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -2384,15 +2384,15 @@ WGPU_TEXTURE_FORMAT wgpu_canvas_context_get_preferred_format(WGpuCanvasContext c
WGpuTexture wgpu_canvas_context_get_current_texture(WGpuCanvasContext canvasContext);

/*
enum GPUCanvasCompositingAlphaMode {
enum GPUCanvasAlphaMode {
"opaque",
"premultiplied",
};
*/
typedef int WGPU_CANVAS_COMPOSITING_ALPHA_MODE;
#define WGPU_CANVAS_COMPOSITING_ALPHA_MODE_INVALID 0
#define WGPU_CANVAS_COMPOSITING_ALPHA_MODE_OPAQUE 1
#define WGPU_CANVAS_COMPOSITING_ALPHA_MODE_PREMULTIPLIED 2
typedef int WGPU_CANVAS_ALPHA_MODE;
#define WGPU_CANVAS_ALPHA_MODE_INVALID 0
#define WGPU_CANVAS_ALPHA_MODE_OPAQUE 1
#define WGPU_CANVAS_ALPHA_MODE_PREMULTIPLIED 2

/*
dictionary GPUCanvasConfiguration : GPUObjectDescriptorBase {
Expand All @@ -2401,7 +2401,7 @@ dictionary GPUCanvasConfiguration : GPUObjectDescriptorBase {
GPUTextureUsageFlags usage = 0x10; // GPUTextureUsage.RENDER_ATTACHMENT
sequence<GPUTextureFormat> viewFormats = [];
GPUPredefinedColorSpace colorSpace = "srgb";
GPUCanvasCompositingAlphaMode compositingAlphaMode = "opaque";
GPUCanvasAlphaMode alphaMode = "opaque";
GPUExtent3D size;
};
*/
Expand Down Expand Up @@ -2580,7 +2580,7 @@ typedef struct WGpuCanvasConfiguration
int numViewFormats;
WGPU_TEXTURE_FORMAT *viewFormats;
WGPU_PREDEFINED_COLOR_SPACE colorSpace;
WGPU_CANVAS_COMPOSITING_ALPHA_MODE compositingAlphaMode;
WGPU_CANVAS_ALPHA_MODE alphaMode;
WGpuExtent3D size; // If size.width == 0 (as default initialized via WGPU_CANVAS_CONFIGURATION_DEFAULT_INITIALIZER), then full screen size is used.
} WGpuCanvasConfiguration;
extern const WGpuCanvasConfiguration WGPU_CANVAS_CONFIGURATION_DEFAULT_INITIALIZER;
Expand Down
2 changes: 1 addition & 1 deletion lib/lib_webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ mergeInto(LibraryManager.library, {
'usage': HEAPU32[config+2],
'viewFormats': wgpuReadArrayOfWgpuObjects(HEAPU32[config+4], HEAPU32[config+3]),
'colorSpace': GPUPredefinedColorSpaces[HEAPU32[config+5]],
'compositingAlphaMode': [, 'opaque', 'premultiplied'][HEAPU32[config+6]],
'alphaMode': [, 'opaque', 'premultiplied'][HEAPU32[config+6]],
'size': HEAP32[config+7] ? [HEAP32[config+7], HEAP32[config+8], HEAP32[config+9]] : void 0
},
'canvasContext.configure() with config'
Expand Down
2 changes: 1 addition & 1 deletion lib/lib_webgpu_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ typedef struct WGpuQuerySetDescriptor WGpuQuerySetDescriptor;
typedef int WGPU_QUERY_TYPE;
typedef int WGPU_PIPELINE_STATISTIC_NAME;
typedef int WGpuCanvasContext;
typedef int WGPU_CANVAS_COMPOSITING_ALPHA_MODE;
typedef int WGPU_CANVAS_ALPHA_MODE;
typedef struct WGpuCanvasConfiguration WGpuCanvasConfiguration;
typedef int WGPU_DEVICE_LOST_REASON;
typedef int WGPU_ERROR_FILTER;
Expand Down

0 comments on commit 3d248b3

Please sign in to comment.