@next2d/webgl 1.18.12 → 3.0.0
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/README.md +206 -5
- package/package.json +11 -18
- package/src/AtlasManager/service/AtlasManagerCreateNodeService.d.ts +12 -0
- package/src/AtlasManager/service/AtlasManagerCreateNodeService.js +41 -0
- package/src/AtlasManager/service/AtlasManagerRemoveNodeService.d.ts +11 -0
- package/src/AtlasManager/service/AtlasManagerRemoveNodeService.js +17 -0
- package/src/AtlasManager/usecase/AtlasManagerResetUseCase.d.ts +9 -0
- package/src/AtlasManager/usecase/AtlasManagerResetUseCase.js +19 -0
- package/src/AtlasManager.d.ts +16 -0
- package/src/AtlasManager.js +59 -0
- package/src/BezierConverter/service/BezierConverterSplit2CubicService.d.ts +19 -0
- package/src/BezierConverter/service/BezierConverterSplit2CubicService.js +41 -0
- package/src/BezierConverter/service/BezierConverterSplit2QuadService.d.ts +18 -0
- package/src/BezierConverter/service/BezierConverterSplit2QuadService.js +31 -0
- package/src/BezierConverter/usecase/BezierConverterAdaptiveCubicToQuadUseCase.d.ts +18 -0
- package/src/BezierConverter/usecase/BezierConverterAdaptiveCubicToQuadUseCase.js +193 -0
- package/src/BezierConverter/usecase/BezierConverterCubicToQuadUseCase.d.ts +17 -0
- package/src/BezierConverter/usecase/BezierConverterCubicToQuadUseCase.js +29 -0
- package/src/BezierConverter.d.ts +96 -0
- package/src/BezierConverter.js +166 -0
- package/src/Bitmap.d.ts +8 -0
- package/src/Bitmap.js +8 -0
- package/src/Blend/service/BlendAddService.d.ts +9 -0
- package/src/Blend/service/BlendAddService.js +16 -0
- package/src/Blend/service/BlendAlphaService.d.ts +9 -0
- package/src/Blend/service/BlendAlphaService.js +16 -0
- package/src/Blend/service/BlendEraseService.d.ts +9 -0
- package/src/Blend/service/BlendEraseService.js +16 -0
- package/src/Blend/service/BlendOneZeroService.d.ts +9 -0
- package/src/Blend/service/BlendOneZeroService.js +16 -0
- package/src/Blend/service/BlendResetService.d.ts +9 -0
- package/src/Blend/service/BlendResetService.js +16 -0
- package/src/Blend/service/BlendScreenService.d.ts +9 -0
- package/src/Blend/service/BlendScreenService.js +16 -0
- package/src/Blend/service/BlendSourceAtopService.d.ts +9 -0
- package/src/Blend/service/BlendSourceAtopService.js +16 -0
- package/src/Blend/service/BlendSourceInService.d.ts +9 -0
- package/src/Blend/service/BlendSourceInService.js +16 -0
- package/src/Blend/usecase/BlendBootUseCase.d.ts +9 -0
- package/src/Blend/usecase/BlendBootUseCase.js +14 -0
- package/src/Blend/usecase/BlendDrawFilterToMainUseCase.d.ts +14 -0
- package/src/Blend/usecase/BlendDrawFilterToMainUseCase.js +79 -0
- package/src/Blend/usecase/BlendOperationUseCase.d.ts +11 -0
- package/src/Blend/usecase/BlendOperationUseCase.js +37 -0
- package/src/Blend/usecase/BlnedClearArraysInstancedUseCase.d.ts +9 -0
- package/src/Blend/usecase/BlnedClearArraysInstancedUseCase.js +13 -0
- package/src/Blend/usecase/BlnedDrawArraysInstancedUseCase.d.ts +9 -0
- package/src/Blend/usecase/BlnedDrawArraysInstancedUseCase.js +24 -0
- package/src/Blend/usecase/BlnedDrawDisplayObjectUseCase.d.ts +16 -0
- package/src/Blend/usecase/BlnedDrawDisplayObjectUseCase.js +149 -0
- package/src/Blend.d.ts +5 -0
- package/src/Blend.js +8 -0
- package/src/ColorBufferObject/service/ColorBufferObjectCreateService.d.ts +10 -0
- package/src/ColorBufferObject/service/ColorBufferObjectCreateService.js +27 -0
- package/src/ColorBufferObject/service/ColorBufferObjectMeguruBinarySearchService.d.ts +10 -0
- package/src/ColorBufferObject/service/ColorBufferObjectMeguruBinarySearchService.js +24 -0
- package/src/ColorBufferObject/usecase/ColorBufferObjectAcquireObjectUseCase.d.ts +11 -0
- package/src/ColorBufferObject/usecase/ColorBufferObjectAcquireObjectUseCase.js +28 -0
- package/src/ColorBufferObject/usecase/ColorBufferObjectGetColorBufferObjectUseCase.d.ts +12 -0
- package/src/ColorBufferObject/usecase/ColorBufferObjectGetColorBufferObjectUseCase.js +32 -0
- package/src/ColorBufferObject/usecase/ColorBufferObjectReleaseColorBufferObjectUseCase.d.ts +11 -0
- package/src/ColorBufferObject/usecase/ColorBufferObjectReleaseColorBufferObjectUseCase.js +19 -0
- package/src/ColorBufferObject.d.ts +9 -0
- package/src/ColorBufferObject.js +8 -0
- package/src/Context/service/ContextBeginNodeRenderingService.d.ts +13 -0
- package/src/Context/service/ContextBeginNodeRenderingService.js +22 -0
- package/src/Context/service/ContextCreateImageBitmapService.d.ts +11 -0
- package/src/Context/service/ContextCreateImageBitmapService.js +78 -0
- package/src/Context/service/ContextEndNodeRenderingService.d.ts +9 -0
- package/src/Context/service/ContextEndNodeRenderingService.js +12 -0
- package/src/Context/service/ContextFillBackgroundColorService.d.ts +13 -0
- package/src/Context/service/ContextFillBackgroundColorService.js +18 -0
- package/src/Context/service/ContextResetService.d.ts +11 -0
- package/src/Context/service/ContextResetService.js +14 -0
- package/src/Context/service/ContextResetStyleService.d.ts +11 -0
- package/src/Context/service/ContextResetStyleService.js +13 -0
- package/src/Context/service/ContextRestoreService.d.ts +11 -0
- package/src/Context/service/ContextRestoreService.js +23 -0
- package/src/Context/service/ContextSaveService.d.ts +11 -0
- package/src/Context/service/ContextSaveService.js +13 -0
- package/src/Context/service/ContextSetTransformService.d.ts +16 -0
- package/src/Context/service/ContextSetTransformService.js +23 -0
- package/src/Context/service/ContextTransformService.d.ts +17 -0
- package/src/Context/service/ContextTransformService.js +29 -0
- package/src/Context/service/ContextUpdateBackgroundColorService.d.ts +15 -0
- package/src/Context/service/ContextUpdateBackgroundColorService.js +20 -0
- package/src/Context/service/ContextUpdateTransferBoundsService.d.ts +11 -0
- package/src/Context/service/ContextUpdateTransferBoundsService.js +21 -0
- package/src/Context/service/ContextUseGridService.d.ts +10 -0
- package/src/Context/service/ContextUseGridService.js +14 -0
- package/src/Context/usecase/ContextApplyFilterUseCase.d.ts +21 -0
- package/src/Context/usecase/ContextApplyFilterUseCase.js +206 -0
- package/src/Context/usecase/ContextBindUseCase.d.ts +13 -0
- package/src/Context/usecase/ContextBindUseCase.js +42 -0
- package/src/Context/usecase/ContextBitmapFillUseCase.d.ts +15 -0
- package/src/Context/usecase/ContextBitmapFillUseCase.js +31 -0
- package/src/Context/usecase/ContextBitmapStrokeUseCase.d.ts +15 -0
- package/src/Context/usecase/ContextBitmapStrokeUseCase.js +31 -0
- package/src/Context/usecase/ContextClearRectUseCase.d.ts +13 -0
- package/src/Context/usecase/ContextClearRectUseCase.js +20 -0
- package/src/Context/usecase/ContextClipUseCase.d.ts +9 -0
- package/src/Context/usecase/ContextClipUseCase.js +66 -0
- package/src/Context/usecase/ContextContainerBeginLayerUseCase.d.ts +18 -0
- package/src/Context/usecase/ContextContainerBeginLayerUseCase.js +31 -0
- package/src/Context/usecase/ContextContainerDrawCachedFilterUseCase.d.ts +16 -0
- package/src/Context/usecase/ContextContainerDrawCachedFilterUseCase.js +36 -0
- package/src/Context/usecase/ContextContainerEndLayerUseCase.d.ts +18 -0
- package/src/Context/usecase/ContextContainerEndLayerUseCase.js +171 -0
- package/src/Context/usecase/ContextDrawElementUseCase.d.ts +12 -0
- package/src/Context/usecase/ContextDrawElementUseCase.js +26 -0
- package/src/Context/usecase/ContextDrawFillUseCase.d.ts +9 -0
- package/src/Context/usecase/ContextDrawFillUseCase.js +73 -0
- package/src/Context/usecase/ContextDrawPixelsUseCase.d.ts +12 -0
- package/src/Context/usecase/ContextDrawPixelsUseCase.js +26 -0
- package/src/Context/usecase/ContextFillUseCase.d.ts +10 -0
- package/src/Context/usecase/ContextFillUseCase.js +23 -0
- package/src/Context/usecase/ContextGradientFillUseCase.d.ts +15 -0
- package/src/Context/usecase/ContextGradientFillUseCase.js +34 -0
- package/src/Context/usecase/ContextGradientStrokeUseCase.d.ts +15 -0
- package/src/Context/usecase/ContextGradientStrokeUseCase.js +34 -0
- package/src/Context/usecase/ContextLinearGradientFillUseCase.d.ts +14 -0
- package/src/Context/usecase/ContextLinearGradientFillUseCase.js +58 -0
- package/src/Context/usecase/ContextNormalFillUseCase.d.ts +14 -0
- package/src/Context/usecase/ContextNormalFillUseCase.js +40 -0
- package/src/Context/usecase/ContextPatternBitmapFillUseCase.d.ts +14 -0
- package/src/Context/usecase/ContextPatternBitmapFillUseCase.js +54 -0
- package/src/Context/usecase/ContextRadialGradientFillUseCase.d.ts +14 -0
- package/src/Context/usecase/ContextRadialGradientFillUseCase.js +61 -0
- package/src/Context/usecase/ContextResizeUseCase.d.ts +14 -0
- package/src/Context/usecase/ContextResizeUseCase.js +43 -0
- package/src/Context/usecase/ContextStrokeUseCase.d.ts +9 -0
- package/src/Context/usecase/ContextStrokeUseCase.js +22 -0
- package/src/Context.d.ts +76 -0
- package/src/Context.js +388 -0
- package/src/Filter/BevelFilter/usecase/FilterApplyBevelFilterUseCase.d.ts +22 -0
- package/src/Filter/BevelFilter/usecase/FilterApplyBevelFilterUseCase.js +105 -0
- package/src/Filter/BitmapFilter/usecase/FilterApplyBitmapFilterUseCase.d.ts +37 -0
- package/src/Filter/BitmapFilter/usecase/FilterApplyBitmapFilterUseCase.js +108 -0
- package/src/Filter/BlurFilter/usecase/FilterApplyBlurFilterUseCase.d.ts +16 -0
- package/src/Filter/BlurFilter/usecase/FilterApplyBlurFilterUseCase.js +134 -0
- package/src/Filter/BlurFilter/usecase/FilterApplyDirectionalBlurFilterUseCase.d.ts +13 -0
- package/src/Filter/BlurFilter/usecase/FilterApplyDirectionalBlurFilterUseCase.js +24 -0
- package/src/Filter/ColorMatrixFilter/usecase/FilterApplyColorMatrixFilterUseCase.d.ts +12 -0
- package/src/Filter/ColorMatrixFilter/usecase/FilterApplyColorMatrixFilterUseCase.js +38 -0
- package/src/Filter/ConvolutionFilter/usecase/FilterApplyConvolutionFilterUseCase.d.ts +20 -0
- package/src/Filter/ConvolutionFilter/usecase/FilterApplyConvolutionFilterUseCase.js +49 -0
- package/src/Filter/DisplacementMapFilter/usecase/FilterApplyDisplacementMapFilterUseCase.d.ts +23 -0
- package/src/Filter/DisplacementMapFilter/usecase/FilterApplyDisplacementMapFilterUseCase.js +53 -0
- package/src/Filter/DropShadowFilter/usecase/FilterApplyDropShadowFilterUseCase.d.ts +23 -0
- package/src/Filter/DropShadowFilter/usecase/FilterApplyDropShadowFilterUseCase.js +84 -0
- package/src/Filter/GlowFilter/usecase/FilterApplyGlowFilterUseCase.d.ts +20 -0
- package/src/Filter/GlowFilter/usecase/FilterApplyGlowFilterUseCase.js +51 -0
- package/src/Filter/GradientBevelFilter/usecase/FilterApplyGradientBevelFilterUseCase.d.ts +23 -0
- package/src/Filter/GradientBevelFilter/usecase/FilterApplyGradientBevelFilterUseCase.js +105 -0
- package/src/Filter/GradientGlowFilter/usecase/FilterApplyGradientGlowFilterUseCase.d.ts +23 -0
- package/src/Filter/GradientGlowFilter/usecase/FilterApplyGradientGlowFilterUseCase.js +81 -0
- package/src/Filter.d.ts +45 -0
- package/src/Filter.js +53 -0
- package/src/FrameBufferManager/service/FrameBufferManagerBindAttachmentObjectService.d.ts +11 -0
- package/src/FrameBufferManager/service/FrameBufferManagerBindAttachmentObjectService.js +35 -0
- package/src/FrameBufferManager/service/FrameBufferManagerCreateAttachmentObjectService.d.ts +10 -0
- package/src/FrameBufferManager/service/FrameBufferManagerCreateAttachmentObjectService.js +26 -0
- package/src/FrameBufferManager/service/FrameBufferManagerTransferAtlasTextureService.d.ts +9 -0
- package/src/FrameBufferManager/service/FrameBufferManagerTransferAtlasTextureService.js +31 -0
- package/src/FrameBufferManager/service/FrameBufferManagerTransferMainCanvasService.d.ts +9 -0
- package/src/FrameBufferManager/service/FrameBufferManagerTransferMainCanvasService.js +24 -0
- package/src/FrameBufferManager/service/FrameBufferManagerUnBindAttachmentObjectService.d.ts +9 -0
- package/src/FrameBufferManager/service/FrameBufferManagerUnBindAttachmentObjectService.js +17 -0
- package/src/FrameBufferManager/usecase/FrameBufferManagerGetAttachmentObjectUseCase.d.ts +13 -0
- package/src/FrameBufferManager/usecase/FrameBufferManagerGetAttachmentObjectUseCase.js +41 -0
- package/src/FrameBufferManager/usecase/FrameBufferManagerGetTextureFromBoundsUseCase.d.ts +14 -0
- package/src/FrameBufferManager/usecase/FrameBufferManagerGetTextureFromBoundsUseCase.js +41 -0
- package/src/FrameBufferManager/usecase/FrameBufferManagerGetTextureFromNodeUseCase.d.ts +12 -0
- package/src/FrameBufferManager/usecase/FrameBufferManagerGetTextureFromNodeUseCase.js +36 -0
- package/src/FrameBufferManager/usecase/FrameBufferManagerReleaseAttachmentObjectUseCase.d.ts +12 -0
- package/src/FrameBufferManager/usecase/FrameBufferManagerReleaseAttachmentObjectUseCase.js +30 -0
- package/src/FrameBufferManager/usecase/FrameBufferManagerTransferTextureFromRectUseCase.d.ts +11 -0
- package/src/FrameBufferManager/usecase/FrameBufferManagerTransferTextureFromRectUseCase.js +25 -0
- package/src/FrameBufferManager.d.ts +18 -0
- package/src/FrameBufferManager.js +38 -0
- package/src/Gradient.d.ts +8 -0
- package/src/Gradient.js +8 -0
- package/src/Grid.d.ts +14 -0
- package/src/Grid.js +16 -0
- package/src/Mask/service/MaskBeginMaskService.d.ts +9 -0
- package/src/Mask/service/MaskBeginMaskService.js +27 -0
- package/src/Mask/service/MaskEndMaskService.d.ts +9 -0
- package/src/Mask/service/MaskEndMaskService.js +26 -0
- package/src/Mask/service/MaskSetMaskBoundsService.d.ts +13 -0
- package/src/Mask/service/MaskSetMaskBoundsService.js +26 -0
- package/src/Mask/service/MaskUnionMaskService.d.ts +9 -0
- package/src/Mask/service/MaskUnionMaskService.js +32 -0
- package/src/Mask/usecase/MaskBindUseCase.d.ts +10 -0
- package/src/Mask/usecase/MaskBindUseCase.js +25 -0
- package/src/Mask/usecase/MaskLeaveMaskUseCase.d.ts +9 -0
- package/src/Mask/usecase/MaskLeaveMaskUseCase.js +53 -0
- package/src/Mask.d.ts +29 -0
- package/src/Mask.js +42 -0
- package/src/Mesh/service/MeshCalculateNormalVectorService.d.ts +13 -0
- package/src/Mesh/service/MeshCalculateNormalVectorService.js +18 -0
- package/src/Mesh/service/MeshCalculateNormalizeBezierService.d.ts +11 -0
- package/src/Mesh/service/MeshCalculateNormalizeBezierService.js +15 -0
- package/src/Mesh/service/MeshFillGenerateService.d.ts +23 -0
- package/src/Mesh/service/MeshFillGenerateService.js +197 -0
- package/src/Mesh/service/MeshFindOverlappingPathsService.d.ts +14 -0
- package/src/Mesh/service/MeshFindOverlappingPathsService.js +32 -0
- package/src/Mesh/service/MeshGenerateCalculateRoundCapService.d.ts +13 -0
- package/src/Mesh/service/MeshGenerateCalculateRoundCapService.js +51 -0
- package/src/Mesh/service/MeshGenerateCalculateSquareCapService.d.ts +13 -0
- package/src/Mesh/service/MeshGenerateCalculateSquareCapService.js +64 -0
- package/src/Mesh/service/MeshGetQuadraticBezierPointService.d.ts +14 -0
- package/src/Mesh/service/MeshGetQuadraticBezierPointService.js +18 -0
- package/src/Mesh/service/MeshGetQuadraticBezierTangentService.d.ts +14 -0
- package/src/Mesh/service/MeshGetQuadraticBezierTangentService.js +18 -0
- package/src/Mesh/service/MeshIsPointInsideRectangleService.d.ts +12 -0
- package/src/Mesh/service/MeshIsPointInsideRectangleService.js +38 -0
- package/src/Mesh/service/MeshLerpService.d.ts +13 -0
- package/src/Mesh/service/MeshLerpService.js +17 -0
- package/src/Mesh/usecase/MeshApproximateOffsetQuadraticUseCase.d.ts +14 -0
- package/src/Mesh/usecase/MeshApproximateOffsetQuadraticUseCase.js +35 -0
- package/src/Mesh/usecase/MeshCalculateCurveRectangleUseCase.d.ts +15 -0
- package/src/Mesh/usecase/MeshCalculateCurveRectangleUseCase.js +51 -0
- package/src/Mesh/usecase/MeshCalculateLineRectangleUseCase.d.ts +14 -0
- package/src/Mesh/usecase/MeshCalculateLineRectangleUseCase.js +42 -0
- package/src/Mesh/usecase/MeshFillGenerateUseCase.d.ts +12 -0
- package/src/Mesh/usecase/MeshFillGenerateUseCase.js +44 -0
- package/src/Mesh/usecase/MeshGenerateCalculateBevelJoinUseCase.d.ts +15 -0
- package/src/Mesh/usecase/MeshGenerateCalculateBevelJoinUseCase.js +52 -0
- package/src/Mesh/usecase/MeshGenerateCalculateMiterJoinUseCase.d.ts +17 -0
- package/src/Mesh/usecase/MeshGenerateCalculateMiterJoinUseCase.js +84 -0
- package/src/Mesh/usecase/MeshGenerateCalculateRoundJoinUseCase.d.ts +15 -0
- package/src/Mesh/usecase/MeshGenerateCalculateRoundJoinUseCase.js +63 -0
- package/src/Mesh/usecase/MeshGenerateStrokeOutlineUseCase.d.ts +12 -0
- package/src/Mesh/usecase/MeshGenerateStrokeOutlineUseCase.js +124 -0
- package/src/Mesh/usecase/MeshSplitBezierMultipleTimesUseCase.d.ts +14 -0
- package/src/Mesh/usecase/MeshSplitBezierMultipleTimesUseCase.js +32 -0
- package/src/Mesh/usecase/MeshSplitQuadraticBezierUseCase.d.ts +14 -0
- package/src/Mesh/usecase/MeshSplitQuadraticBezierUseCase.js +28 -0
- package/src/Mesh/usecase/MeshStrokeGenerateUseCase.d.ts +12 -0
- package/src/Mesh/usecase/MeshStrokeGenerateUseCase.js +29 -0
- package/src/Mesh.d.ts +74 -0
- package/src/Mesh.js +126 -0
- package/src/PathCommand/service/PathCommandBeginPathService.d.ts +9 -0
- package/src/PathCommand/service/PathCommandBeginPathService.js +16 -0
- package/src/PathCommand/service/PathCommandCreateRectVerticesService.d.ts +14 -0
- package/src/PathCommand/service/PathCommandCreateRectVerticesService.js +16 -0
- package/src/PathCommand/service/PathCommandEqualsToLastPointService.d.ts +11 -0
- package/src/PathCommand/service/PathCommandEqualsToLastPointService.js +17 -0
- package/src/PathCommand/service/PathCommandPushCurrentPathToVerticesService.d.ts +9 -0
- package/src/PathCommand/service/PathCommandPushCurrentPathToVerticesService.js +18 -0
- package/src/PathCommand/service/PathCommandPushPointToCurrentPathService.d.ts +12 -0
- package/src/PathCommand/service/PathCommandPushPointToCurrentPathService.js +15 -0
- package/src/PathCommand/usecase/PathCommandArcUseCase.d.ts +12 -0
- package/src/PathCommand/usecase/PathCommandArcUseCase.js +20 -0
- package/src/PathCommand/usecase/PathCommandBezierCurveToUseCase.d.ts +15 -0
- package/src/PathCommand/usecase/PathCommandBezierCurveToUseCase.js +38 -0
- package/src/PathCommand/usecase/PathCommandClosePathUseCase.d.ts +9 -0
- package/src/PathCommand/usecase/PathCommandClosePathUseCase.js +22 -0
- package/src/PathCommand/usecase/PathCommandLineToUseCase.d.ts +11 -0
- package/src/PathCommand/usecase/PathCommandLineToUseCase.js +26 -0
- package/src/PathCommand/usecase/PathCommandMoveToUseCase.d.ts +13 -0
- package/src/PathCommand/usecase/PathCommandMoveToUseCase.js +31 -0
- package/src/PathCommand/usecase/PathCommandQuadraticCurveToUseCase.d.ts +13 -0
- package/src/PathCommand/usecase/PathCommandQuadraticCurveToUseCase.js +26 -0
- package/src/PathCommand.d.ts +27 -0
- package/src/PathCommand.js +46 -0
- package/src/Shader/Fragment/Filter/FragmentShaderSourceBlurFilter.d.ts +1 -0
- package/{dist/shader/fragment/filter → src/Shader/Fragment/Filter}/FragmentShaderSourceBlurFilter.js +5 -18
- package/src/Shader/Fragment/Filter/FragmentShaderSourceColorMatrixFilter.d.ts +1 -0
- package/{dist/shader/fragment/filter → src/Shader/Fragment/Filter}/FragmentShaderSourceColorMatrixFilter.js +4 -16
- package/src/Shader/Fragment/Filter/FragmentShaderSourceConvolutionFilter.d.ts +1 -0
- package/src/Shader/Fragment/Filter/FragmentShaderSourceConvolutionFilter.js +62 -0
- package/src/Shader/Fragment/Filter/FragmentShaderSourceDisplacementMapFilter.d.ts +1 -0
- package/src/Shader/Fragment/Filter/FragmentShaderSourceDisplacementMapFilter.js +89 -0
- package/src/Shader/Fragment/Filter/FragmentShaderSourceFilter.d.ts +1 -0
- package/src/Shader/Fragment/Filter/FragmentShaderSourceFilter.js +174 -0
- package/src/Shader/Fragment/FragmentShaderLibrary.d.ts +2 -0
- package/src/Shader/Fragment/FragmentShaderLibrary.js +20 -0
- package/src/Shader/Fragment/FragmentShaderSource.d.ts +5 -0
- package/src/Shader/Fragment/FragmentShaderSource.js +76 -0
- package/src/Shader/Fragment/FragmentShaderSourceBlend.d.ts +1 -0
- package/src/Shader/Fragment/FragmentShaderSourceBlend.js +198 -0
- package/src/Shader/Fragment/FragmentShaderSourceGradient.d.ts +1 -0
- package/src/Shader/Fragment/FragmentShaderSourceGradient.js +68 -0
- package/src/Shader/Fragment/FragmentShaderSourceGradientLUT.d.ts +1 -0
- package/src/Shader/Fragment/FragmentShaderSourceGradientLUT.js +42 -0
- package/src/Shader/Fragment/FragmentShaderSourceTexture.d.ts +2 -0
- package/src/Shader/Fragment/FragmentShaderSourceTexture.js +48 -0
- package/src/Shader/GradientLUTGenerator/service/GradientLUTSetFilterUniformService.d.ts +16 -0
- package/src/Shader/GradientLUTGenerator/service/GradientLUTSetFilterUniformService.js +30 -0
- package/src/Shader/GradientLUTGenerator/service/GradientLUTSetUniformService.d.ts +15 -0
- package/src/Shader/GradientLUTGenerator/service/GradientLUTSetUniformService.js +29 -0
- package/src/Shader/GradientLUTGenerator/usecase/GradientLUTGenerateFilterTextureUseCase.d.ts +13 -0
- package/src/Shader/GradientLUTGenerator/usecase/GradientLUTGenerateFilterTextureUseCase.js +37 -0
- package/src/Shader/GradientLUTGenerator/usecase/GradientLUTGenerateShapeTextureUseCase.d.ts +16 -0
- package/src/Shader/GradientLUTGenerator/usecase/GradientLUTGenerateShapeTextureUseCase.js +51 -0
- package/src/Shader/GradientLUTGenerator/usecase/GradientLUTGeneratorFillTextureUseCase.d.ts +13 -0
- package/src/Shader/GradientLUTGenerator/usecase/GradientLUTGeneratorFillTextureUseCase.js +20 -0
- package/src/Shader/GradientLUTGenerator.d.ts +59 -0
- package/src/Shader/GradientLUTGenerator.js +97 -0
- package/src/Shader/ShaderInstancedManager/usecase/ShaderInstancedManagerDrawArraysInstancedUseCase.d.ts +11 -0
- package/src/Shader/ShaderInstancedManager/usecase/ShaderInstancedManagerDrawArraysInstancedUseCase.js +20 -0
- package/src/Shader/ShaderInstancedManager.d.ts +6 -0
- package/src/Shader/ShaderInstancedManager.js +17 -0
- package/src/Shader/ShaderManager/service/ShaderManagerBindUniformService.d.ts +11 -0
- package/src/Shader/ShaderManager/service/ShaderManagerBindUniformService.js +23 -0
- package/src/Shader/ShaderManager/service/ShaderManagerCreateProgramService.d.ts +12 -0
- package/src/Shader/ShaderManager/service/ShaderManagerCreateProgramService.js +39 -0
- package/src/Shader/ShaderManager/service/ShaderManagerInitializeUniformService.d.ts +12 -0
- package/src/Shader/ShaderManager/service/ShaderManagerInitializeUniformService.js +62 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetBitmapFillUniformService.d.ts +14 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetBitmapFillUniformService.js +85 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetBitmapFilterUniformService.d.ts +35 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetBitmapFilterUniformService.js +94 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetBlendUniformService.d.ts +11 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetBlendUniformService.js +14 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetBlendWithColorTransformUniformService.d.ts +19 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetBlendWithColorTransformUniformService.js +33 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetBlurFilterUniformService.d.ts +16 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetBlurFilterUniformService.js +30 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetColorMatrixFilterUniformService.d.ts +12 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetColorMatrixFilterUniformService.js +35 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetConvolutionFilterUniformService.d.ts +21 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetConvolutionFilterUniformService.js +42 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetDisplacementMapFilterUniformService.d.ts +24 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetDisplacementMapFilterUniformService.js +44 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetFillUniformService.d.ts +12 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetFillUniformService.js +55 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetGradientFillUniformService.d.ts +17 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetGradientFillUniformService.js +97 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetMaskUniformService.d.ts +11 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetMaskUniformService.js +54 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetMatrixTextureUniformService.d.ts +13 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetMatrixTextureUniformService.js +29 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetMatrixTextureWithColorTransformUniformService.d.ts +13 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetMatrixTextureWithColorTransformUniformService.js +38 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetTextureUniformService.d.ts +13 -0
- package/src/Shader/ShaderManager/service/ShaderManagerSetTextureUniformService.js +25 -0
- package/src/Shader/ShaderManager/service/ShaderManagerUseProgramService.d.ts +11 -0
- package/src/Shader/ShaderManager/service/ShaderManagerUseProgramService.js +25 -0
- package/src/Shader/ShaderManager/usecase/ShaderManagerDrawTextureUseCase.d.ts +11 -0
- package/src/Shader/ShaderManager/usecase/ShaderManagerDrawTextureUseCase.js +21 -0
- package/src/Shader/ShaderManager/usecase/ShaderManagerFillUseCase.d.ts +13 -0
- package/src/Shader/ShaderManager/usecase/ShaderManagerFillUseCase.js +24 -0
- package/src/Shader/ShaderManager.d.ts +10 -0
- package/src/Shader/ShaderManager.js +51 -0
- package/src/Shader/Variants/Bitmap/service/VariantsBitmapShaderService.d.ts +12 -0
- package/src/Shader/Variants/Bitmap/service/VariantsBitmapShaderService.js +26 -0
- package/src/Shader/Variants/BitmapVariants.d.ts +9 -0
- package/src/Shader/Variants/BitmapVariants.js +8 -0
- package/src/Shader/Variants/Blend/service/VariantsBlendDrawShaderService.d.ts +13 -0
- package/src/Shader/Variants/Blend/service/VariantsBlendDrawShaderService.js +23 -0
- package/src/Shader/Variants/Blend/service/VariantsBlendInstanceShaderService.d.ts +10 -0
- package/src/Shader/Variants/Blend/service/VariantsBlendInstanceShaderService.js +21 -0
- package/src/Shader/Variants/Blend/service/VariantsBlendMatrixTextureShaderService.d.ts +11 -0
- package/src/Shader/Variants/Blend/service/VariantsBlendMatrixTextureShaderService.js +22 -0
- package/src/Shader/Variants/Blend/service/VariantsBlendTextureShaderService.d.ts +10 -0
- package/src/Shader/Variants/Blend/service/VariantsBlendTextureShaderService.js +21 -0
- package/src/Shader/Variants/BlendVariants.d.ts +10 -0
- package/src/Shader/Variants/BlendVariants.js +8 -0
- package/src/Shader/Variants/Filter/service/VariantsBitmapFilterShaderService.d.ts +18 -0
- package/src/Shader/Variants/Filter/service/VariantsBitmapFilterShaderService.js +49 -0
- package/src/Shader/Variants/Filter/service/VariantsBlurFilterShaderService.d.ts +11 -0
- package/src/Shader/Variants/Filter/service/VariantsBlurFilterShaderService.js +22 -0
- package/src/Shader/Variants/Filter/service/VariantsColorMatrixFilterShaderService.d.ts +10 -0
- package/src/Shader/Variants/Filter/service/VariantsColorMatrixFilterShaderService.js +21 -0
- package/src/Shader/Variants/Filter/service/VariantsConvolutionFilterShaderService.d.ts +14 -0
- package/src/Shader/Variants/Filter/service/VariantsConvolutionFilterShaderService.js +30 -0
- package/src/Shader/Variants/Filter/service/VariantsDisplacementMapFilterShaderService.d.ts +13 -0
- package/src/Shader/Variants/Filter/service/VariantsDisplacementMapFilterShaderService.js +25 -0
- package/src/Shader/Variants/FilterVariants.d.ts +9 -0
- package/src/Shader/Variants/FilterVariants.js +8 -0
- package/src/Shader/Variants/Gradient/service/VariantsGradientCreateCollectionKeyService.d.ts +13 -0
- package/src/Shader/Variants/Gradient/service/VariantsGradientCreateCollectionKeyService.js +19 -0
- package/src/Shader/Variants/Gradient/usecase/VariantsGradientShapeShaderUseCase.d.ts +14 -0
- package/src/Shader/Variants/Gradient/usecase/VariantsGradientShapeShaderUseCase.js +28 -0
- package/src/Shader/Variants/GradientLUT/service/VariantsGradientLUTShaderService.d.ts +12 -0
- package/src/Shader/Variants/GradientLUT/service/VariantsGradientLUTShaderService.js +29 -0
- package/src/Shader/Variants/GradientLUTVariants.d.ts +30 -0
- package/src/Shader/Variants/GradientLUTVariants.js +71 -0
- package/src/Shader/Variants/GradientVariants.d.ts +9 -0
- package/src/Shader/Variants/GradientVariants.js +8 -0
- package/src/Shader/Variants/Shape/service/VariantsShapeMaskShaderService.d.ts +11 -0
- package/src/Shader/Variants/Shape/service/VariantsShapeMaskShaderService.js +22 -0
- package/src/Shader/Variants/Shape/service/VariantsShapeRectShaderService.d.ts +10 -0
- package/src/Shader/Variants/Shape/service/VariantsShapeRectShaderService.js +21 -0
- package/src/Shader/Variants/Shape/service/VariantsShapeSolidColorShaderService.d.ts +11 -0
- package/src/Shader/Variants/Shape/service/VariantsShapeSolidColorShaderService.js +22 -0
- package/src/Shader/Variants/ShapeVariants.d.ts +9 -0
- package/src/Shader/Variants/ShapeVariants.js +8 -0
- package/src/Shader/Vertex/VertexShaderLibrary.d.ts +2 -0
- package/{dist/shader/vertex → src/Shader/Vertex}/VertexShaderLibrary.js +15 -42
- package/src/Shader/Vertex/VertexShaderSource.d.ts +5 -0
- package/src/Shader/Vertex/VertexShaderSource.js +116 -0
- package/src/Shader/Vertex/VertexShaderSourceFill.d.ts +11 -0
- package/src/Shader/Vertex/VertexShaderSourceFill.js +101 -0
- package/src/Stencil/service/StencilDisableSampleAlphaToCoverageService.d.ts +1 -0
- package/src/Stencil/service/StencilDisableSampleAlphaToCoverageService.js +8 -0
- package/src/Stencil/service/StencilEnableSampleAlphaToCoverageService.d.ts +1 -0
- package/src/Stencil/service/StencilEnableSampleAlphaToCoverageService.js +8 -0
- package/src/Stencil/service/StencilResetService.d.ts +9 -0
- package/src/Stencil/service/StencilResetService.js +14 -0
- package/src/Stencil/service/StencilSetFillModeService.d.ts +1 -0
- package/src/Stencil/service/StencilSetFillModeService.js +13 -0
- package/src/Stencil/service/StencilSetMaskModeService.d.ts +1 -0
- package/src/Stencil/service/StencilSetMaskModeService.js +14 -0
- package/src/Stencil.d.ts +9 -0
- package/src/Stencil.js +17 -0
- package/src/StencilBufferObject/service/StencilBufferObjectCreateService.d.ts +10 -0
- package/src/StencilBufferObject/service/StencilBufferObjectCreateService.js +24 -0
- package/src/StencilBufferObject/service/StencilBufferObjectReleaseColorBufferObjectService.d.ts +11 -0
- package/src/StencilBufferObject/service/StencilBufferObjectReleaseColorBufferObjectService.js +23 -0
- package/src/StencilBufferObject/usecase/StencilBufferObjectAcquireObjectUseCase.d.ts +13 -0
- package/src/StencilBufferObject/usecase/StencilBufferObjectAcquireObjectUseCase.js +36 -0
- package/src/StencilBufferObject/usecase/StencilBufferObjectGetStencilBufferObjectUseCase.d.ts +12 -0
- package/src/StencilBufferObject/usecase/StencilBufferObjectGetStencilBufferObjectUseCase.js +27 -0
- package/src/StencilBufferObject.d.ts +9 -0
- package/src/StencilBufferObject.js +8 -0
- package/src/TextureManager/service/TextureManagerBindService.d.ts +14 -0
- package/src/TextureManager/service/TextureManagerBindService.js +33 -0
- package/src/TextureManager/service/TextureManagerCreateTextureObjectService.d.ts +12 -0
- package/src/TextureManager/service/TextureManagerCreateTextureObjectService.js +26 -0
- package/src/TextureManager/service/TextureManagerInitializeBindService.d.ts +12 -0
- package/src/TextureManager/service/TextureManagerInitializeBindService.js +25 -0
- package/src/TextureManager/usecase/TextureManagerBind012UseCase.d.ts +14 -0
- package/src/TextureManager/usecase/TextureManagerBind012UseCase.js +19 -0
- package/src/TextureManager/usecase/TextureManagerBind01UseCase.d.ts +13 -0
- package/src/TextureManager/usecase/TextureManagerBind01UseCase.js +18 -0
- package/src/TextureManager/usecase/TextureManagerBind02UseCase.d.ts +13 -0
- package/src/TextureManager/usecase/TextureManagerBind02UseCase.js +18 -0
- package/src/TextureManager/usecase/TextureManagerBind0UseCase.d.ts +12 -0
- package/src/TextureManager/usecase/TextureManagerBind0UseCase.js +17 -0
- package/src/TextureManager/usecase/TextureManagerCreateAtlasTextureUseCase.d.ts +10 -0
- package/src/TextureManager/usecase/TextureManagerCreateAtlasTextureUseCase.js +25 -0
- package/src/TextureManager/usecase/TextureManagerCreateFromCanvasUseCase.d.ts +14 -0
- package/src/TextureManager/usecase/TextureManagerCreateFromCanvasUseCase.js +19 -0
- package/src/TextureManager/usecase/TextureManagerCreateFromPixelsUseCase.d.ts +14 -0
- package/src/TextureManager/usecase/TextureManagerCreateFromPixelsUseCase.js +19 -0
- package/src/TextureManager/usecase/TextureManagerGetMainTextureFromBoundsUseCase.d.ts +14 -0
- package/src/TextureManager/usecase/TextureManagerGetMainTextureFromBoundsUseCase.js +49 -0
- package/src/TextureManager/usecase/TextureManagerGetTextureUseCase.d.ts +14 -0
- package/src/TextureManager/usecase/TextureManagerGetTextureUseCase.js +19 -0
- package/src/TextureManager/usecase/TextureManagerReleaseTextureObjectUseCase.d.ts +11 -0
- package/src/TextureManager/usecase/TextureManagerReleaseTextureObjectUseCase.js +13 -0
- package/src/TextureManager.d.ts +25 -0
- package/src/TextureManager.js +26 -0
- package/src/VertexArrayObject/service/VertexArrayObjectBindService.d.ts +11 -0
- package/src/VertexArrayObject/service/VertexArrayObjectBindService.js +26 -0
- package/src/VertexArrayObject/service/VertexArrayObjectCreateFillObjectService.d.ts +10 -0
- package/src/VertexArrayObject/service/VertexArrayObjectCreateFillObjectService.js +17 -0
- package/src/VertexArrayObject/service/VertexArrayObjectReleaseVertexArrayObjectService.d.ts +11 -0
- package/src/VertexArrayObject/service/VertexArrayObjectReleaseVertexArrayObjectService.js +16 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectBindAttributeUseCase.d.ts +9 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectBindAttributeUseCase.js +29 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectBindFillMeshUseCase.d.ts +10 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectBindFillMeshUseCase.js +27 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectBootUseCase.d.ts +10 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectBootUseCase.js +18 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectCreateGradientVertexArrayObjectUseCase.d.ts +12 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectCreateGradientVertexArrayObjectUseCase.js +27 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectCreateInstancedVertexArrayObjectUseCase.d.ts +10 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectCreateInstancedVertexArrayObjectUseCase.js +53 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectCreateRectVertexArrayObjectUseCase.d.ts +10 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectCreateRectVertexArrayObjectUseCase.js +24 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectGetFillObjectUseCase.d.ts +10 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectGetFillObjectUseCase.js +33 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectGetGradientObjectUseCase.d.ts +12 -0
- package/src/VertexArrayObject/usecase/VertexArrayObjectGetGradientObjectUseCase.js +34 -0
- package/src/VertexArrayObject.d.ts +71 -0
- package/src/VertexArrayObject.js +87 -0
- package/src/WebGLUtil.d.ts +34 -0
- package/src/WebGLUtil.js +175 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/interface/IAttachmentObject.d.ts +14 -0
- package/src/interface/IBlendMode.d.ts +1 -0
- package/{dist/interface/BoundsImpl.d.ts → src/interface/IBounds.d.ts} +1 -1
- package/{dist/interface/ClipObjectImpl.d.ts → src/interface/IClipObject.d.ts} +1 -1
- package/src/interface/IColorBufferObject.d.ts +9 -0
- package/src/interface/ICubicConverterReturnObject.d.ts +4 -0
- package/src/interface/IFillMesh.d.ts +4 -0
- package/src/interface/IFillType.d.ts +1 -0
- package/src/interface/IGradientType.d.ts +1 -0
- package/{dist/interface/GridImpl.d.ts → src/interface/IGrid.d.ts} +1 -1
- package/src/interface/IInterpolationMethod.d.ts +1 -0
- package/src/interface/IJointStyle.d.ts +1 -0
- package/src/interface/IPath.d.ts +1 -0
- package/{dist/interface/PointImpl.d.ts → src/interface/IPoint.d.ts} +1 -1
- package/src/interface/IProgramObject.d.ts +4 -0
- package/src/interface/ISpreadMethod.d.ts +1 -0
- package/src/interface/IStencilBufferObject.d.ts +8 -0
- package/src/interface/IStrokeVertexArrayObject.d.ts +6 -0
- package/src/interface/IStrokeVertexArrayObject.js +1 -0
- package/src/interface/ITextureObject.d.ts +8 -0
- package/src/interface/ITextureObject.js +1 -0
- package/{dist/interface/UniformDataImpl.d.ts → src/interface/IUniformData.d.ts} +1 -1
- package/src/interface/IUniformData.js +1 -0
- package/src/interface/IVertexArrayObject.d.ts +6 -0
- package/src/interface/IVertexArrayObject.js +1 -0
- package/dist/BezierConverter.d.ts +0 -59
- package/dist/BezierConverter.js +0 -106
- package/dist/CanvasGradientToWebGL.d.ts +0 -96
- package/dist/CanvasGradientToWebGL.js +0 -181
- package/dist/CanvasPatternToWebGL.d.ts +0 -31
- package/dist/CanvasPatternToWebGL.js +0 -50
- package/dist/CanvasToWebGLContext.d.ts +0 -650
- package/dist/CanvasToWebGLContext.js +0 -1600
- package/dist/CanvasToWebGLContextBlend.d.ts +0 -175
- package/dist/CanvasToWebGLContextBlend.js +0 -483
- package/dist/CanvasToWebGLContextGrid.d.ts +0 -74
- package/dist/CanvasToWebGLContextGrid.js +0 -283
- package/dist/CanvasToWebGLContextMask.d.ts +0 -107
- package/dist/CanvasToWebGLContextMask.js +0 -411
- package/dist/CanvasToWebGLContextPath.d.ts +0 -111
- package/dist/CanvasToWebGLContextPath.js +0 -210
- package/dist/CanvasToWebGLContextStyle.d.ts +0 -78
- package/dist/CanvasToWebGLContextStyle.js +0 -137
- package/dist/ColorBufferPool.d.ts +0 -58
- package/dist/ColorBufferPool.js +0 -134
- package/dist/Const.d.ts +0 -12
- package/dist/Const.js +0 -14
- package/dist/FrameBufferManager.d.ts +0 -174
- package/dist/FrameBufferManager.js +0 -467
- package/dist/StencilBufferPool.d.ts +0 -56
- package/dist/StencilBufferPool.js +0 -142
- package/dist/TextureManager.d.ts +0 -180
- package/dist/TextureManager.js +0 -531
- package/dist/VertexArrayObjectManager.d.ts +0 -115
- package/dist/VertexArrayObjectManager.js +0 -328
- package/dist/WebGLFillMeshGenerator.d.ts +0 -31
- package/dist/WebGLFillMeshGenerator.js +0 -101
- package/dist/WebGLStrokeMeshGenerator.d.ts +0 -183
- package/dist/WebGLStrokeMeshGenerator.js +0 -504
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -6
- package/dist/interface/AttachmentImpl.d.ts +0 -11
- package/dist/interface/BlendModeImpl.d.ts +0 -1
- package/dist/interface/CachePositionImpl.d.ts +0 -11
- package/dist/interface/CapsStyleImpl.d.ts +0 -1
- package/dist/interface/FillMeshImpl.d.ts +0 -5
- package/dist/interface/GradientTypeImpl.d.ts +0 -1
- package/dist/interface/IndexRangeImpl.d.ts +0 -4
- package/dist/interface/InterpolationMethodImpl.d.ts +0 -1
- package/dist/interface/JointStyleImpl.d.ts +0 -1
- package/dist/interface/SpreadMethodImpl.d.ts +0 -1
- package/dist/interface/StrokeMethImpl.d.ts +0 -4
- package/dist/interface/VerticesImpl.d.ts +0 -1
- package/dist/shader/CanvasToWebGLShader.d.ts +0 -99
- package/dist/shader/CanvasToWebGLShader.js +0 -213
- package/dist/shader/CanvasToWebGLShaderList.d.ts +0 -70
- package/dist/shader/CanvasToWebGLShaderList.js +0 -109
- package/dist/shader/GradientLUTGenerator.d.ts +0 -36
- package/dist/shader/GradientLUTGenerator.js +0 -130
- package/dist/shader/WebGLShaderInstance.d.ts +0 -30
- package/dist/shader/WebGLShaderInstance.js +0 -48
- package/dist/shader/WebGLShaderUniform.d.ts +0 -52
- package/dist/shader/WebGLShaderUniform.js +0 -159
- package/dist/shader/fragment/FragmentShaderLibrary.d.ts +0 -24
- package/dist/shader/fragment/FragmentShaderLibrary.js +0 -44
- package/dist/shader/fragment/FragmentShaderSource.d.ts +0 -29
- package/dist/shader/fragment/FragmentShaderSource.js +0 -99
- package/dist/shader/fragment/FragmentShaderSourceBlend.d.ts +0 -75
- package/dist/shader/fragment/FragmentShaderSourceBlend.js +0 -384
- package/dist/shader/fragment/FragmentShaderSourceGradient.d.ts +0 -44
- package/dist/shader/fragment/FragmentShaderSourceGradient.js +0 -114
- package/dist/shader/fragment/FragmentShaderSourceGradientLUT.d.ts +0 -14
- package/dist/shader/fragment/FragmentShaderSourceGradientLUT.js +0 -58
- package/dist/shader/fragment/FragmentShaderSourceTexture.d.ts +0 -18
- package/dist/shader/fragment/FragmentShaderSourceTexture.js +0 -68
- package/dist/shader/fragment/filter/FragmentShaderSourceBlurFilter.d.ts +0 -12
- package/dist/shader/fragment/filter/FragmentShaderSourceColorMatrixFilter.d.ts +0 -11
- package/dist/shader/fragment/filter/FragmentShaderSourceConvolutionFilter.d.ts +0 -16
- package/dist/shader/fragment/filter/FragmentShaderSourceConvolutionFilter.js +0 -80
- package/dist/shader/fragment/filter/FragmentShaderSourceDisplacementMapFilter.d.ts +0 -15
- package/dist/shader/fragment/filter/FragmentShaderSourceDisplacementMapFilter.js +0 -106
- package/dist/shader/fragment/filter/FragmentShaderSourceFilter.d.ts +0 -112
- package/dist/shader/fragment/filter/FragmentShaderSourceFilter.js +0 -275
- package/dist/shader/variants/BlendShaderVariantCollection.d.ts +0 -159
- package/dist/shader/variants/BlendShaderVariantCollection.js +0 -376
- package/dist/shader/variants/FilterShaderVariantCollection.d.ts +0 -150
- package/dist/shader/variants/FilterShaderVariantCollection.js +0 -395
- package/dist/shader/variants/GradientLUTShaderVariantCollection.d.ts +0 -49
- package/dist/shader/variants/GradientLUTShaderVariantCollection.js +0 -107
- package/dist/shader/variants/GradientShapeShaderVariantCollection.d.ts +0 -61
- package/dist/shader/variants/GradientShapeShaderVariantCollection.js +0 -196
- package/dist/shader/variants/ShapeShaderVariantCollection.d.ts +0 -117
- package/dist/shader/variants/ShapeShaderVariantCollection.js +0 -427
- package/dist/shader/vertex/VertexShaderLibrary.d.ts +0 -18
- package/dist/shader/vertex/VertexShaderSource.d.ts +0 -35
- package/dist/shader/vertex/VertexShaderSource.js +0 -164
- package/dist/shader/vertex/VertexShaderSourceFill.d.ts +0 -45
- package/dist/shader/vertex/VertexShaderSourceFill.js +0 -116
- package/dist/shader/vertex/VertexShaderSourceStroke.d.ts +0 -27
- package/dist/shader/vertex/VertexShaderSourceStroke.js +0 -149
- /package/{dist/interface/AttachmentImpl.js → src/interface/IAttachmentObject.js} +0 -0
- /package/{dist/interface/BlendModeImpl.js → src/interface/IBlendMode.js} +0 -0
- /package/{dist/interface/BoundsImpl.js → src/interface/IBounds.js} +0 -0
- /package/{dist/interface/CachePositionImpl.js → src/interface/IClipObject.js} +0 -0
- /package/{dist/interface/CapsStyleImpl.js → src/interface/IColorBufferObject.js} +0 -0
- /package/{dist/interface/ClipObjectImpl.js → src/interface/ICubicConverterReturnObject.js} +0 -0
- /package/{dist/interface/FillMeshImpl.js → src/interface/IFillMesh.js} +0 -0
- /package/{dist/interface/GradientTypeImpl.js → src/interface/IFillType.js} +0 -0
- /package/{dist/interface/GridImpl.js → src/interface/IGradientType.js} +0 -0
- /package/{dist/interface/IndexRangeImpl.js → src/interface/IGrid.js} +0 -0
- /package/{dist/interface/InterpolationMethodImpl.js → src/interface/IInterpolationMethod.js} +0 -0
- /package/{dist/interface/JointStyleImpl.js → src/interface/IJointStyle.js} +0 -0
- /package/{dist/interface/PointImpl.js → src/interface/IPath.js} +0 -0
- /package/{dist/interface/SpreadMethodImpl.js → src/interface/IPoint.js} +0 -0
- /package/{dist/interface/StrokeMethImpl.js → src/interface/IProgramObject.js} +0 -0
- /package/{dist/interface/UniformDataImpl.js → src/interface/ISpreadMethod.js} +0 -0
- /package/{dist/interface/VerticesImpl.js → src/interface/IStencilBufferObject.js} +0 -0
|
@@ -1,1600 +0,0 @@
|
|
|
1
|
-
import { CanvasToWebGLContextStyle } from "./CanvasToWebGLContextStyle";
|
|
2
|
-
import { FrameBufferManager } from "./FrameBufferManager";
|
|
3
|
-
import { CanvasToWebGLContextPath } from "./CanvasToWebGLContextPath";
|
|
4
|
-
import { CanvasToWebGLContextGrid } from "./CanvasToWebGLContextGrid";
|
|
5
|
-
import { CanvasToWebGLShaderList } from "./shader/CanvasToWebGLShaderList";
|
|
6
|
-
import { GradientLUTGenerator } from "./shader/GradientLUTGenerator";
|
|
7
|
-
import { VertexArrayObjectManager } from "./VertexArrayObjectManager";
|
|
8
|
-
import { CanvasToWebGLContextMask } from "./CanvasToWebGLContextMask";
|
|
9
|
-
import { CanvasToWebGLContextBlend } from "./CanvasToWebGLContextBlend";
|
|
10
|
-
import { CanvasPatternToWebGL } from "./CanvasPatternToWebGL";
|
|
11
|
-
import { CanvasGradientToWebGL } from "./CanvasGradientToWebGL";
|
|
12
|
-
import { WebGLFillMeshGenerator } from "./WebGLFillMeshGenerator";
|
|
13
|
-
import { $setRenderSize } from "./Const";
|
|
14
|
-
import { $Math, $getFloat32Array9, $getArray, $clamp, $poolArray, $inverseMatrix, $poolFloat32Array9, $poolBoundsObject, $getBoundsObject } from "@next2d/share";
|
|
15
|
-
/**
|
|
16
|
-
* @class
|
|
17
|
-
*/
|
|
18
|
-
export class CanvasToWebGLContext {
|
|
19
|
-
/**
|
|
20
|
-
* @param {WebGL2RenderingContext} gl
|
|
21
|
-
* @param {number} sample
|
|
22
|
-
* @constructor
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
constructor(gl, sample) {
|
|
26
|
-
$setRenderSize(gl.getParameter(gl.MAX_TEXTURE_SIZE));
|
|
27
|
-
/**
|
|
28
|
-
* @type {WebGL2RenderingContext}
|
|
29
|
-
* @private
|
|
30
|
-
*/
|
|
31
|
-
this._$gl = gl;
|
|
32
|
-
/**
|
|
33
|
-
* @type {number}
|
|
34
|
-
* @private
|
|
35
|
-
*/
|
|
36
|
-
const samples = $Math.min(sample, gl.getParameter(gl.MAX_SAMPLES));
|
|
37
|
-
/**
|
|
38
|
-
* @type {number}
|
|
39
|
-
* @private
|
|
40
|
-
*/
|
|
41
|
-
this._$maxTextureSize = $Math.min(8192, gl.getParameter(gl.MAX_TEXTURE_SIZE)) - 2;
|
|
42
|
-
/**
|
|
43
|
-
* @type {CanvasToWebGLContextStyle}
|
|
44
|
-
* @private
|
|
45
|
-
*/
|
|
46
|
-
this._$contextStyle = new CanvasToWebGLContextStyle();
|
|
47
|
-
/**
|
|
48
|
-
* @type {BoundsImpl}
|
|
49
|
-
* @private
|
|
50
|
-
*/
|
|
51
|
-
this._$cacheBounds = $getBoundsObject();
|
|
52
|
-
/**
|
|
53
|
-
* @type {Float32Array}
|
|
54
|
-
* @private
|
|
55
|
-
*/
|
|
56
|
-
this._$matrix = $getFloat32Array9(1, 0, 0, 0, 1, 0, 0, 0, 1);
|
|
57
|
-
/**
|
|
58
|
-
* @type {AttachmentImpl}
|
|
59
|
-
* @default null
|
|
60
|
-
* @private
|
|
61
|
-
*/
|
|
62
|
-
this._$cacheAttachment = null;
|
|
63
|
-
/**
|
|
64
|
-
* @type {array}
|
|
65
|
-
* @private
|
|
66
|
-
*/
|
|
67
|
-
this._$stack = [];
|
|
68
|
-
/**
|
|
69
|
-
* @type {number}
|
|
70
|
-
* @default 1
|
|
71
|
-
* @private
|
|
72
|
-
*/
|
|
73
|
-
this._$globalAlpha = 1;
|
|
74
|
-
/**
|
|
75
|
-
* @type {boolean}
|
|
76
|
-
* @default false
|
|
77
|
-
* @private
|
|
78
|
-
*/
|
|
79
|
-
this._$imageSmoothingEnabled = false;
|
|
80
|
-
/**
|
|
81
|
-
* @type {string}
|
|
82
|
-
* @default "normal"
|
|
83
|
-
* @private
|
|
84
|
-
*/
|
|
85
|
-
this._$globalCompositeOperation = "normal";
|
|
86
|
-
/**
|
|
87
|
-
* @type {number}
|
|
88
|
-
* @default 1
|
|
89
|
-
* @private
|
|
90
|
-
*/
|
|
91
|
-
this._$clearColorR = 1;
|
|
92
|
-
/**
|
|
93
|
-
* @type {number}
|
|
94
|
-
* @default 1
|
|
95
|
-
* @private
|
|
96
|
-
*/
|
|
97
|
-
this._$clearColorG = 1;
|
|
98
|
-
/**
|
|
99
|
-
* @type {number}
|
|
100
|
-
* @default 1
|
|
101
|
-
* @private
|
|
102
|
-
*/
|
|
103
|
-
this._$clearColorB = 1;
|
|
104
|
-
/**
|
|
105
|
-
* @type {number}
|
|
106
|
-
* @default 1
|
|
107
|
-
* @private
|
|
108
|
-
*/
|
|
109
|
-
this._$clearColorA = 1;
|
|
110
|
-
/**
|
|
111
|
-
* @type {number}
|
|
112
|
-
* @default 0
|
|
113
|
-
* @private
|
|
114
|
-
*/
|
|
115
|
-
this._$viewportWidth = 0;
|
|
116
|
-
/**
|
|
117
|
-
* @type {number}
|
|
118
|
-
* @default 0
|
|
119
|
-
* @private
|
|
120
|
-
*/
|
|
121
|
-
this._$viewportHeight = 0;
|
|
122
|
-
/**
|
|
123
|
-
* @type {FrameBufferManager}
|
|
124
|
-
* @private
|
|
125
|
-
*/
|
|
126
|
-
this._$frameBufferManager = new FrameBufferManager(gl, samples);
|
|
127
|
-
/**
|
|
128
|
-
* @type {CanvasToWebGLContextPath}
|
|
129
|
-
* @private
|
|
130
|
-
*/
|
|
131
|
-
this._$path = new CanvasToWebGLContextPath();
|
|
132
|
-
/**
|
|
133
|
-
* @type {CanvasToWebGLContextGrid}
|
|
134
|
-
* @private
|
|
135
|
-
*/
|
|
136
|
-
this._$grid = new CanvasToWebGLContextGrid();
|
|
137
|
-
/**
|
|
138
|
-
* @type {number}
|
|
139
|
-
* @default 0
|
|
140
|
-
* @private
|
|
141
|
-
*/
|
|
142
|
-
this._$offsetX = 0;
|
|
143
|
-
/**
|
|
144
|
-
* @type {number}
|
|
145
|
-
* @default 0
|
|
146
|
-
* @private
|
|
147
|
-
*/
|
|
148
|
-
this._$offsetY = 0;
|
|
149
|
-
/**
|
|
150
|
-
* @type {array}
|
|
151
|
-
* @private
|
|
152
|
-
*/
|
|
153
|
-
this._$blends = $getArray();
|
|
154
|
-
/**
|
|
155
|
-
* @type {array}
|
|
156
|
-
* @private
|
|
157
|
-
*/
|
|
158
|
-
this._$positions = $getArray();
|
|
159
|
-
/**
|
|
160
|
-
* @type {boolean}
|
|
161
|
-
* @default false
|
|
162
|
-
* @private
|
|
163
|
-
*/
|
|
164
|
-
this._$isLayer = false;
|
|
165
|
-
/**
|
|
166
|
-
* @type {CanvasToWebGLShaderList}
|
|
167
|
-
* @private
|
|
168
|
-
*/
|
|
169
|
-
this._$shaderList = new CanvasToWebGLShaderList(this, gl);
|
|
170
|
-
/**
|
|
171
|
-
* @type {GradientLUTGenerator}
|
|
172
|
-
* @private
|
|
173
|
-
*/
|
|
174
|
-
this._$gradientLUT = new GradientLUTGenerator(this, gl);
|
|
175
|
-
/**
|
|
176
|
-
* @type {VertexArrayObjectManager}
|
|
177
|
-
* @private
|
|
178
|
-
*/
|
|
179
|
-
this._$vao = new VertexArrayObjectManager(gl);
|
|
180
|
-
/**
|
|
181
|
-
* @type {CanvasToWebGLContextMask}
|
|
182
|
-
* @private
|
|
183
|
-
*/
|
|
184
|
-
this._$mask = new CanvasToWebGLContextMask(this, gl);
|
|
185
|
-
/**
|
|
186
|
-
* @type {CanvasToWebGLContextBlend}
|
|
187
|
-
* @private
|
|
188
|
-
*/
|
|
189
|
-
this._$blend = new CanvasToWebGLContextBlend(this, gl);
|
|
190
|
-
/**
|
|
191
|
-
* @type {array}
|
|
192
|
-
* @private
|
|
193
|
-
*/
|
|
194
|
-
this._$attachmentArray = [];
|
|
195
|
-
/**
|
|
196
|
-
* @type {object}
|
|
197
|
-
* @private
|
|
198
|
-
*/
|
|
199
|
-
this._$maskBounds = $getBoundsObject(0, 0, 0, 0);
|
|
200
|
-
/**
|
|
201
|
-
* @type {object}
|
|
202
|
-
* @default null
|
|
203
|
-
* @private
|
|
204
|
-
*/
|
|
205
|
-
this._$cachePosition = null;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* @member {object}
|
|
209
|
-
* @public
|
|
210
|
-
*/
|
|
211
|
-
get cachePosition() {
|
|
212
|
-
return this._$cachePosition;
|
|
213
|
-
}
|
|
214
|
-
set cachePosition(cache_position) {
|
|
215
|
-
this._$cachePosition = cache_position;
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* @return {void}
|
|
219
|
-
* @method
|
|
220
|
-
* @public
|
|
221
|
-
*/
|
|
222
|
-
reset() {
|
|
223
|
-
// reset
|
|
224
|
-
this._$globalAlpha = 1;
|
|
225
|
-
this._$globalCompositeOperation = "normal";
|
|
226
|
-
this._$imageSmoothingEnabled = false;
|
|
227
|
-
// reset color
|
|
228
|
-
this._$contextStyle.clear();
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* @return {boolean}
|
|
232
|
-
* @public
|
|
233
|
-
*/
|
|
234
|
-
get isLayer() {
|
|
235
|
-
return this._$isLayer;
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* @memberof CanvasToWebGLContext#
|
|
239
|
-
* @return {HTMLCanvasElement}
|
|
240
|
-
* @public
|
|
241
|
-
*/
|
|
242
|
-
get canvas() {
|
|
243
|
-
return this._$gl.canvas;
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* @return {AttachmentImpl|null}
|
|
247
|
-
* @public
|
|
248
|
-
*/
|
|
249
|
-
get cacheAttachment() {
|
|
250
|
-
return this._$cacheAttachment;
|
|
251
|
-
}
|
|
252
|
-
set cacheAttachment(attachment) {
|
|
253
|
-
this._$cacheAttachment = attachment;
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* @return {BoundsImpl}
|
|
257
|
-
* @readonly
|
|
258
|
-
* @public
|
|
259
|
-
*/
|
|
260
|
-
get cacheBounds() {
|
|
261
|
-
return this._$cacheBounds;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* @member {Float32Array|CanvasGradientToWebGL|CanvasPatternToWebGL}
|
|
265
|
-
* @public
|
|
266
|
-
*/
|
|
267
|
-
get fillStyle() {
|
|
268
|
-
return this._$contextStyle.fillStyle;
|
|
269
|
-
}
|
|
270
|
-
set fillStyle(fill_style) {
|
|
271
|
-
this._$contextStyle.fillStyle = fill_style;
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* @member {Float32Array|CanvasGradientToWebGL|CanvasPatternToWebGL}
|
|
275
|
-
* @public
|
|
276
|
-
*/
|
|
277
|
-
get strokeStyle() {
|
|
278
|
-
return this._$contextStyle.strokeStyle;
|
|
279
|
-
}
|
|
280
|
-
set strokeStyle(stroke_style) {
|
|
281
|
-
this._$contextStyle.strokeStyle = stroke_style;
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* @member {number}
|
|
285
|
-
* @public
|
|
286
|
-
*/
|
|
287
|
-
get lineWidth() {
|
|
288
|
-
return this._$contextStyle.lineWidth;
|
|
289
|
-
}
|
|
290
|
-
set lineWidth(line_width) {
|
|
291
|
-
this._$contextStyle.lineWidth = line_width;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* @member {string}
|
|
295
|
-
* @public
|
|
296
|
-
*/
|
|
297
|
-
get lineCap() {
|
|
298
|
-
return this._$contextStyle.lineCap;
|
|
299
|
-
}
|
|
300
|
-
set lineCap(line_cap) {
|
|
301
|
-
this._$contextStyle.lineCap = line_cap;
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* @member {string}
|
|
305
|
-
* @public
|
|
306
|
-
*/
|
|
307
|
-
get lineJoin() {
|
|
308
|
-
return this._$contextStyle.lineJoin;
|
|
309
|
-
}
|
|
310
|
-
set lineJoin(line_join) {
|
|
311
|
-
this._$contextStyle.lineJoin = line_join;
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* @member {number}
|
|
315
|
-
* @public
|
|
316
|
-
*/
|
|
317
|
-
get miterLimit() {
|
|
318
|
-
return this._$contextStyle.miterLimit;
|
|
319
|
-
}
|
|
320
|
-
set miterLimit(miter_limit) {
|
|
321
|
-
this._$contextStyle.miterLimit = miter_limit;
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* @member {number}
|
|
325
|
-
* @public
|
|
326
|
-
*/
|
|
327
|
-
get globalAlpha() {
|
|
328
|
-
return this._$globalAlpha;
|
|
329
|
-
}
|
|
330
|
-
set globalAlpha(global_alpha) {
|
|
331
|
-
this._$globalAlpha = $clamp(global_alpha, 0, 1, 1);
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* @member {boolean}
|
|
335
|
-
* @public
|
|
336
|
-
*/
|
|
337
|
-
get imageSmoothingEnabled() {
|
|
338
|
-
return this._$imageSmoothingEnabled;
|
|
339
|
-
}
|
|
340
|
-
set imageSmoothingEnabled(image_smoothing_enabled) {
|
|
341
|
-
this._$imageSmoothingEnabled = image_smoothing_enabled;
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* @member {BlendModeImpl}
|
|
345
|
-
* @public
|
|
346
|
-
*/
|
|
347
|
-
get globalCompositeOperation() {
|
|
348
|
-
return this._$globalCompositeOperation;
|
|
349
|
-
}
|
|
350
|
-
set globalCompositeOperation(global_composite_operation) {
|
|
351
|
-
this._$globalCompositeOperation = global_composite_operation;
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* @member {FrameBufferManager}
|
|
355
|
-
* @readonly
|
|
356
|
-
* @public
|
|
357
|
-
*/
|
|
358
|
-
get frameBuffer() {
|
|
359
|
-
return this._$frameBufferManager;
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* @member {CanvasToWebGLShaderList}
|
|
363
|
-
* @readonly
|
|
364
|
-
* @public
|
|
365
|
-
*/
|
|
366
|
-
get shaderList() {
|
|
367
|
-
return this._$shaderList;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* @member {CanvasToWebGLContextPath}
|
|
371
|
-
* @readonly
|
|
372
|
-
* @public
|
|
373
|
-
*/
|
|
374
|
-
get path() {
|
|
375
|
-
return this._$path;
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* @member {CanvasToWebGLContextGrid}
|
|
379
|
-
* @readonly
|
|
380
|
-
* @public
|
|
381
|
-
*/
|
|
382
|
-
get grid() {
|
|
383
|
-
return this._$grid;
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* @member {VertexArrayObjectManager}
|
|
387
|
-
* @readonly
|
|
388
|
-
* @public
|
|
389
|
-
*/
|
|
390
|
-
get vao() {
|
|
391
|
-
return this._$vao;
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* @member {CanvasToWebGLContextBlend}
|
|
395
|
-
* @readonly
|
|
396
|
-
* @public
|
|
397
|
-
*/
|
|
398
|
-
get blend() {
|
|
399
|
-
return this._$blend;
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* @return {object}
|
|
403
|
-
* @private
|
|
404
|
-
*/
|
|
405
|
-
_$getCurrentPosition() {
|
|
406
|
-
return this._$positions[this._$positions.length - 1];
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* @description textureの最大描画可能サイズからリサイズの比率を算出して返す
|
|
410
|
-
* Calculate and return the resize ratio from the maximum drawable size of texture
|
|
411
|
-
*
|
|
412
|
-
* @param {number} width
|
|
413
|
-
* @param {number} height
|
|
414
|
-
* @return {number}
|
|
415
|
-
* @method
|
|
416
|
-
* @public
|
|
417
|
-
*/
|
|
418
|
-
_$getTextureScale(width, height) {
|
|
419
|
-
const maxSize = $Math.max(width, height);
|
|
420
|
-
if (maxSize > this._$maxTextureSize) {
|
|
421
|
-
return this._$maxTextureSize / maxSize;
|
|
422
|
-
}
|
|
423
|
-
return 1;
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* @description 描画用のbufferをbind
|
|
427
|
-
*
|
|
428
|
-
* @return {void}
|
|
429
|
-
* @method
|
|
430
|
-
* @public
|
|
431
|
-
*/
|
|
432
|
-
drawInstacedArray() {
|
|
433
|
-
this._$blend.drawInstacedArray();
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* @return {void}
|
|
437
|
-
* @method
|
|
438
|
-
* @public
|
|
439
|
-
*/
|
|
440
|
-
clearInstacedArray() {
|
|
441
|
-
this._$blend.clearInstacedArray();
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* @description 描画用のbufferをbind
|
|
445
|
-
*
|
|
446
|
-
* @param {object} position
|
|
447
|
-
* @return {void}
|
|
448
|
-
* @method
|
|
449
|
-
* @public
|
|
450
|
-
*/
|
|
451
|
-
bindRenderBuffer(position) {
|
|
452
|
-
this
|
|
453
|
-
._$frameBufferManager
|
|
454
|
-
.bindRenderBuffer();
|
|
455
|
-
// 初期化
|
|
456
|
-
this._$gl.clearColor(0, 0, 0, 0);
|
|
457
|
-
this._$gl.clear(this._$gl.COLOR_BUFFER_BIT | this._$gl.STENCIL_BUFFER_BIT);
|
|
458
|
-
// 描画領域をあらためて設定
|
|
459
|
-
this._$viewportWidth = position.w;
|
|
460
|
-
this._$viewportHeight = position.h;
|
|
461
|
-
this._$gl.viewport(position.x, position.y, position.w, position.h);
|
|
462
|
-
this._$gl.enable(this._$gl.SCISSOR_TEST);
|
|
463
|
-
this._$gl.scissor(position.x, position.y, position.w, position.h);
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* @param {object} position
|
|
467
|
-
* @return {WebGLTexture}
|
|
468
|
-
* @method
|
|
469
|
-
* @public
|
|
470
|
-
*/
|
|
471
|
-
getTextureFromRect(position) {
|
|
472
|
-
const manager = this._$frameBufferManager;
|
|
473
|
-
const atlasTexture = manager
|
|
474
|
-
.textureManager
|
|
475
|
-
.getAtlasTexture(position.index);
|
|
476
|
-
const currentAttachment = manager.currentAttachment;
|
|
477
|
-
const attachment = manager
|
|
478
|
-
.createTextureAttachment(position.w, position.h);
|
|
479
|
-
this._$bind(attachment);
|
|
480
|
-
this.save();
|
|
481
|
-
this.setTransform(1, 0, 0, 1, 0, 0);
|
|
482
|
-
this.reset();
|
|
483
|
-
this.drawImage(atlasTexture, -position.x, -atlasTexture.height + position.h + position.y, atlasTexture.width, atlasTexture.height);
|
|
484
|
-
this.restore();
|
|
485
|
-
const texture = attachment.texture;
|
|
486
|
-
manager.releaseAttachment(attachment);
|
|
487
|
-
// reset
|
|
488
|
-
this._$bind(currentAttachment);
|
|
489
|
-
return texture;
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* @param {WebGLTexture} texture
|
|
493
|
-
* @return {void}
|
|
494
|
-
* @method
|
|
495
|
-
* @public
|
|
496
|
-
*/
|
|
497
|
-
drawBitmap(texture) {
|
|
498
|
-
const variants = this
|
|
499
|
-
._$shaderList
|
|
500
|
-
.blendShaderVariants;
|
|
501
|
-
const shader = variants
|
|
502
|
-
.getNormalBlendShader(false);
|
|
503
|
-
variants.setNormalBlendUniform(shader.uniform, 0, 0, texture.width, texture.height, this._$matrix, this._$viewportWidth, this._$viewportHeight, false, 1, 1, 1, 1, 0, 0, 0, 0);
|
|
504
|
-
this
|
|
505
|
-
._$frameBufferManager
|
|
506
|
-
.textureManager
|
|
507
|
-
.bind0(texture, this._$imageSmoothingEnabled);
|
|
508
|
-
this._$blend.toOperation("normal");
|
|
509
|
-
shader._$drawImage();
|
|
510
|
-
}
|
|
511
|
-
/**
|
|
512
|
-
* @return {void}
|
|
513
|
-
* @method
|
|
514
|
-
* @public
|
|
515
|
-
*/
|
|
516
|
-
drawTextureFromRect(texture, position) {
|
|
517
|
-
const manager = this._$frameBufferManager;
|
|
518
|
-
const currentAttachment = manager.currentAttachment;
|
|
519
|
-
this.bindRenderBuffer(position);
|
|
520
|
-
manager.transferTexture(position);
|
|
521
|
-
const atlasTexture = manager
|
|
522
|
-
.textureManager
|
|
523
|
-
.getAtlasTexture(position.index);
|
|
524
|
-
const attachment = manager
|
|
525
|
-
.createTextureAttachmentFrom(atlasTexture);
|
|
526
|
-
this._$bind(attachment);
|
|
527
|
-
this._$gl.enable(this._$gl.SCISSOR_TEST);
|
|
528
|
-
this._$gl.scissor(position.x, position.y, position.w, position.h);
|
|
529
|
-
this._$gl.clearColor(0, 0, 0, 0);
|
|
530
|
-
this._$gl.disable(this._$gl.SCISSOR_TEST);
|
|
531
|
-
this.save();
|
|
532
|
-
this.setTransform(1, 0, 0, 1, 0, 0);
|
|
533
|
-
this.reset();
|
|
534
|
-
this.drawImage(texture, position.x, atlasTexture.height - position.h - position.y, texture.width, texture.height);
|
|
535
|
-
this.restore();
|
|
536
|
-
manager.releaseAttachment(attachment);
|
|
537
|
-
// reset
|
|
538
|
-
this._$bind(currentAttachment);
|
|
539
|
-
manager.textureManager.release(texture);
|
|
540
|
-
}
|
|
541
|
-
/**
|
|
542
|
-
* @return {void}
|
|
543
|
-
* @method
|
|
544
|
-
* @public
|
|
545
|
-
*/
|
|
546
|
-
stopStencil() {
|
|
547
|
-
this._$mask._$onClearRect();
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* @param {object} [attachment = null]
|
|
551
|
-
* @return {void}
|
|
552
|
-
* @method
|
|
553
|
-
* @public
|
|
554
|
-
*/
|
|
555
|
-
_$bind(attachment = null) {
|
|
556
|
-
if (!attachment) {
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
this._$frameBufferManager.bind(attachment);
|
|
560
|
-
const colorBuffer = attachment.color;
|
|
561
|
-
const stencilBuffer = attachment.stencil;
|
|
562
|
-
const width = attachment.width;
|
|
563
|
-
const height = attachment.height;
|
|
564
|
-
if (this._$viewportWidth !== width || this._$viewportHeight !== height) {
|
|
565
|
-
this._$viewportWidth = width;
|
|
566
|
-
this._$viewportHeight = height;
|
|
567
|
-
this._$gl.viewport(0, 0, width, height);
|
|
568
|
-
}
|
|
569
|
-
// カラーバッファorステンシルバッファが、未初期化の場合はクリアする
|
|
570
|
-
if (colorBuffer && colorBuffer.dirty
|
|
571
|
-
|| stencilBuffer && stencilBuffer.dirty) {
|
|
572
|
-
if (colorBuffer) {
|
|
573
|
-
colorBuffer.dirty = false;
|
|
574
|
-
}
|
|
575
|
-
if (stencilBuffer) {
|
|
576
|
-
stencilBuffer.dirty = false;
|
|
577
|
-
}
|
|
578
|
-
this._$gl.clearColor(0, 0, 0, 0);
|
|
579
|
-
this.clearRect(0, 0, this._$viewportWidth, this._$viewportHeight);
|
|
580
|
-
this._$gl.clearColor(this._$clearColorR, this._$clearColorG, this._$clearColorB, this._$clearColorA);
|
|
581
|
-
this._$mask._$onClear(attachment.mask);
|
|
582
|
-
}
|
|
583
|
-
this._$mask._$onBind(attachment.mask);
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
* @param {number} a
|
|
587
|
-
* @param {number} b
|
|
588
|
-
* @param {number} c
|
|
589
|
-
* @param {number} d
|
|
590
|
-
* @param {number} e
|
|
591
|
-
* @param {number} f
|
|
592
|
-
* @return {void}
|
|
593
|
-
* @method
|
|
594
|
-
* @public
|
|
595
|
-
*/
|
|
596
|
-
setTransform(a, b, c, d, e, f) {
|
|
597
|
-
this._$matrix[0] = a;
|
|
598
|
-
this._$matrix[1] = b;
|
|
599
|
-
this._$matrix[3] = c;
|
|
600
|
-
this._$matrix[4] = d;
|
|
601
|
-
this._$matrix[6] = e;
|
|
602
|
-
this._$matrix[7] = f;
|
|
603
|
-
}
|
|
604
|
-
/**
|
|
605
|
-
* @param {number} width
|
|
606
|
-
* @param {number} height
|
|
607
|
-
* @return {void}
|
|
608
|
-
* @method
|
|
609
|
-
* @public
|
|
610
|
-
*/
|
|
611
|
-
setMaxSize(width, height) {
|
|
612
|
-
this._$frameBufferManager.setMaxSize(width, height);
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
|
-
* @param {number} a
|
|
616
|
-
* @param {number} b
|
|
617
|
-
* @param {number} c
|
|
618
|
-
* @param {number} d
|
|
619
|
-
* @param {number} e
|
|
620
|
-
* @param {number} f
|
|
621
|
-
* @return {void}
|
|
622
|
-
* @method
|
|
623
|
-
* @public
|
|
624
|
-
*/
|
|
625
|
-
transform(a, b, c, d, e, f) {
|
|
626
|
-
const a00 = this._$matrix[0];
|
|
627
|
-
const a01 = this._$matrix[1];
|
|
628
|
-
const a10 = this._$matrix[3];
|
|
629
|
-
const a11 = this._$matrix[4];
|
|
630
|
-
const a20 = this._$matrix[6];
|
|
631
|
-
const a21 = this._$matrix[7];
|
|
632
|
-
this._$matrix[0] = a * a00 + b * a10;
|
|
633
|
-
this._$matrix[1] = a * a01 + b * a11;
|
|
634
|
-
this._$matrix[3] = c * a00 + d * a10;
|
|
635
|
-
this._$matrix[4] = c * a01 + d * a11;
|
|
636
|
-
this._$matrix[6] = e * a00 + f * a10 + a20;
|
|
637
|
-
this._$matrix[7] = e * a01 + f * a11 + a21;
|
|
638
|
-
}
|
|
639
|
-
debug(index = 0) {
|
|
640
|
-
const manager = this._$frameBufferManager;
|
|
641
|
-
const atlasTexture = manager
|
|
642
|
-
.textureManager
|
|
643
|
-
.getAtlasTexture(index);
|
|
644
|
-
const currentAttachment = manager.currentAttachment;
|
|
645
|
-
const attachment = manager.createTextureAttachmentFrom(atlasTexture);
|
|
646
|
-
this._$bind(attachment);
|
|
647
|
-
const pixels = new Uint8Array(atlasTexture.width * atlasTexture.height * 4);
|
|
648
|
-
this._$gl.readPixels(0, 0, atlasTexture.width, atlasTexture.height, this._$gl.RGBA, this._$gl.UNSIGNED_BYTE, pixels);
|
|
649
|
-
const canvas = document.createElement("canvas");
|
|
650
|
-
canvas.width = atlasTexture.width;
|
|
651
|
-
canvas.height = atlasTexture.height;
|
|
652
|
-
const ctx = canvas.getContext("2d");
|
|
653
|
-
const imageData = new ImageData(atlasTexture.width, atlasTexture.height);
|
|
654
|
-
for (let idx = 0; idx < pixels.length; ++idx) {
|
|
655
|
-
imageData.data[idx] = pixels[idx];
|
|
656
|
-
}
|
|
657
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.putImageData(imageData, 0, 0);
|
|
658
|
-
console.log(canvas.toDataURL());
|
|
659
|
-
this._$bind(currentAttachment);
|
|
660
|
-
manager.releaseAttachment(attachment);
|
|
661
|
-
}
|
|
662
|
-
/**
|
|
663
|
-
* @param {number} x_min
|
|
664
|
-
* @param {number} y_min
|
|
665
|
-
* @param {number} x_max
|
|
666
|
-
* @param {number} y_max
|
|
667
|
-
* @param {Float32Array} color_transform
|
|
668
|
-
* @return {void}
|
|
669
|
-
* @method
|
|
670
|
-
* @public
|
|
671
|
-
*/
|
|
672
|
-
drawInstance(x_min, y_min, x_max, y_max, color_transform) {
|
|
673
|
-
let ct0 = 1;
|
|
674
|
-
let ct1 = 1;
|
|
675
|
-
let ct2 = 1;
|
|
676
|
-
let ct4 = 0;
|
|
677
|
-
let ct5 = 0;
|
|
678
|
-
let ct6 = 0;
|
|
679
|
-
const ct3 = this._$globalAlpha;
|
|
680
|
-
const ct7 = 0;
|
|
681
|
-
if (color_transform) {
|
|
682
|
-
ct0 = color_transform[0];
|
|
683
|
-
ct1 = color_transform[1];
|
|
684
|
-
ct2 = color_transform[2];
|
|
685
|
-
ct4 = color_transform[4] / 255;
|
|
686
|
-
ct5 = color_transform[5] / 255;
|
|
687
|
-
ct6 = color_transform[6] / 255;
|
|
688
|
-
}
|
|
689
|
-
const position = this._$cachePosition;
|
|
690
|
-
if (position) {
|
|
691
|
-
switch (this._$globalCompositeOperation) {
|
|
692
|
-
case "normal":
|
|
693
|
-
case "layer":
|
|
694
|
-
case "add":
|
|
695
|
-
case "screen":
|
|
696
|
-
case "alpha":
|
|
697
|
-
case "erase":
|
|
698
|
-
case "copy":
|
|
699
|
-
this._$blend.drawInstance(position, ct0, ct1, ct2, ct3, ct4, ct5, ct6, ct7, this._$globalCompositeOperation, this._$viewportWidth, this._$viewportHeight, this._$matrix, this._$imageSmoothingEnabled);
|
|
700
|
-
break;
|
|
701
|
-
default:
|
|
702
|
-
{
|
|
703
|
-
const atlasTexture = this
|
|
704
|
-
._$frameBufferManager
|
|
705
|
-
.textureManager
|
|
706
|
-
.getAtlasTexture(position.index);
|
|
707
|
-
this._$blend.drawInstanceBlend(atlasTexture, x_min, y_min, x_max, y_max, ct0, ct1, ct2, ct3, ct4, ct5, ct6, ct7, position, this._$globalCompositeOperation, this._$viewportWidth, this._$viewportHeight, this._$matrix, this._$imageSmoothingEnabled);
|
|
708
|
-
}
|
|
709
|
-
break;
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
/**
|
|
714
|
-
* @param {WebGLTexture} image
|
|
715
|
-
* @param {number} x
|
|
716
|
-
* @param {number} y
|
|
717
|
-
* @param {number} w
|
|
718
|
-
* @param {number} h
|
|
719
|
-
* @param {Float32Array} [color_transform=null]
|
|
720
|
-
* @return {void}
|
|
721
|
-
* @method
|
|
722
|
-
* @public
|
|
723
|
-
*/
|
|
724
|
-
drawImage(image, x, y, w, h, color_transform = null) {
|
|
725
|
-
let ct0 = 1;
|
|
726
|
-
let ct1 = 1;
|
|
727
|
-
let ct2 = 1;
|
|
728
|
-
let ct4 = 0;
|
|
729
|
-
let ct5 = 0;
|
|
730
|
-
let ct6 = 0;
|
|
731
|
-
const ct3 = this._$globalAlpha;
|
|
732
|
-
const ct7 = 0;
|
|
733
|
-
if (color_transform) {
|
|
734
|
-
ct0 = color_transform[0];
|
|
735
|
-
ct1 = color_transform[1];
|
|
736
|
-
ct2 = color_transform[2];
|
|
737
|
-
ct4 = color_transform[4] / 255;
|
|
738
|
-
ct5 = color_transform[5] / 255;
|
|
739
|
-
ct6 = color_transform[6] / 255;
|
|
740
|
-
}
|
|
741
|
-
this._$blend.drawImage(image, x, y, w, h, ct0, ct1, ct2, ct3, ct4, ct5, ct6, ct7, this._$globalCompositeOperation, this._$viewportWidth, this._$viewportHeight, this._$matrix, this._$imageSmoothingEnabled);
|
|
742
|
-
}
|
|
743
|
-
/**
|
|
744
|
-
* @param {number} r
|
|
745
|
-
* @param {number} g
|
|
746
|
-
* @param {number} b
|
|
747
|
-
* @param {number} a
|
|
748
|
-
* @return {void}
|
|
749
|
-
* @method
|
|
750
|
-
* @public
|
|
751
|
-
*/
|
|
752
|
-
_$setColor(r = 0, g = 0, b = 0, a = 0) {
|
|
753
|
-
this._$clearColorR = r;
|
|
754
|
-
this._$clearColorG = g;
|
|
755
|
-
this._$clearColorB = b;
|
|
756
|
-
this._$clearColorA = a;
|
|
757
|
-
this._$gl.clearColor(r, g, b, a);
|
|
758
|
-
}
|
|
759
|
-
/**
|
|
760
|
-
* @param {number} x
|
|
761
|
-
* @param {number} y
|
|
762
|
-
* @param {number} w
|
|
763
|
-
* @param {number} h
|
|
764
|
-
* @return {void}
|
|
765
|
-
* @method
|
|
766
|
-
* @public
|
|
767
|
-
*/
|
|
768
|
-
clearRect(x, y, w, h) {
|
|
769
|
-
this._$mask._$onClearRect();
|
|
770
|
-
this._$gl.enable(this._$gl.SCISSOR_TEST);
|
|
771
|
-
this._$gl.scissor(x, y, w, h);
|
|
772
|
-
this._$gl.clear(this._$gl.COLOR_BUFFER_BIT | this._$gl.STENCIL_BUFFER_BIT);
|
|
773
|
-
this._$gl.disable(this._$gl.SCISSOR_TEST);
|
|
774
|
-
}
|
|
775
|
-
/**
|
|
776
|
-
* @return {void}
|
|
777
|
-
* @method
|
|
778
|
-
* @public
|
|
779
|
-
*/
|
|
780
|
-
_$clearRectStencil() {
|
|
781
|
-
// stencilを終了
|
|
782
|
-
this._$mask._$onClearRect();
|
|
783
|
-
// マスクの描画領域に限定してstencil情報をクリア
|
|
784
|
-
this._$gl.enable(this._$gl.SCISSOR_TEST);
|
|
785
|
-
this._$gl.scissor(this._$maskBounds.xMin, this._$maskBounds.yMin, this._$maskBounds.xMax, this._$maskBounds.yMax);
|
|
786
|
-
this._$gl.clear(this._$gl.STENCIL_BUFFER_BIT);
|
|
787
|
-
this._$gl.disable(this._$gl.SCISSOR_TEST);
|
|
788
|
-
}
|
|
789
|
-
/**
|
|
790
|
-
* @param {number} x
|
|
791
|
-
* @param {number} y
|
|
792
|
-
* @return {void}
|
|
793
|
-
* @method
|
|
794
|
-
* @public
|
|
795
|
-
*/
|
|
796
|
-
moveTo(x, y) {
|
|
797
|
-
this._$path.moveTo(x, y);
|
|
798
|
-
}
|
|
799
|
-
/**
|
|
800
|
-
* @param {number} x
|
|
801
|
-
* @param {number} y
|
|
802
|
-
* @return {void}
|
|
803
|
-
* @method
|
|
804
|
-
* @public
|
|
805
|
-
*/
|
|
806
|
-
lineTo(x, y) {
|
|
807
|
-
this._$path.lineTo(x, y);
|
|
808
|
-
}
|
|
809
|
-
/**
|
|
810
|
-
* @return {void}
|
|
811
|
-
* @method
|
|
812
|
-
* @public
|
|
813
|
-
*/
|
|
814
|
-
beginPath() {
|
|
815
|
-
this._$path.begin();
|
|
816
|
-
}
|
|
817
|
-
/**
|
|
818
|
-
* @param {number} cx
|
|
819
|
-
* @param {number} cy
|
|
820
|
-
* @param {number} x
|
|
821
|
-
* @param {number} y
|
|
822
|
-
* @return {void}
|
|
823
|
-
* @method
|
|
824
|
-
* @public
|
|
825
|
-
*/
|
|
826
|
-
quadraticCurveTo(cx, cy, x, y) {
|
|
827
|
-
this._$path.quadTo(cx, cy, x, y);
|
|
828
|
-
}
|
|
829
|
-
/**
|
|
830
|
-
* @param {number} cp1x
|
|
831
|
-
* @param {number} cp1y
|
|
832
|
-
* @param {number} cp2x
|
|
833
|
-
* @param {number} cp2y
|
|
834
|
-
* @param {number} dx
|
|
835
|
-
* @param {number} dy
|
|
836
|
-
* @return {void}
|
|
837
|
-
* @method
|
|
838
|
-
* @public
|
|
839
|
-
*/
|
|
840
|
-
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, dx, dy) {
|
|
841
|
-
this._$path.cubicTo(cp1x, cp1y, cp2x, cp2y, dx, dy);
|
|
842
|
-
}
|
|
843
|
-
/**
|
|
844
|
-
* @return {void}
|
|
845
|
-
* @method
|
|
846
|
-
* @public
|
|
847
|
-
*/
|
|
848
|
-
fill() {
|
|
849
|
-
// to triangle
|
|
850
|
-
const fillVertices = this._$path.vertices;
|
|
851
|
-
if (!fillVertices.length) {
|
|
852
|
-
return;
|
|
853
|
-
}
|
|
854
|
-
const checkVertices = $getArray();
|
|
855
|
-
for (let idx = 0; idx < fillVertices.length; ++idx) {
|
|
856
|
-
const vertices = fillVertices[idx];
|
|
857
|
-
if (10 > vertices.length) {
|
|
858
|
-
continue;
|
|
859
|
-
}
|
|
860
|
-
checkVertices.push(vertices);
|
|
861
|
-
}
|
|
862
|
-
if (!checkVertices.length) {
|
|
863
|
-
$poolArray(checkVertices);
|
|
864
|
-
return;
|
|
865
|
-
}
|
|
866
|
-
const fillVertexArrayObject = this._$vao.createFill(checkVertices);
|
|
867
|
-
const fillStyle = this.fillStyle;
|
|
868
|
-
let matrix = this._$matrix;
|
|
869
|
-
let texture;
|
|
870
|
-
let variants;
|
|
871
|
-
let shader;
|
|
872
|
-
const hasGrid = this._$grid.enabled;
|
|
873
|
-
if (fillStyle instanceof CanvasGradientToWebGL) {
|
|
874
|
-
const stops = fillStyle.stops;
|
|
875
|
-
const isLinearSpace = fillStyle.rgb === "linearRGB";
|
|
876
|
-
texture = this
|
|
877
|
-
._$gradientLUT
|
|
878
|
-
.generateForShape(stops, isLinearSpace);
|
|
879
|
-
this
|
|
880
|
-
._$frameBufferManager
|
|
881
|
-
.textureManager
|
|
882
|
-
.bind0(texture, true);
|
|
883
|
-
this
|
|
884
|
-
._$frameBufferManager
|
|
885
|
-
.bindRenderBuffer();
|
|
886
|
-
variants = this
|
|
887
|
-
._$shaderList
|
|
888
|
-
.gradientShapeShaderVariants;
|
|
889
|
-
if (fillStyle.type === "linear") {
|
|
890
|
-
shader = variants
|
|
891
|
-
.getGradientShapeShader(false, hasGrid, false, false, fillStyle.mode);
|
|
892
|
-
variants.setGradientShapeUniform(shader.uniform, false, 0, 0, 0, hasGrid, matrix, $inverseMatrix(this._$matrix), this._$viewportWidth, this._$viewportHeight, this._$grid, false, fillStyle.points, 0);
|
|
893
|
-
}
|
|
894
|
-
else {
|
|
895
|
-
matrix = this._$stack[this._$stack.length - 1];
|
|
896
|
-
const hasFocalPoint = fillStyle.focalPointRatio !== 0;
|
|
897
|
-
shader = variants
|
|
898
|
-
.getGradientShapeShader(false, hasGrid, true, hasFocalPoint, fillStyle.mode);
|
|
899
|
-
variants.setGradientShapeUniform(shader.uniform, false, 0, 0, 0, hasGrid, matrix, $inverseMatrix(this._$matrix), this._$viewportWidth, this._$viewportHeight, this._$grid, true, fillStyle.points, fillStyle.focalPointRatio);
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
else if (fillStyle instanceof CanvasPatternToWebGL) {
|
|
903
|
-
matrix = this._$stack[this._$stack.length - 1];
|
|
904
|
-
const pct = fillStyle.colorTransform;
|
|
905
|
-
texture = fillStyle.texture;
|
|
906
|
-
this
|
|
907
|
-
._$frameBufferManager
|
|
908
|
-
.textureManager
|
|
909
|
-
.bind0(texture, this._$imageSmoothingEnabled);
|
|
910
|
-
variants = this
|
|
911
|
-
._$shaderList
|
|
912
|
-
.shapeShaderVariants;
|
|
913
|
-
shader = variants
|
|
914
|
-
.getBitmapShapeShader(false, fillStyle.repeat, hasGrid);
|
|
915
|
-
if (pct) {
|
|
916
|
-
variants.setBitmapShapeUniform(shader.uniform, false, 0, 0, 0, hasGrid, matrix, $inverseMatrix(this._$matrix), this._$viewportWidth, this._$viewportHeight, this._$grid, texture.width, texture.height, pct[0], pct[1], pct[2], this._$globalAlpha, pct[4] / 255, pct[5] / 255, pct[6] / 255, 0);
|
|
917
|
-
}
|
|
918
|
-
else {
|
|
919
|
-
variants.setBitmapShapeUniform(shader.uniform, false, 0, 0, 0, hasGrid, matrix, $inverseMatrix(this._$matrix), this._$viewportWidth, this._$viewportHeight, this._$grid, texture.width, texture.height, 1, 1, 1, this._$globalAlpha, 0, 0, 0, 0);
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
else {
|
|
923
|
-
variants = this
|
|
924
|
-
._$shaderList
|
|
925
|
-
.shapeShaderVariants;
|
|
926
|
-
shader = variants
|
|
927
|
-
.getSolidColorShapeShader(false, this._$grid.enabled);
|
|
928
|
-
variants.setSolidColorShapeUniform(shader.uniform, false, 0, 0, 0, hasGrid, matrix, this._$viewportWidth, this._$viewportHeight, this._$grid, fillStyle, this._$globalAlpha);
|
|
929
|
-
}
|
|
930
|
-
const coverageVariants = this
|
|
931
|
-
._$shaderList
|
|
932
|
-
.shapeShaderVariants;
|
|
933
|
-
const coverageShader = coverageVariants
|
|
934
|
-
.getMaskShapeShader(false, hasGrid);
|
|
935
|
-
coverageVariants.setMaskShapeUniform(coverageShader.uniform, hasGrid, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8], this._$viewportWidth, this._$viewportHeight, this._$grid);
|
|
936
|
-
// mask on
|
|
937
|
-
this._$gl.enable(this._$gl.STENCIL_TEST);
|
|
938
|
-
this._$gl.stencilMask(0xff);
|
|
939
|
-
// draw shape
|
|
940
|
-
this._$gl.enable(this._$gl.SAMPLE_ALPHA_TO_COVERAGE);
|
|
941
|
-
this._$gl.stencilFunc(this._$gl.ALWAYS, 0, 0xff);
|
|
942
|
-
this._$gl.stencilOp(this._$gl.KEEP, this._$gl.INVERT, this._$gl.INVERT);
|
|
943
|
-
this._$gl.colorMask(false, false, false, false);
|
|
944
|
-
coverageShader._$fill(fillVertexArrayObject);
|
|
945
|
-
this._$gl.disable(this._$gl.SAMPLE_ALPHA_TO_COVERAGE);
|
|
946
|
-
// draw shape range
|
|
947
|
-
this._$gl.stencilFunc(this._$gl.NOTEQUAL, 0, 0xff);
|
|
948
|
-
this._$gl.stencilOp(this._$gl.KEEP, this._$gl.ZERO, this._$gl.ZERO);
|
|
949
|
-
this._$gl.colorMask(true, true, true, true);
|
|
950
|
-
shader._$fill(fillVertexArrayObject);
|
|
951
|
-
// mask off
|
|
952
|
-
this._$gl.disable(this._$gl.STENCIL_TEST);
|
|
953
|
-
// release vertex array
|
|
954
|
-
this.releaseFillVertexArray(fillVertexArrayObject);
|
|
955
|
-
}
|
|
956
|
-
/**
|
|
957
|
-
* @param {WebGLVertexArrayObject} vertex_array
|
|
958
|
-
* @return {void}
|
|
959
|
-
* @method
|
|
960
|
-
* @public
|
|
961
|
-
*/
|
|
962
|
-
releaseFillVertexArray(vertex_array) {
|
|
963
|
-
// release shape vertex array object
|
|
964
|
-
this._$vao.releaseFill(vertex_array);
|
|
965
|
-
const indexRanges = vertex_array.indexRanges;
|
|
966
|
-
for (let idx = 0; idx < indexRanges.length; ++idx) {
|
|
967
|
-
WebGLFillMeshGenerator
|
|
968
|
-
.indexRangePool
|
|
969
|
-
.push(indexRanges[idx]);
|
|
970
|
-
}
|
|
971
|
-
$poolArray(indexRanges);
|
|
972
|
-
}
|
|
973
|
-
/**
|
|
974
|
-
* @return {void}
|
|
975
|
-
* @method
|
|
976
|
-
* @public
|
|
977
|
-
*/
|
|
978
|
-
_$enterClip() {
|
|
979
|
-
this._$mask._$enterClip();
|
|
980
|
-
}
|
|
981
|
-
/**
|
|
982
|
-
* @return {void}
|
|
983
|
-
* @method
|
|
984
|
-
* @public
|
|
985
|
-
*/
|
|
986
|
-
_$beginClipDef() {
|
|
987
|
-
this._$mask._$beginClipDef();
|
|
988
|
-
}
|
|
989
|
-
/**
|
|
990
|
-
* @param {boolean} flag
|
|
991
|
-
* @return {void}
|
|
992
|
-
* @method
|
|
993
|
-
* @private
|
|
994
|
-
*/
|
|
995
|
-
_$updateContainerClipFlag(flag) {
|
|
996
|
-
this._$mask.containerClip = flag;
|
|
997
|
-
}
|
|
998
|
-
/**
|
|
999
|
-
* @description マスク処理の開始関数
|
|
1000
|
-
* Mask processing start function
|
|
1001
|
-
*
|
|
1002
|
-
* @param {object} bounds
|
|
1003
|
-
* @return {void}
|
|
1004
|
-
* @method
|
|
1005
|
-
* @public
|
|
1006
|
-
*/
|
|
1007
|
-
_$startClip(bounds) {
|
|
1008
|
-
const x = bounds.xMin;
|
|
1009
|
-
const y = bounds.yMin;
|
|
1010
|
-
const width = Math.abs(bounds.xMax - bounds.xMin);
|
|
1011
|
-
const height = Math.abs(bounds.yMax - bounds.yMin);
|
|
1012
|
-
// resize
|
|
1013
|
-
const manager = this._$frameBufferManager;
|
|
1014
|
-
const currentAttachment = manager.currentAttachment;
|
|
1015
|
-
if (!currentAttachment) {
|
|
1016
|
-
throw new Error("the current Attachment is null.");
|
|
1017
|
-
}
|
|
1018
|
-
if (x > currentAttachment.width
|
|
1019
|
-
|| y > currentAttachment.height) {
|
|
1020
|
-
return false;
|
|
1021
|
-
}
|
|
1022
|
-
if (0 > x && 0 >= width + x) {
|
|
1023
|
-
return false;
|
|
1024
|
-
}
|
|
1025
|
-
if (0 > y && 0 >= height + y) {
|
|
1026
|
-
return false;
|
|
1027
|
-
}
|
|
1028
|
-
this._$maskBounds.xMin = $Math.max(0, $Math.min(this._$maskBounds.xMin, x));
|
|
1029
|
-
this._$maskBounds.yMin = $Math.max(0, $Math.min(this._$maskBounds.yMin, y));
|
|
1030
|
-
this._$maskBounds.xMax = $Math.min(currentAttachment.width, $Math.min(this._$maskBounds.xMax, width));
|
|
1031
|
-
this._$maskBounds.yMax = $Math.min(currentAttachment.height, $Math.min(this._$maskBounds.yMax, height));
|
|
1032
|
-
return true;
|
|
1033
|
-
}
|
|
1034
|
-
/**
|
|
1035
|
-
* @return {void}
|
|
1036
|
-
* @method
|
|
1037
|
-
* @public
|
|
1038
|
-
*/
|
|
1039
|
-
_$endClipDef() {
|
|
1040
|
-
this._$mask._$endClipDef();
|
|
1041
|
-
}
|
|
1042
|
-
/**
|
|
1043
|
-
* @return {void}
|
|
1044
|
-
* @method
|
|
1045
|
-
* @public
|
|
1046
|
-
*/
|
|
1047
|
-
_$leaveClip() {
|
|
1048
|
-
this.drawInstacedArray();
|
|
1049
|
-
this._$mask._$leaveClip();
|
|
1050
|
-
}
|
|
1051
|
-
/**
|
|
1052
|
-
* @return {void}
|
|
1053
|
-
* @method
|
|
1054
|
-
* @public
|
|
1055
|
-
*/
|
|
1056
|
-
_$drawContainerClip() {
|
|
1057
|
-
this._$mask._$drawContainerClip();
|
|
1058
|
-
}
|
|
1059
|
-
/**
|
|
1060
|
-
* @return {void}
|
|
1061
|
-
* @method
|
|
1062
|
-
* @public
|
|
1063
|
-
*/
|
|
1064
|
-
closePath() {
|
|
1065
|
-
this._$path.close();
|
|
1066
|
-
}
|
|
1067
|
-
/**
|
|
1068
|
-
* @return {void}
|
|
1069
|
-
* @method
|
|
1070
|
-
* @public
|
|
1071
|
-
*/
|
|
1072
|
-
stroke() {
|
|
1073
|
-
const strokeVertices = this._$path.vertices;
|
|
1074
|
-
if (!strokeVertices.length) {
|
|
1075
|
-
return;
|
|
1076
|
-
}
|
|
1077
|
-
const checkVertices = $getArray();
|
|
1078
|
-
for (let idx = 0; idx < strokeVertices.length; ++idx) {
|
|
1079
|
-
const vertices = strokeVertices[idx];
|
|
1080
|
-
if (6 > vertices.length) {
|
|
1081
|
-
continue;
|
|
1082
|
-
}
|
|
1083
|
-
checkVertices.push(vertices);
|
|
1084
|
-
}
|
|
1085
|
-
if (!checkVertices.length) {
|
|
1086
|
-
$poolArray(checkVertices);
|
|
1087
|
-
return;
|
|
1088
|
-
}
|
|
1089
|
-
const strokeBuffer = this._$vao.createStroke(strokeVertices, this.lineCap, this.lineJoin);
|
|
1090
|
-
let matrix = this._$matrix;
|
|
1091
|
-
const strokeStyle = this.strokeStyle;
|
|
1092
|
-
let face = $Math.sign(matrix[0] * matrix[4]);
|
|
1093
|
-
if (face > 0 && matrix[1] !== 0 && matrix[3] !== 0) {
|
|
1094
|
-
face = -$Math.sign(matrix[1] * matrix[3]);
|
|
1095
|
-
}
|
|
1096
|
-
let lineWidth = this.lineWidth * 0.5;
|
|
1097
|
-
let scaleX;
|
|
1098
|
-
let scaleY;
|
|
1099
|
-
if (this._$grid.enabled) {
|
|
1100
|
-
// lineWidth *= $getSameScaleBase();
|
|
1101
|
-
scaleX = $Math.abs(this._$grid.ancestorMatrixA + this._$grid.ancestorMatrixD);
|
|
1102
|
-
scaleY = $Math.abs(this._$grid.ancestorMatrixB + this._$grid.ancestorMatrixE);
|
|
1103
|
-
}
|
|
1104
|
-
else {
|
|
1105
|
-
scaleX = $Math.abs(matrix[0] + matrix[3]);
|
|
1106
|
-
scaleY = $Math.abs(matrix[1] + matrix[4]);
|
|
1107
|
-
}
|
|
1108
|
-
const scaleMin = $Math.min(scaleX, scaleY);
|
|
1109
|
-
const scaleMax = $Math.max(scaleX, scaleY);
|
|
1110
|
-
lineWidth *= scaleMax * (1 - 0.3 * $Math.cos($Math.PI * 0.5 * (scaleMin / scaleMax)));
|
|
1111
|
-
lineWidth = $Math.max(1, lineWidth);
|
|
1112
|
-
const hasGrid = this._$grid.enabled;
|
|
1113
|
-
let texture;
|
|
1114
|
-
let variants;
|
|
1115
|
-
let shader;
|
|
1116
|
-
if (strokeStyle instanceof CanvasGradientToWebGL) {
|
|
1117
|
-
if (strokeStyle.type === "radial") {
|
|
1118
|
-
matrix = this._$stack[this._$stack.length - 1];
|
|
1119
|
-
}
|
|
1120
|
-
const stops = strokeStyle.stops;
|
|
1121
|
-
const isLinearSpace = strokeStyle.rgb === "linearRGB";
|
|
1122
|
-
texture = this
|
|
1123
|
-
._$gradientLUT
|
|
1124
|
-
.generateForShape(stops, isLinearSpace);
|
|
1125
|
-
this
|
|
1126
|
-
._$frameBufferManager
|
|
1127
|
-
.textureManager
|
|
1128
|
-
.bind0(texture, true);
|
|
1129
|
-
variants = this
|
|
1130
|
-
._$shaderList
|
|
1131
|
-
.gradientShapeShaderVariants;
|
|
1132
|
-
if (strokeStyle.type === "linear") {
|
|
1133
|
-
shader = variants
|
|
1134
|
-
.getGradientShapeShader(true, hasGrid, false, false, strokeStyle.mode);
|
|
1135
|
-
variants.setGradientShapeUniform(shader.uniform, true, lineWidth, face, this.miterLimit, hasGrid, matrix, $inverseMatrix(this._$matrix), this._$viewportWidth, this._$viewportHeight, this._$grid, false, strokeStyle.points, 0);
|
|
1136
|
-
}
|
|
1137
|
-
else {
|
|
1138
|
-
matrix = this._$stack[this._$stack.length - 1];
|
|
1139
|
-
const hasFocalPoint = strokeStyle.focalPointRatio !== 0;
|
|
1140
|
-
shader = variants
|
|
1141
|
-
.getGradientShapeShader(true, hasGrid, true, hasFocalPoint, strokeStyle.mode);
|
|
1142
|
-
variants.setGradientShapeUniform(shader.uniform, true, lineWidth, face, this.miterLimit, hasGrid, matrix, $inverseMatrix(this._$matrix), this._$viewportWidth, this._$viewportHeight, this._$grid, true, strokeStyle.points, strokeStyle.focalPointRatio);
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
else if (strokeStyle instanceof CanvasPatternToWebGL) {
|
|
1146
|
-
matrix = this._$stack[this._$stack.length - 1];
|
|
1147
|
-
const pct = strokeStyle.colorTransform;
|
|
1148
|
-
texture = strokeStyle.texture;
|
|
1149
|
-
this
|
|
1150
|
-
._$frameBufferManager
|
|
1151
|
-
.textureManager
|
|
1152
|
-
.bind0(texture);
|
|
1153
|
-
variants = this
|
|
1154
|
-
._$shaderList
|
|
1155
|
-
.shapeShaderVariants;
|
|
1156
|
-
shader = variants
|
|
1157
|
-
.getBitmapShapeShader(true, strokeStyle.repeat, this._$grid.enabled);
|
|
1158
|
-
if (pct) {
|
|
1159
|
-
variants.setBitmapShapeUniform(shader.uniform, true, lineWidth, face, this.miterLimit, hasGrid, matrix, $inverseMatrix(this._$matrix), this._$viewportWidth, this._$viewportHeight, this._$grid, texture.width, texture.height, pct[0], pct[1], pct[2], this._$globalAlpha, pct[4] / 255, pct[5] / 255, pct[6] / 255, 0);
|
|
1160
|
-
}
|
|
1161
|
-
else {
|
|
1162
|
-
variants.setBitmapShapeUniform(shader.uniform, true, lineWidth, face, this.miterLimit, hasGrid, matrix, $inverseMatrix(this._$matrix), this._$viewportWidth, this._$viewportHeight, this._$grid, texture.width, texture.height, 1, 1, 1, this._$globalAlpha, 0, 0, 0, 0);
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
else {
|
|
1166
|
-
variants = this
|
|
1167
|
-
._$shaderList
|
|
1168
|
-
.shapeShaderVariants;
|
|
1169
|
-
shader = variants
|
|
1170
|
-
.getSolidColorShapeShader(true, this._$grid.enabled);
|
|
1171
|
-
variants.setSolidColorShapeUniform(shader.uniform, true, lineWidth, face, this.miterLimit, hasGrid, matrix, this._$viewportWidth, this._$viewportHeight, this._$grid, strokeStyle, this._$globalAlpha);
|
|
1172
|
-
}
|
|
1173
|
-
shader._$stroke(strokeBuffer);
|
|
1174
|
-
this._$vao.releaseStroke(strokeBuffer);
|
|
1175
|
-
}
|
|
1176
|
-
/**
|
|
1177
|
-
* @param {number} x
|
|
1178
|
-
* @param {number} y
|
|
1179
|
-
* @param {number} radius
|
|
1180
|
-
* @return {void}
|
|
1181
|
-
* @method
|
|
1182
|
-
* @public
|
|
1183
|
-
*/
|
|
1184
|
-
arc(x, y, radius) {
|
|
1185
|
-
this._$path.drawCircle(x, y, radius);
|
|
1186
|
-
}
|
|
1187
|
-
/**
|
|
1188
|
-
* @return {void}
|
|
1189
|
-
* @method
|
|
1190
|
-
* @public
|
|
1191
|
-
*/
|
|
1192
|
-
clip() {
|
|
1193
|
-
// to triangle
|
|
1194
|
-
const fillVertices = this._$path.vertices;
|
|
1195
|
-
if (!fillVertices.length) {
|
|
1196
|
-
return;
|
|
1197
|
-
}
|
|
1198
|
-
const checkVertices = $getArray();
|
|
1199
|
-
for (let idx = 0; idx < fillVertices.length; ++idx) {
|
|
1200
|
-
const vertices = fillVertices[idx];
|
|
1201
|
-
if (10 > vertices.length) {
|
|
1202
|
-
continue;
|
|
1203
|
-
}
|
|
1204
|
-
checkVertices.push(vertices);
|
|
1205
|
-
}
|
|
1206
|
-
if (!checkVertices.length) {
|
|
1207
|
-
$poolArray(checkVertices);
|
|
1208
|
-
return;
|
|
1209
|
-
}
|
|
1210
|
-
const fillVertexArrayObject = this._$vao.createFill(checkVertices);
|
|
1211
|
-
// mask render
|
|
1212
|
-
const variants = this
|
|
1213
|
-
._$shaderList
|
|
1214
|
-
.shapeShaderVariants;
|
|
1215
|
-
const shader = variants.getMaskShapeShader(false, false);
|
|
1216
|
-
const uniform = shader.uniform;
|
|
1217
|
-
variants.setMaskShapeUniform(uniform, false, this._$matrix[0], this._$matrix[1], this._$matrix[2], this._$matrix[3], this._$matrix[4], this._$matrix[5], this._$matrix[6], this._$matrix[7], this._$matrix[8], this._$viewportWidth, this._$viewportHeight, null);
|
|
1218
|
-
if (this._$mask._$onClip(fillVertexArrayObject, this._$matrix, this._$viewportWidth, this._$viewportHeight)) {
|
|
1219
|
-
return;
|
|
1220
|
-
}
|
|
1221
|
-
shader._$fill(fillVertexArrayObject);
|
|
1222
|
-
this.beginPath();
|
|
1223
|
-
}
|
|
1224
|
-
/**
|
|
1225
|
-
* @return {void}
|
|
1226
|
-
* @method
|
|
1227
|
-
* @public
|
|
1228
|
-
*/
|
|
1229
|
-
save() {
|
|
1230
|
-
// matrix
|
|
1231
|
-
const matrix = this._$matrix;
|
|
1232
|
-
this._$stack.push($getFloat32Array9(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]));
|
|
1233
|
-
// mask
|
|
1234
|
-
this._$mask._$onSave();
|
|
1235
|
-
}
|
|
1236
|
-
/**
|
|
1237
|
-
* @return {void}
|
|
1238
|
-
* @method
|
|
1239
|
-
* @public
|
|
1240
|
-
*/
|
|
1241
|
-
restore() {
|
|
1242
|
-
//matrix
|
|
1243
|
-
if (this._$stack.length) {
|
|
1244
|
-
$poolFloat32Array9(this._$matrix);
|
|
1245
|
-
this._$matrix = this._$stack.pop() || $getFloat32Array9();
|
|
1246
|
-
}
|
|
1247
|
-
// mask
|
|
1248
|
-
this._$mask._$onRestore();
|
|
1249
|
-
}
|
|
1250
|
-
/**
|
|
1251
|
-
* @param {WebGLTexture} texture
|
|
1252
|
-
* @param {boolean} repeat
|
|
1253
|
-
* @param {Float32Array} color_transform
|
|
1254
|
-
* @return {CanvasPatternToWebGL}
|
|
1255
|
-
* @method
|
|
1256
|
-
* @public
|
|
1257
|
-
*/
|
|
1258
|
-
createPattern(texture, repeat, color_transform) {
|
|
1259
|
-
return new CanvasPatternToWebGL(texture, repeat, color_transform);
|
|
1260
|
-
}
|
|
1261
|
-
/**
|
|
1262
|
-
* @param {number} x0
|
|
1263
|
-
* @param {number} y0
|
|
1264
|
-
* @param {number} x1
|
|
1265
|
-
* @param {number} y1
|
|
1266
|
-
* @param {string} [rgb=InterpolationMethod.RGB]
|
|
1267
|
-
* @param {string} [mode=SpreadMethod.PAD]
|
|
1268
|
-
* @return {CanvasGradientToWebGL}
|
|
1269
|
-
* @method
|
|
1270
|
-
* @public
|
|
1271
|
-
*/
|
|
1272
|
-
createLinearGradient(x0, y0, x1, y1, rgb = "rgb", mode = "pad") {
|
|
1273
|
-
return new CanvasGradientToWebGL()
|
|
1274
|
-
.linear(x0, y0, x1, y1, rgb, mode);
|
|
1275
|
-
}
|
|
1276
|
-
/**
|
|
1277
|
-
* @param {number} x0
|
|
1278
|
-
* @param {number} y0
|
|
1279
|
-
* @param {number} r0
|
|
1280
|
-
* @param {number} x1
|
|
1281
|
-
* @param {number} y1
|
|
1282
|
-
* @param {number} r1
|
|
1283
|
-
* @param {string} [rgb=InterpolationMethod.RGB]
|
|
1284
|
-
* @param {string} [mode=SpreadMethod.PAD]
|
|
1285
|
-
* @param {number} [focal_point_ratio=0]
|
|
1286
|
-
* @return {CanvasGradientToWebGL}
|
|
1287
|
-
* @method
|
|
1288
|
-
* @public
|
|
1289
|
-
*/
|
|
1290
|
-
createRadialGradient(x0, y0, r0, x1, y1, r1, rgb = "rgb", mode = "pad", focal_point_ratio = 0) {
|
|
1291
|
-
return new CanvasGradientToWebGL()
|
|
1292
|
-
.radial(x0, y0, r0, x1, y1, r1, rgb, mode, focal_point_ratio);
|
|
1293
|
-
}
|
|
1294
|
-
/**
|
|
1295
|
-
* @param {WebGLTexture} texture
|
|
1296
|
-
* @param {boolean} is_horizontal
|
|
1297
|
-
* @param {number} blur
|
|
1298
|
-
* @return {void}
|
|
1299
|
-
* @method
|
|
1300
|
-
* @public
|
|
1301
|
-
*/
|
|
1302
|
-
_$applyBlurFilter(texture, is_horizontal, blur) {
|
|
1303
|
-
const manager = this._$frameBufferManager;
|
|
1304
|
-
const currentAttachment = manager.currentAttachment;
|
|
1305
|
-
if (!currentAttachment) {
|
|
1306
|
-
throw new Error("the current attachment is null.");
|
|
1307
|
-
}
|
|
1308
|
-
const width = currentAttachment.width;
|
|
1309
|
-
const height = currentAttachment.height;
|
|
1310
|
-
manager
|
|
1311
|
-
.textureManager
|
|
1312
|
-
.bind0(texture, true);
|
|
1313
|
-
const halfBlur = $Math.ceil(blur * 0.5);
|
|
1314
|
-
const fraction = 1 - (halfBlur - blur * 0.5);
|
|
1315
|
-
const samples = 1 + blur;
|
|
1316
|
-
const variants = this
|
|
1317
|
-
._$shaderList
|
|
1318
|
-
.filterShaderVariants;
|
|
1319
|
-
const shader = variants
|
|
1320
|
-
.getBlurFilterShader(halfBlur);
|
|
1321
|
-
variants
|
|
1322
|
-
.setBlurFilterUniform(shader.uniform, width, height, is_horizontal, fraction, samples);
|
|
1323
|
-
shader._$drawImage();
|
|
1324
|
-
}
|
|
1325
|
-
/**
|
|
1326
|
-
* @param {WebGLTexture} texture
|
|
1327
|
-
* @param {number} width
|
|
1328
|
-
* @param {number} height
|
|
1329
|
-
* @param {number} base_width
|
|
1330
|
-
* @param {number} base_height
|
|
1331
|
-
* @param {number} base_offset_x
|
|
1332
|
-
* @param {number} base_offset_y
|
|
1333
|
-
* @param {number} blur_width
|
|
1334
|
-
* @param {number} blur_height
|
|
1335
|
-
* @param {number} blur_offset_x
|
|
1336
|
-
* @param {number} blur_offset_y
|
|
1337
|
-
* @param {boolean} is_glow
|
|
1338
|
-
* @param {string} type
|
|
1339
|
-
* @param {boolean} knockout
|
|
1340
|
-
* @param {number} strength
|
|
1341
|
-
* @param {array | null} [ratios = null]
|
|
1342
|
-
* @param {array | null} [colors = null]
|
|
1343
|
-
* @param {array | null} [alphas = null]
|
|
1344
|
-
* @param {number} [color_r1 = 0]
|
|
1345
|
-
* @param {number} [color_g1 = 0]
|
|
1346
|
-
* @param {number} [color_b1 = 0]
|
|
1347
|
-
* @param {number} [color_a1 = 0]
|
|
1348
|
-
* @param {number} [color_r2 = 0]
|
|
1349
|
-
* @param {number} [color_g2 = 0]
|
|
1350
|
-
* @param {number} [color_b2 = 0]
|
|
1351
|
-
* @param {number} [color_a2 = 0]
|
|
1352
|
-
* @return {void}
|
|
1353
|
-
* @method
|
|
1354
|
-
* @public
|
|
1355
|
-
*/
|
|
1356
|
-
_$applyBitmapFilter(texture, width, height, base_width, base_height, base_offset_x, base_offset_y, blur_width, blur_height, blur_offset_x, blur_offset_y, is_glow, type, knockout, strength, ratios = null, colors = null, alphas = null, color_r1 = 0, color_g1 = 0, color_b1 = 0, color_a1 = 0, color_r2 = 0, color_g2 = 0, color_b2 = 0, color_a2 = 0) {
|
|
1357
|
-
const manager = this._$frameBufferManager;
|
|
1358
|
-
const isInner = type === "inner";
|
|
1359
|
-
const baseAttachment = manager.currentAttachment;
|
|
1360
|
-
const baseTexture = manager.getTextureFromCurrentAttachment();
|
|
1361
|
-
let lut = null;
|
|
1362
|
-
const isGradient = ratios !== null && colors !== null && alphas !== null;
|
|
1363
|
-
if (ratios !== null && colors !== null && alphas !== null) {
|
|
1364
|
-
lut = this
|
|
1365
|
-
._$gradientLUT
|
|
1366
|
-
.generateForFilter(ratios, colors, alphas);
|
|
1367
|
-
}
|
|
1368
|
-
let targetTextureAttachment;
|
|
1369
|
-
if (isInner) {
|
|
1370
|
-
if (isGradient && lut) {
|
|
1371
|
-
manager
|
|
1372
|
-
.textureManager
|
|
1373
|
-
.bind02(texture, lut, true);
|
|
1374
|
-
}
|
|
1375
|
-
else {
|
|
1376
|
-
manager
|
|
1377
|
-
.textureManager
|
|
1378
|
-
.bind0(texture);
|
|
1379
|
-
}
|
|
1380
|
-
}
|
|
1381
|
-
else {
|
|
1382
|
-
targetTextureAttachment = this
|
|
1383
|
-
._$frameBufferManager
|
|
1384
|
-
.createTextureAttachment(width, height);
|
|
1385
|
-
this._$bind(targetTextureAttachment);
|
|
1386
|
-
if (isGradient && lut) {
|
|
1387
|
-
manager
|
|
1388
|
-
.textureManager
|
|
1389
|
-
.bind012(texture, baseTexture, lut, true);
|
|
1390
|
-
}
|
|
1391
|
-
else {
|
|
1392
|
-
manager
|
|
1393
|
-
.textureManager
|
|
1394
|
-
.bind01(texture, baseTexture);
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
const transformsBase = !(isInner || type === "full" && knockout);
|
|
1398
|
-
const transformsBlur = !(width === blur_width && height === blur_height && blur_offset_x === 0 && blur_offset_y === 0);
|
|
1399
|
-
const appliesStrength = !(strength === 1);
|
|
1400
|
-
const variants = this
|
|
1401
|
-
._$shaderList
|
|
1402
|
-
.filterShaderVariants;
|
|
1403
|
-
const shader = variants.getBitmapFilterShader(transformsBase, transformsBlur, is_glow, type, knockout, appliesStrength, isGradient);
|
|
1404
|
-
variants.setBitmapFilterUniform(shader.uniform, width, height, base_width, base_height, base_offset_x, base_offset_y, blur_width, blur_height, blur_offset_x, blur_offset_y, is_glow, strength, color_r1, color_g1, color_b1, color_a1, color_r2, color_g2, color_b2, color_a2, transformsBase, transformsBlur, appliesStrength, isGradient);
|
|
1405
|
-
if (!isInner) {
|
|
1406
|
-
this._$blend.toOneZero();
|
|
1407
|
-
}
|
|
1408
|
-
else if (knockout) {
|
|
1409
|
-
this._$blend.toSourceIn();
|
|
1410
|
-
}
|
|
1411
|
-
else {
|
|
1412
|
-
this._$blend.toSourceAtop();
|
|
1413
|
-
}
|
|
1414
|
-
shader._$drawImage();
|
|
1415
|
-
if (!isInner) {
|
|
1416
|
-
manager
|
|
1417
|
-
.releaseAttachment(baseAttachment, true);
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
/**
|
|
1421
|
-
* @param {WebGLTexture} texture
|
|
1422
|
-
* @param {array} matrix
|
|
1423
|
-
* @return {void}
|
|
1424
|
-
* @method
|
|
1425
|
-
* @public
|
|
1426
|
-
*/
|
|
1427
|
-
_$applyColorMatrixFilter(texture, matrix) {
|
|
1428
|
-
this
|
|
1429
|
-
._$frameBufferManager
|
|
1430
|
-
.textureManager
|
|
1431
|
-
.bind0(texture, true);
|
|
1432
|
-
const variants = this
|
|
1433
|
-
._$shaderList
|
|
1434
|
-
.filterShaderVariants;
|
|
1435
|
-
const shader = variants
|
|
1436
|
-
.getColorMatrixFilterShader();
|
|
1437
|
-
variants
|
|
1438
|
-
.setColorMatrixFilterUniform(shader.uniform, matrix);
|
|
1439
|
-
this._$blend.reset();
|
|
1440
|
-
shader._$drawImage();
|
|
1441
|
-
}
|
|
1442
|
-
/**
|
|
1443
|
-
* @param {WebGLTexture} texture
|
|
1444
|
-
* @param {number} matrix_x
|
|
1445
|
-
* @param {number} matrix_y
|
|
1446
|
-
* @param {Float32Array} matrix
|
|
1447
|
-
* @param {number} divisor
|
|
1448
|
-
* @param {number} bias
|
|
1449
|
-
* @param {boolean} preserve_alpha
|
|
1450
|
-
* @param {boolean} clamp
|
|
1451
|
-
* @param {number} color_r
|
|
1452
|
-
* @param {number} color_g
|
|
1453
|
-
* @param {number} color_b
|
|
1454
|
-
* @param {number} color_a
|
|
1455
|
-
* @return {void}
|
|
1456
|
-
* @method
|
|
1457
|
-
* @public
|
|
1458
|
-
*/
|
|
1459
|
-
_$applyConvolutionFilter(texture, matrix_x, matrix_y, matrix, divisor, bias, preserve_alpha, clamp, color_r, color_g, color_b, color_a) {
|
|
1460
|
-
const width = texture.width;
|
|
1461
|
-
const height = texture.height;
|
|
1462
|
-
const targetTextureAttachment = this
|
|
1463
|
-
._$frameBufferManager
|
|
1464
|
-
.createTextureAttachment(width, height);
|
|
1465
|
-
this._$bind(targetTextureAttachment);
|
|
1466
|
-
this
|
|
1467
|
-
._$frameBufferManager
|
|
1468
|
-
.textureManager
|
|
1469
|
-
.bind0(texture, true);
|
|
1470
|
-
const variants = this
|
|
1471
|
-
._$shaderList
|
|
1472
|
-
.filterShaderVariants;
|
|
1473
|
-
const shader = variants
|
|
1474
|
-
.getConvolutionFilterShader(matrix_x, matrix_y, preserve_alpha, clamp);
|
|
1475
|
-
variants.setConvolutionFilterUniform(shader.uniform, width, height, matrix, divisor, bias, clamp, color_r, color_g, color_b, color_a);
|
|
1476
|
-
this._$blend.reset();
|
|
1477
|
-
shader._$drawImage();
|
|
1478
|
-
}
|
|
1479
|
-
/**
|
|
1480
|
-
* @param {WebGLTexture} texture
|
|
1481
|
-
* @param {HTMLImageElement} map
|
|
1482
|
-
* @param {number} base_width
|
|
1483
|
-
* @param {number} base_height
|
|
1484
|
-
* @param {PointImpl} [point=null]
|
|
1485
|
-
* @param {number} component_x
|
|
1486
|
-
* @param {number} component_y
|
|
1487
|
-
* @param {number} scale_x
|
|
1488
|
-
* @param {number} scale_y
|
|
1489
|
-
* @param {string} mode
|
|
1490
|
-
* @param {number} color_r
|
|
1491
|
-
* @param {number} color_g
|
|
1492
|
-
* @param {number} color_b
|
|
1493
|
-
* @param {number} color_a
|
|
1494
|
-
* @return {void}
|
|
1495
|
-
* @method
|
|
1496
|
-
* @private
|
|
1497
|
-
*/
|
|
1498
|
-
_$applyDisplacementMapFilter(texture, map, base_width, base_height, point, component_x, component_y, scale_x, scale_y, mode, color_r, color_g, color_b, color_a) {
|
|
1499
|
-
const width = texture.width;
|
|
1500
|
-
const height = texture.height;
|
|
1501
|
-
const targetTextureAttachment = this
|
|
1502
|
-
._$frameBufferManager
|
|
1503
|
-
.createTextureAttachment(width, height);
|
|
1504
|
-
this._$bind(targetTextureAttachment);
|
|
1505
|
-
if (!point) {
|
|
1506
|
-
point = { "x": 0, "y": 0 };
|
|
1507
|
-
}
|
|
1508
|
-
const mapTexture = this
|
|
1509
|
-
._$frameBufferManager
|
|
1510
|
-
.createTextureFromImage(map);
|
|
1511
|
-
this
|
|
1512
|
-
._$frameBufferManager
|
|
1513
|
-
.textureManager
|
|
1514
|
-
.bind01(texture, mapTexture);
|
|
1515
|
-
const variants = this
|
|
1516
|
-
._$shaderList
|
|
1517
|
-
.filterShaderVariants;
|
|
1518
|
-
const shader = variants
|
|
1519
|
-
.getDisplacementMapFilterShader(component_x, component_y, mode);
|
|
1520
|
-
variants.setDisplacementMapFilterUniform(shader.uniform, map.width, map.height, base_width, base_height, point.x, point.y, scale_x, scale_y, mode, color_r, color_g, color_b, color_a);
|
|
1521
|
-
this._$blend.reset();
|
|
1522
|
-
shader._$drawImage();
|
|
1523
|
-
this
|
|
1524
|
-
._$frameBufferManager
|
|
1525
|
-
.releaseTexture(mapTexture);
|
|
1526
|
-
}
|
|
1527
|
-
/**
|
|
1528
|
-
* @param {BoundsImpl} position
|
|
1529
|
-
* @return {void}
|
|
1530
|
-
* @method
|
|
1531
|
-
* @private
|
|
1532
|
-
*/
|
|
1533
|
-
_$startLayer(position) {
|
|
1534
|
-
this._$positions.push(position);
|
|
1535
|
-
this._$blends.push(this._$isLayer);
|
|
1536
|
-
this._$isLayer = true;
|
|
1537
|
-
}
|
|
1538
|
-
/**
|
|
1539
|
-
* @return {void}
|
|
1540
|
-
* @method
|
|
1541
|
-
* @private
|
|
1542
|
-
*/
|
|
1543
|
-
_$endLayer() {
|
|
1544
|
-
const bounds = this._$positions.pop();
|
|
1545
|
-
if (bounds) {
|
|
1546
|
-
$poolBoundsObject(bounds);
|
|
1547
|
-
}
|
|
1548
|
-
this._$isLayer = !!this._$blends.pop();
|
|
1549
|
-
}
|
|
1550
|
-
/**
|
|
1551
|
-
* @param {number} width
|
|
1552
|
-
* @param {number} height
|
|
1553
|
-
* @param {boolean} [multisample=false]
|
|
1554
|
-
* @return {void}
|
|
1555
|
-
* @method
|
|
1556
|
-
* @private
|
|
1557
|
-
*/
|
|
1558
|
-
_$saveAttachment(width, height, multisample = false) {
|
|
1559
|
-
this.drawInstacedArray();
|
|
1560
|
-
const manager = this._$frameBufferManager;
|
|
1561
|
-
this
|
|
1562
|
-
._$attachmentArray
|
|
1563
|
-
.push(manager.currentAttachment);
|
|
1564
|
-
this._$bind(manager.createCacheAttachment(width, height, multisample));
|
|
1565
|
-
}
|
|
1566
|
-
/**
|
|
1567
|
-
* @param {boolean} [release_texture = false]
|
|
1568
|
-
* @return {void}
|
|
1569
|
-
* @method
|
|
1570
|
-
* @private
|
|
1571
|
-
*/
|
|
1572
|
-
_$restoreAttachment(release_texture = false) {
|
|
1573
|
-
const manager = this._$frameBufferManager;
|
|
1574
|
-
manager.releaseAttachment(manager.currentAttachment, release_texture);
|
|
1575
|
-
this._$bind(this._$attachmentArray.pop());
|
|
1576
|
-
}
|
|
1577
|
-
/**
|
|
1578
|
-
* @return {object}
|
|
1579
|
-
* @method
|
|
1580
|
-
* @private
|
|
1581
|
-
*/
|
|
1582
|
-
getCurrentPosition() {
|
|
1583
|
-
return this._$positions[this._$positions.length - 1];
|
|
1584
|
-
}
|
|
1585
|
-
/**
|
|
1586
|
-
* @description 最大テクスチャサイズを超えないスケール値を取得する
|
|
1587
|
-
* @param {number} width
|
|
1588
|
-
* @param {number} height
|
|
1589
|
-
* @return {number}
|
|
1590
|
-
* @method
|
|
1591
|
-
* @public
|
|
1592
|
-
*/
|
|
1593
|
-
textureScale(width, height) {
|
|
1594
|
-
const maxSize = $Math.max(width, height);
|
|
1595
|
-
if (maxSize > this._$maxTextureSize) {
|
|
1596
|
-
return this._$maxTextureSize / maxSize;
|
|
1597
|
-
}
|
|
1598
|
-
return 1;
|
|
1599
|
-
}
|
|
1600
|
-
}
|