Skip to content

Commit

Permalink
Merge pull request pixijs#8440 from pixijs/next-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtimebuddy committed Jun 24, 2022
2 parents b1ea76c + 5842e02 commit 18ebd1b
Show file tree
Hide file tree
Showing 116 changed files with 588 additions and 238 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
}
},
"rules": {
"@typescript-eslint/consistent-type-imports": [1, { "disallowTypeAnnotations": false }],
"@typescript-eslint/no-parameter-properties": 1,
"@typescript-eslint/type-annotation-spacing": 1,
"jsdoc/multiline-blocks": [
Expand Down
4 changes: 2 additions & 2 deletions packages/accessibility/src/AccessibilityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { accessibleTarget } from './accessibleTarget';

import type { Rectangle } from '@pixi/math';
import type { Container } from '@pixi/display';
import { ExtensionMetadata, ExtensionType } from '@pixi/core';
import { ExtensionType } from '@pixi/core';
import type { IAccessibleHTMLElement } from './accessibleTarget';
import type { IRenderer } from '@pixi/core';
import type { IRenderer, ExtensionMetadata } from '@pixi/core';

// add some extra variables to the container..
DisplayObject.mixin(accessibleTarget);
Expand Down
3 changes: 2 additions & 1 deletion packages/app/src/ResizePlugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { CanvasRenderer } from '@pixi/canvas-renderer';
import { ExtensionMetadata, ExtensionType, Renderer } from '@pixi/core';
import type { ExtensionMetadata, Renderer } from '@pixi/core';
import { ExtensionType } from '@pixi/core';
import type { IApplicationOptions } from './Application';

/**
Expand Down
12 changes: 7 additions & 5 deletions packages/basis/src/BasisLoader.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import { TYPES, MIPMAP_MODES, ALPHA_MODES, FORMATS } from '@pixi/constants';
import { BaseTexture, BufferResource, ExtensionMetadata, ExtensionType, Texture } from '@pixi/core';
import { CompressedTextureResource, INTERNAL_FORMATS } from '@pixi/compressed-textures';
import type { ExtensionMetadata } from '@pixi/core';
import { BaseTexture, BufferResource, ExtensionType, Texture } from '@pixi/core';
import { CompressedTextureResource } from '@pixi/compressed-textures';
import type {
BasisTextureExtensions,
BasisBinding } from './Basis';
import {
BASIS_FORMATS,
BASIS_FORMAT_TO_INTERNAL_FORMAT,
INTERNAL_FORMAT_TO_BASIS_FORMAT,
BASIS_FORMATS_ALPHA,
BasisTextureExtensions,
BasisBinding,
BASIS_FORMAT_TO_TYPE,
} from './Basis';
import { TranscoderWorker } from './TranscoderWorker';
import { LoaderResource } from '@pixi/loaders';

import type { IResourceMetadata } from '@pixi/loaders';
import type { CompressedLevelBuffer } from '@pixi/compressed-textures';
import type { CompressedLevelBuffer, INTERNAL_FORMATS } from '@pixi/compressed-textures';

type TranscodedResourcesArray = (Array<CompressedTextureResource> | Array<BufferResource>) & {
basisFormat: BASIS_FORMATS
Expand Down
5 changes: 3 additions & 2 deletions packages/basis/src/TranscoderWorker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Runner } from '@pixi/runner';
import { BASIS_FORMATS } from './Basis';
import { ITranscodeResponse, TranscoderWorkerWrapper } from './TranscoderWorkerWrapper';
import type { BASIS_FORMATS } from './Basis';
import type { ITranscodeResponse } from './TranscoderWorkerWrapper';
import { TranscoderWorkerWrapper } from './TranscoderWorkerWrapper';

/**
* Worker class for transcoding *.basis files in background threads.
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-extract/src/CanvasExtract.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ExtensionType, RenderTexture } from '@pixi/core';
import { CanvasRenderTarget } from '@pixi/utils';
import { Rectangle } from '@pixi/math';
import { CanvasRenderer } from '@pixi/canvas-renderer';
import type { CanvasRenderer } from '@pixi/canvas-renderer';
import type { DisplayObject } from '@pixi/display';
import type { BaseRenderTexture, ISystem, ExtensionMetadata } from '@pixi/core';

Expand Down
7 changes: 4 additions & 3 deletions packages/canvas-graphics/src/CanvasGraphicsRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ExtensionMetadata, ExtensionType, Texture } from '@pixi/core';
import type { ExtensionMetadata } from '@pixi/core';
import { ExtensionType, Texture } from '@pixi/core';
import { SHAPES, Matrix } from '@pixi/math';
import { canvasUtils, CrossPlatformCanvasRenderingContext2D } from '@pixi/canvas-renderer';
import type { CanvasRenderer } from '@pixi/canvas-renderer';
import { canvasUtils } from '@pixi/canvas-renderer';
import type { CanvasRenderer, CrossPlatformCanvasRenderingContext2D } from '@pixi/canvas-renderer';
import type { FillStyle, Graphics, GraphicsData, LineStyle } from '@pixi/graphics';
import type { Circle, Ellipse, Polygon, Rectangle, RoundedRectangle } from '@pixi/math';
import { PolygonUtils } from './utils/PolygonUtils';
Expand Down
3 changes: 2 additions & 1 deletion packages/canvas-mesh/src/CanvasMeshRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ExtensionMetadata, ExtensionType, Texture } from '@pixi/core';
import type { ExtensionMetadata } from '@pixi/core';
import { ExtensionType, Texture } from '@pixi/core';
import { DRAW_MODES } from '@pixi/constants';
import { canvasUtils } from '@pixi/canvas-renderer';

Expand Down
3 changes: 2 additions & 1 deletion packages/canvas-renderer/src/CanvasContextSystem.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Matrix } from '@pixi/math';

import type { CanvasRenderer } from './CanvasRenderer';
import { ExtensionMetadata, ExtensionType, ISystem } from '@pixi/core';
import type { ExtensionMetadata, ISystem } from '@pixi/core';
import { ExtensionType } from '@pixi/core';
import { mapCanvasBlendModesToPixi } from './utils/mapCanvasBlendModesToPixi';
import { BLEND_MODES, SCALE_MODES } from '@pixi/constants';
import { settings } from '@pixi/settings';
Expand Down
6 changes: 4 additions & 2 deletions packages/canvas-renderer/src/CanvasMaskSystem.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Polygon, SHAPES } from '@pixi/math';
import type { Polygon } from '@pixi/math';
import { SHAPES } from '@pixi/math';

import type { CanvasRenderer } from './CanvasRenderer';
import type { Graphics } from '@pixi/graphics';
import { ExtensionMetadata, ExtensionType, ISystem, MaskData } from '@pixi/core';
import type { ExtensionMetadata, ISystem, MaskData } from '@pixi/core';
import { ExtensionType } from '@pixi/core';
import type { Container } from '@pixi/display';

/**
Expand Down
13 changes: 7 additions & 6 deletions packages/canvas-renderer/src/CanvasObjectRendererSystem.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { Matrix } from '@pixi/math';
import type { Matrix } from '@pixi/math';

import type { CanvasRenderer } from './CanvasRenderer';
import {
import type {
BaseRenderTexture,
CanvasResource,
ExtensionMetadata,
ExtensionType,
IRendererRenderOptions,
ISystem,
RenderTexture } from '@pixi/core';
import {
CanvasResource,
ExtensionType } from '@pixi/core';
import { BLEND_MODES } from '@pixi/constants';
import { CanvasRenderTarget, hex2string, rgb2hex } from '@pixi/utils';
import { DisplayObject } from 'pixi.js';
import { CrossPlatformCanvasRenderingContext2D } from './CanvasContextSystem';
import type { DisplayObject } from 'pixi.js';
import type { CrossPlatformCanvasRenderingContext2D } from './CanvasContextSystem';

/**
* system that provides a render function that focussing on rendering Pixi Scene Graph objects
Expand Down
29 changes: 15 additions & 14 deletions packages/canvas-renderer/src/CanvasRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import {
RenderTexture,
IRenderableObject,
GenerateTextureSystem,
SystemManager, IRenderer,
BackgroundSystem,
ViewSystem,
PluginSystem,
StartupSystem,
StartupOptions,
IGenerateTextureOptions,
SystemManager,
extensions,
ExtensionType
} from '@pixi/core';
import { CanvasMaskSystem } from './CanvasMaskSystem';
import { BLEND_MODES, RENDERER_TYPE } from '@pixi/constants';
import { Matrix, Rectangle } from '@pixi/math';
import type { BLEND_MODES, RENDERER_TYPE } from '@pixi/constants';
import type { Matrix, Rectangle } from '@pixi/math';
import type { DisplayObject } from '@pixi/display';
import type {
IRendererOptions,
IRendererPlugins,
IRendererRenderOptions
} from '@pixi/core';
,
RenderTexture,
IRenderableObject,
GenerateTextureSystem, IRenderer,
BackgroundSystem,
ViewSystem,
PluginSystem,
StartupSystem,
StartupOptions,
IGenerateTextureOptions } from '@pixi/core';

import { CanvasContextSystem, SmoothingEnabledProperties } from './CanvasContextSystem';
import type { SmoothingEnabledProperties } from './CanvasContextSystem';
import { CanvasContextSystem } from './CanvasContextSystem';
import { CanvasObjectRendererSystem } from './CanvasObjectRendererSystem';
import { settings } from '@pixi/settings';
import { deprecation } from '@pixi/utils';
Expand Down
3 changes: 2 additions & 1 deletion packages/canvas-sprite/src/CanvasSpriteRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { Matrix, groupD8 } from '@pixi/math';
import { canvasUtils } from '@pixi/canvas-renderer';
import type { CanvasRenderer } from '@pixi/canvas-renderer';
import type { Sprite } from '@pixi/sprite';
import { ExtensionMetadata, ExtensionType } from '@pixi/core';
import type { ExtensionMetadata } from '@pixi/core';
import { ExtensionType } from '@pixi/core';

const canvasRenderWorldTransform = new Matrix();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { url } from '@pixi/utils';

import type { Loader } from '@pixi/loaders';
import type { INTERNAL_FORMATS } from '../const';
import { ExtensionMetadata, ExtensionType } from '@pixi/core';
import type { ExtensionMetadata } from '@pixi/core';
import { ExtensionType } from '@pixi/core';

/**
* Schema for compressed-texture manifests
Expand Down
3 changes: 2 additions & 1 deletion packages/compressed-textures/src/loaders/DDSLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { CompressedTextureResource } from '../resources';
import { INTERNAL_FORMATS, INTERNAL_FORMAT_TO_BYTES_PER_PIXEL } from '../const';
import { LoaderResource } from '@pixi/loaders';
import { registerCompressedTextures } from './registerCompressedTextures';
import { ExtensionMetadata, ExtensionType } from '@pixi/core';
import type { ExtensionMetadata } from '@pixi/core';
import { ExtensionType } from '@pixi/core';

// Set DDS files to be loaded as an ArrayBuffer
LoaderResource.setExtensionXhrType('dds', LoaderResource.XHR_RESPONSE_TYPE.BUFFER);
Expand Down
6 changes: 4 additions & 2 deletions packages/compressed-textures/src/loaders/KTXLoader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { ALPHA_MODES, FORMATS, MIPMAP_MODES, TYPES } from '@pixi/constants';
import { BaseTexture, BufferResource, ExtensionMetadata, ExtensionType, Texture } from '@pixi/core';
import { CompressedLevelBuffer, CompressedTextureResource } from '../resources/CompressedTextureResource';
import type { ExtensionMetadata } from '@pixi/core';
import { BaseTexture, BufferResource, ExtensionType, Texture } from '@pixi/core';
import type { CompressedLevelBuffer } from '../resources/CompressedTextureResource';
import { CompressedTextureResource } from '../resources/CompressedTextureResource';
import { LoaderResource } from '@pixi/loaders';
import { INTERNAL_FORMAT_TO_BYTES_PER_PIXEL } from '../const';
import { registerCompressedTextures } from './registerCompressedTextures';
Expand Down
3 changes: 2 additions & 1 deletion packages/compressed-textures/src/resources/BlobResource.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Resource, ViewableBuffer, BufferResource } from '@pixi/core';
import type { Resource } from '@pixi/core';
import { ViewableBuffer, BufferResource } from '@pixi/core';

interface IBlobOptions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BlobResource } from './BlobResource';
import { INTERNAL_FORMAT_TO_BYTES_PER_PIXEL } from '../const';
import { Renderer, BaseTexture, GLTexture } from '@pixi/core';
import type { Renderer, BaseTexture, GLTexture } from '@pixi/core';

import type { INTERNAL_FORMATS } from '../const';

Expand Down
22 changes: 22 additions & 0 deletions packages/constants/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ export enum PRECISION
* @property {number} SCISSOR - Scissor mask, rectangle on screen, cheap
* @property {number} STENCIL - Stencil mask, 1-bit, medium, works only if renderer supports stencil
* @property {number} SPRITE - Mask that uses SpriteMaskFilter, uses temporary RenderTexture
* @property {number} COLOR - Color mask (RGBA)
*/
export enum MASK_TYPES
// eslint-disable-next-line @typescript-eslint/indent
Expand All @@ -479,6 +480,27 @@ export enum MASK_TYPES
SCISSOR = 1,
STENCIL = 2,
SPRITE = 3,
COLOR = 4,
}

/**
* Bitwise OR of masks that indicate the color channels that are rendered to.
* @static
* @memberof PIXI
* @name COLOR_MASK_BITS
* @enum {number}
* @property {number} RED - Red channel.
* @property {number} GREEN - Green channel
* @property {number} BLUE - Blue channel.
* @property {number} ALPHA - Alpha channel.
*/
export enum COLOR_MASK_BITS
// eslint-disable-next-line @typescript-eslint/indent
{
RED = 0x1,
GREEN = 0x2,
BLUE = 0x4,
ALPHA = 0x8
}

/**
Expand Down
18 changes: 11 additions & 7 deletions packages/core/src/Renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,26 @@ import { ShaderSystem } from './shader/ShaderSystem';
import { ContextSystem } from './context/ContextSystem';
import { BatchSystem } from './batch/BatchSystem';
import { TextureGCSystem } from './textures/TextureGCSystem';
import { MSAA_QUALITY, RENDERER_TYPE } from '@pixi/constants';
import type { MSAA_QUALITY, RENDERER_TYPE } from '@pixi/constants';
import { UniformGroup } from './shader/UniformGroup';
import { Matrix, Rectangle } from '@pixi/math';
import type { Rectangle } from '@pixi/math';
import { Matrix } from '@pixi/math';
import { BufferSystem } from './geometry/BufferSystem';
import { RenderTexture } from './renderTexture/RenderTexture';
import type { RenderTexture } from './renderTexture/RenderTexture';
import { extensions, ExtensionType } from './extensions';
import { IRendererPlugins, PluginSystem } from './plugin/PluginSystem';
import type { IRendererPlugins } from './plugin/PluginSystem';
import { PluginSystem } from './plugin/PluginSystem';
import { MultisampleSystem } from './framebuffer/MultisampleSystem';
import { GenerateTextureSystem, IGenerateTextureOptions } from './renderTexture/GenerateTextureSystem';
import type { IGenerateTextureOptions } from './renderTexture/GenerateTextureSystem';
import { GenerateTextureSystem } from './renderTexture/GenerateTextureSystem';
import { BackgroundSystem } from './background/BackgroundSystem';
import { ViewSystem } from './view/ViewSystem';
import { ObjectRendererSystem } from './render/ObjectRendererSystem';
import { settings } from '@pixi/settings';
import { SystemManager } from './system/SystemManager';
import { IRenderableObject, IRenderer, IRendererOptions, IRendererRenderOptions, IRenderingContext } from './IRenderer';
import { StartupOptions, StartupSystem } from './startup/StartupSystem';
import type { IRenderableObject, IRenderer, IRendererOptions, IRendererRenderOptions, IRenderingContext } from './IRenderer';
import type { StartupOptions } from './startup/StartupSystem';
import { StartupSystem } from './startup/StartupSystem';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Renderer extends GlobalMixins.Renderer {}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/autoDetectRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IRenderer, IRendererOptions } from './IRenderer';
import type { IRenderer, IRendererOptions } from './IRenderer';
import { Renderer } from './Renderer';

export interface IRendererOptionsAuto extends IRendererOptions
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/background/BackgroundSystem.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { hex2rgb, hex2string } from '@pixi/utils';
import { ExtensionMetadata, ExtensionType } from '../extensions';
import { ISystem } from '../system/ISystem';
import type { ExtensionMetadata } from '../extensions';
import { ExtensionType } from '../extensions';
import type { ISystem } from '../system/ISystem';

export interface BackgroundOptions
{
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/batch/BatchRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import type { Renderer } from '../Renderer';
import type { Shader } from '../shader/Shader';
import type { Texture } from '../textures/Texture';
import type { BLEND_MODES } from '@pixi/constants';
import { ExtensionMetadata, extensions, ExtensionType } from '../extensions';
import type { ExtensionMetadata } from '../extensions';
import { extensions, ExtensionType } from '../extensions';

/**
* Interface for elements like Sprite, Mesh etc. for batching.
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/batch/BatchSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import type { ISystem } from '../system/ISystem';
import type { Renderer } from '../Renderer';
import type { BaseTexture } from '../textures/BaseTexture';
import type { BatchTextureArray } from './BatchTextureArray';
import { ExtensionMetadata, ExtensionType } from '../extensions';
import type { ExtensionMetadata } from '../extensions';
import { ExtensionType } from '../extensions';

/**
* System plugin to the renderer to manage batching.
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/context/ContextSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { settings } from '../settings';
import type { ISystem } from '../system/ISystem';
import type { Renderer } from '../Renderer';
import type { WebGLExtensions } from './WebGLExtensions';
import { IRenderingContext } from '../IRenderer';
import { ExtensionMetadata, ExtensionType } from '../extensions';
import type { IRenderingContext } from '../IRenderer';
import type { ExtensionMetadata } from '../extensions';
import { ExtensionType } from '../extensions';

let CONTEXT_UID_COUNTER = 0;

Expand Down
13 changes: 6 additions & 7 deletions packages/core/src/filters/Filter.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { Shader } from '../shader/Shader';
import { settings } from '@pixi/settings';
import { Program } from '../shader/Program';
import { Shader } from '../shader/Shader';
import { State } from '../state/State';
import { settings } from '@pixi/settings';
import { MSAA_QUALITY } from '@pixi/constants';
import defaultVertex from './defaultFilter.vert';
import defaultFragment from './defaultFilter.frag';
import defaultVertex from './defaultFilter.vert';

import type { MSAA_QUALITY, BLEND_MODES, CLEAR_MODES } from '@pixi/constants';
import type { Dict } from '@pixi/utils';
import type { RenderTexture } from '../renderTexture/RenderTexture';
import type { FilterSystem } from './FilterSystem';
import type { FilterState } from './FilterState';
import type { BLEND_MODES, CLEAR_MODES } from '@pixi/constants';
import type { Dict } from '@pixi/utils';
import type { FilterSystem } from './FilterSystem';

/**
* A filter is a special shader that applies post-processing effects to an input texture and writes into an output
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/filters/FilterState.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Matrix, Rectangle } from '@pixi/math';
import type { Matrix } from '@pixi/math';
import { Rectangle } from '@pixi/math';
import { MSAA_QUALITY } from '@pixi/constants';

import type { Filter } from './Filter';
Expand Down

0 comments on commit 18ebd1b

Please sign in to comment.