@next2d/player 1.14.19 → 1.14.21
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/index.js +3 -3
- package/package.json +31 -6
- package/interface/AjaxEventImpl.d.ts +0 -5
- package/interface/AjaxEventImpl.js +0 -1
- package/interface/AjaxOptionImpl.d.ts +0 -13
- package/interface/AjaxOptionImpl.js +0 -1
- package/interface/AttachmentImpl.d.ts +0 -11
- package/interface/AttachmentImpl.js +0 -1
- package/interface/BitmapDataChannelImpl.d.ts +0 -1
- package/interface/BitmapDataChannelImpl.js +0 -1
- package/interface/BitmapDrawObjectImpl.d.ts +0 -6
- package/interface/BitmapDrawObjectImpl.js +0 -1
- package/interface/BitmapFilterTypeImpl.d.ts +0 -1
- package/interface/BitmapFilterTypeImpl.js +0 -1
- package/interface/BlendModeImpl.d.ts +0 -1
- package/interface/BlendModeImpl.js +0 -1
- package/interface/BoundsImpl.d.ts +0 -6
- package/interface/BoundsImpl.js +0 -1
- package/interface/Character.d.ts +0 -2
- package/interface/Character.js +0 -1
- package/interface/CharacterImpl.d.ts +0 -2
- package/interface/CharacterImpl.js +0 -1
- package/interface/ClipObjectImpl.d.ts +0 -14
- package/interface/ClipObjectImpl.js +0 -1
- package/interface/ColorStopImpl.d.ts +0 -7
- package/interface/ColorStopImpl.js +0 -1
- package/interface/DictionaryTagImpl.d.ts +0 -7
- package/interface/DictionaryTagImpl.js +0 -1
- package/interface/DisplacementMapFilterModeImpl.d.ts +0 -1
- package/interface/DisplacementMapFilterModeImpl.js +0 -1
- package/interface/DisplayImpl.d.ts +0 -28
- package/interface/DisplayImpl.js +0 -1
- package/interface/DisplayObjectImpl.d.ts +0 -2
- package/interface/DisplayObjectImpl.js +0 -1
- package/interface/DragRulesImpl.d.ts +0 -7
- package/interface/DragRulesImpl.js +0 -1
- package/interface/DropTargetImpl.d.ts +0 -2
- package/interface/DropTargetImpl.js +0 -1
- package/interface/EventDispatcherImpl.d.ts +0 -2
- package/interface/EventDispatcherImpl.js +0 -1
- package/interface/EventListenerImpl.d.ts +0 -6
- package/interface/EventListenerImpl.js +0 -1
- package/interface/EventsImpl.d.ts +0 -20
- package/interface/EventsImpl.js +0 -1
- package/interface/FillMeshImpl.d.ts +0 -5
- package/interface/FillMeshImpl.js +0 -1
- package/interface/FilterArrayImpl.d.ts +0 -10
- package/interface/FilterArrayImpl.js +0 -1
- package/interface/FilterQualityImpl.d.ts +0 -1
- package/interface/FilterQualityImpl.js +0 -1
- package/interface/FiltersImpl.d.ts +0 -20
- package/interface/FiltersImpl.js +0 -1
- package/interface/GeomImpl.d.ts +0 -12
- package/interface/GeomImpl.js +0 -1
- package/interface/GradientTypeImpl.d.ts +0 -3
- package/interface/GradientTypeImpl.js +0 -1
- package/interface/GraphicsParentImpl.d.ts +0 -2
- package/interface/GraphicsParentImpl.js +0 -1
- package/interface/GridImpl.d.ts +0 -6
- package/interface/GridImpl.js +0 -1
- package/interface/ImageTypeImpl.d.ts +0 -1
- package/interface/ImageTypeImpl.js +0 -1
- package/interface/IndexRangeImpl.d.ts +0 -4
- package/interface/IndexRangeImpl.js +0 -1
- package/interface/LoaderInfoDataImpl.d.ts +0 -7
- package/interface/LoaderInfoDataImpl.js +0 -1
- package/interface/LoopConfigImpl.d.ts +0 -8
- package/interface/LoopConfigImpl.js +0 -1
- package/interface/LoopTypeImpl.d.ts +0 -1
- package/interface/LoopTypeImpl.js +0 -1
- package/interface/MediaImpl.d.ts +0 -10
- package/interface/MediaImpl.js +0 -1
- package/interface/MovieClipActionObjectImpl.d.ts +0 -5
- package/interface/MovieClipActionObjectImpl.js +0 -1
- package/interface/MovieClipCharacterImpl.d.ts +0 -18
- package/interface/MovieClipCharacterImpl.js +0 -1
- package/interface/MovieClipLabelObjectImpl.d.ts +0 -4
- package/interface/MovieClipLabelObjectImpl.js +0 -1
- package/interface/MovieClipSoundObjectImpl.d.ts +0 -5
- package/interface/MovieClipSoundObjectImpl.js +0 -1
- package/interface/NetImpl.d.ts +0 -6
- package/interface/NetImpl.js +0 -1
- package/interface/NoCodeDataImpl.d.ts +0 -7
- package/interface/NoCodeDataImpl.js +0 -1
- package/interface/NoCodeDataZlibImpl.d.ts +0 -4
- package/interface/NoCodeDataZlibImpl.js +0 -1
- package/interface/ParentImpl.d.ts +0 -2
- package/interface/ParentImpl.js +0 -1
- package/interface/PlaceObjectImpl.d.ts +0 -12
- package/interface/PlaceObjectImpl.js +0 -1
- package/interface/PlayerHitObjectImpl.d.ts +0 -7
- package/interface/PlayerHitObjectImpl.js +0 -1
- package/interface/PlayerModeImpl.d.ts +0 -1
- package/interface/PlayerModeImpl.js +0 -1
- package/interface/PlayerOptionsImpl.d.ts +0 -8
- package/interface/PlayerOptionsImpl.js +0 -1
- package/interface/PointImpl.d.ts +0 -4
- package/interface/PointImpl.js +0 -1
- package/interface/PreObjectImpl.d.ts +0 -23
- package/interface/PreObjectImpl.js +0 -1
- package/interface/PropertyBitmapDataMessageImpl.d.ts +0 -8
- package/interface/PropertyBitmapDataMessageImpl.js +0 -1
- package/interface/PropertyContainerMessageImpl.d.ts +0 -6
- package/interface/PropertyContainerMessageImpl.js +0 -1
- package/interface/PropertyMessageImpl.d.ts +0 -41
- package/interface/PropertyMessageImpl.js +0 -1
- package/interface/PropertyMessageMapImpl.d.ts +0 -2
- package/interface/PropertyMessageMapImpl.js +0 -1
- package/interface/PropertyShapeMessageImpl.d.ts +0 -6
- package/interface/PropertyShapeMessageImpl.js +0 -1
- package/interface/PropertyTextMessageImpl.d.ts +0 -25
- package/interface/PropertyTextMessageImpl.js +0 -1
- package/interface/PropertyVideoMessageImpl.d.ts +0 -5
- package/interface/PropertyVideoMessageImpl.js +0 -1
- package/interface/RGBAImpl.d.ts +0 -6
- package/interface/RGBAImpl.js +0 -1
- package/interface/ShapeCharacterImpl.d.ts +0 -14
- package/interface/ShapeCharacterImpl.js +0 -1
- package/interface/SoundCharacterImpl.d.ts +0 -5
- package/interface/SoundCharacterImpl.js +0 -1
- package/interface/SoundTagImpl.d.ts +0 -6
- package/interface/SoundTagImpl.js +0 -1
- package/interface/SpriteImpl.d.ts +0 -2
- package/interface/SpriteImpl.js +0 -1
- package/interface/StageDataImpl.d.ts +0 -6
- package/interface/StageDataImpl.js +0 -1
- package/interface/StageQualityImpl.d.ts +0 -1
- package/interface/StageQualityImpl.js +0 -1
- package/interface/StrokeMethImpl.d.ts +0 -4
- package/interface/StrokeMethImpl.js +0 -1
- package/interface/StrokeTypeImpl.d.ts +0 -2
- package/interface/StrokeTypeImpl.js +0 -1
- package/interface/SurfaceFilterImpl.d.ts +0 -6
- package/interface/SurfaceFilterImpl.js +0 -1
- package/interface/TextBreakObjectImpl.d.ts +0 -9
- package/interface/TextBreakObjectImpl.js +0 -1
- package/interface/TextCharacterImpl.d.ts +0 -27
- package/interface/TextCharacterImpl.js +0 -1
- package/interface/TextDataImpl.d.ts +0 -2
- package/interface/TextDataImpl.js +0 -1
- package/interface/TextFieldAutoSizeImpl.d.ts +0 -1
- package/interface/TextFieldAutoSizeImpl.js +0 -1
- package/interface/TextFieldTypeImpl.d.ts +0 -1
- package/interface/TextFieldTypeImpl.js +0 -1
- package/interface/TextFormatAlignImpl.d.ts +0 -1
- package/interface/TextFormatAlignImpl.js +0 -1
- package/interface/TextFormatVerticalAlignImpl.d.ts +0 -1
- package/interface/TextFormatVerticalAlignImpl.js +0 -1
- package/interface/TextImageObjectImpl.d.ts +0 -11
- package/interface/TextImageObjectImpl.js +0 -1
- package/interface/TextImpl.d.ts +0 -6
- package/interface/TextImpl.js +0 -1
- package/interface/TextObjectImpl.d.ts +0 -7
- package/interface/TextObjectImpl.js +0 -1
- package/interface/TextObjectModeImpl.d.ts +0 -1
- package/interface/TextObjectModeImpl.js +0 -1
- package/interface/TextStringObjectImpl.d.ts +0 -7
- package/interface/TextStringObjectImpl.js +0 -1
- package/interface/UIImpl.d.ts +0 -8
- package/interface/UIImpl.js +0 -1
- package/interface/URLLoaderDataFormatImpl.d.ts +0 -1
- package/interface/URLLoaderDataFormatImpl.js +0 -1
- package/interface/URLRequestMethodImpl.d.ts +0 -1
- package/interface/URLRequestMethodImpl.js +0 -1
- package/interface/UniformDataImpl.d.ts +0 -5
- package/interface/UniformDataImpl.js +0 -1
- package/interface/UnzipQueueImpl.d.ts +0 -6
- package/interface/UnzipQueueImpl.js +0 -1
- package/interface/VerticesImpl.d.ts +0 -1
- package/interface/VerticesImpl.js +0 -1
- package/interface/VideoCharacterImpl.d.ts +0 -12
- package/interface/VideoCharacterImpl.js +0 -1
- package/next2d/display/BitmapData.d.ts +0 -143
- package/next2d/display/BitmapData.js +0 -387
- package/next2d/display/BlendMode.d.ts +0 -204
- package/next2d/display/BlendMode.js +0 -240
- package/next2d/display/DisplayObject.d.ts +0 -565
- package/next2d/display/DisplayObject.js +0 -1670
- package/next2d/display/DisplayObjectContainer.d.ts +0 -351
- package/next2d/display/DisplayObjectContainer.js +0 -1776
- package/next2d/display/FrameLabel.d.ts +0 -98
- package/next2d/display/FrameLabel.js +0 -120
- package/next2d/display/Graphics.d.ts +0 -577
- package/next2d/display/Graphics.js +0 -2161
- package/next2d/display/GraphicsBitmapFill.d.ts +0 -49
- package/next2d/display/GraphicsBitmapFill.js +0 -86
- package/next2d/display/GraphicsGradientFill.d.ts +0 -66
- package/next2d/display/GraphicsGradientFill.js +0 -157
- package/next2d/display/InteractiveObject.d.ts +0 -32
- package/next2d/display/InteractiveObject.js +0 -43
- package/next2d/display/Loader.d.ts +0 -131
- package/next2d/display/Loader.js +0 -321
- package/next2d/display/LoaderInfo.d.ts +0 -122
- package/next2d/display/LoaderInfo.js +0 -184
- package/next2d/display/LoopConfig.d.ts +0 -108
- package/next2d/display/LoopConfig.js +0 -156
- package/next2d/display/LoopType.d.ts +0 -104
- package/next2d/display/LoopType.js +0 -122
- package/next2d/display/MovieClip.d.ts +0 -314
- package/next2d/display/MovieClip.js +0 -941
- package/next2d/display/Shape.d.ts +0 -169
- package/next2d/display/Shape.js +0 -509
- package/next2d/display/Sprite.d.ts +0 -175
- package/next2d/display/Sprite.js +0 -280
- package/next2d/display/Stage.d.ts +0 -164
- package/next2d/display/Stage.js +0 -251
- package/next2d/events/Event.d.ts +0 -424
- package/next2d/events/Event.js +0 -560
- package/next2d/events/EventDispatcher.d.ts +0 -138
- package/next2d/events/EventDispatcher.js +0 -623
- package/next2d/events/EventPhase.d.ts +0 -80
- package/next2d/events/EventPhase.js +0 -94
- package/next2d/events/FocusEvent.d.ts +0 -89
- package/next2d/events/FocusEvent.js +0 -103
- package/next2d/events/HTTPStatusEvent.d.ts +0 -107
- package/next2d/events/HTTPStatusEvent.js +0 -139
- package/next2d/events/IOErrorEvent.d.ts +0 -82
- package/next2d/events/IOErrorEvent.js +0 -101
- package/next2d/events/MouseEvent.d.ts +0 -163
- package/next2d/events/MouseEvent.js +0 -207
- package/next2d/events/ProgressEvent.d.ts +0 -97
- package/next2d/events/ProgressEvent.js +0 -123
- package/next2d/events/VideoEvent.d.ts +0 -145
- package/next2d/events/VideoEvent.js +0 -181
- package/next2d/filters/BevelFilter.d.ts +0 -254
- package/next2d/filters/BevelFilter.js +0 -491
- package/next2d/filters/BitmapFilter.d.ts +0 -75
- package/next2d/filters/BitmapFilter.js +0 -95
- package/next2d/filters/BlurFilter.d.ts +0 -150
- package/next2d/filters/BlurFilter.js +0 -370
- package/next2d/filters/ColorMatrixFilter.d.ts +0 -116
- package/next2d/filters/ColorMatrixFilter.js +0 -179
- package/next2d/filters/ConvolutionFilter.d.ts +0 -210
- package/next2d/filters/ConvolutionFilter.js +0 -366
- package/next2d/filters/DisplacementMapFilter.d.ts +0 -212
- package/next2d/filters/DisplacementMapFilter.js +0 -372
- package/next2d/filters/DropShadowFilter.d.ts +0 -240
- package/next2d/filters/DropShadowFilter.js +0 -461
- package/next2d/filters/GlowFilter.d.ts +0 -204
- package/next2d/filters/GlowFilter.js +0 -356
- package/next2d/filters/GradientBevelFilter.d.ts +0 -243
- package/next2d/filters/GradientBevelFilter.js +0 -474
- package/next2d/filters/GradientGlowFilter.d.ts +0 -243
- package/next2d/filters/GradientGlowFilter.js +0 -464
- package/next2d/geom/ColorTransform.d.ts +0 -201
- package/next2d/geom/ColorTransform.js +0 -278
- package/next2d/geom/Matrix.d.ts +0 -299
- package/next2d/geom/Matrix.js +0 -454
- package/next2d/geom/Point.d.ts +0 -213
- package/next2d/geom/Point.js +0 -274
- package/next2d/geom/Rectangle.d.ts +0 -364
- package/next2d/geom/Rectangle.js +0 -513
- package/next2d/geom/Transform.d.ts +0 -213
- package/next2d/geom/Transform.js +0 -492
- package/next2d/media/Sound.d.ts +0 -208
- package/next2d/media/Sound.js +0 -504
- package/next2d/media/SoundMixer.d.ts +0 -68
- package/next2d/media/SoundMixer.js +0 -115
- package/next2d/media/SoundTransform.d.ts +0 -80
- package/next2d/media/SoundTransform.js +0 -111
- package/next2d/media/Video.d.ts +0 -331
- package/next2d/media/Video.js +0 -856
- package/next2d/net/URLRequest.d.ts +0 -143
- package/next2d/net/URLRequest.js +0 -232
- package/next2d/net/URLRequestHeader.d.ts +0 -82
- package/next2d/net/URLRequestHeader.js +0 -105
- package/next2d/text/TextField.d.ts +0 -644
- package/next2d/text/TextField.js +0 -2662
- package/next2d/text/TextFormat.d.ts +0 -250
- package/next2d/text/TextFormat.js +0 -460
- package/next2d/ui/Easing.d.ts +0 -359
- package/next2d/ui/Easing.js +0 -481
- package/next2d/ui/Job.d.ts +0 -155
- package/next2d/ui/Job.js +0 -333
- package/next2d/ui/Tween.d.ts +0 -62
- package/next2d/ui/Tween.js +0 -72
- package/packages/Display.d.ts +0 -3
- package/packages/Display.js +0 -36
- package/packages/Events.d.ts +0 -3
- package/packages/Events.js +0 -28
- package/packages/Filters.d.ts +0 -3
- package/packages/Filters.js +0 -28
- package/packages/Geom.d.ts +0 -3
- package/packages/Geom.js +0 -20
- package/packages/Media.d.ts +0 -3
- package/packages/Media.js +0 -18
- package/packages/Net.d.ts +0 -3
- package/packages/Net.js +0 -14
- package/packages/Text.d.ts +0 -3
- package/packages/Text.js +0 -14
- package/packages/UI.d.ts +0 -3
- package/packages/UI.js +0 -16
- package/player/Next2D.d.ts +0 -70
- package/player/Next2D.js +0 -192
- package/player/Player.d.ts +0 -334
- package/player/Player.js +0 -1863
- package/util/CacheStore.d.ts +0 -115
- package/util/CacheStore.js +0 -276
- package/util/Global.d.ts +0 -23
- package/util/Global.js +0 -67
- package/util/RenderUtil.d.ts +0 -472
- package/util/RenderUtil.js +0 -686
- package/util/Shortcut.d.ts +0 -28
- package/util/Shortcut.js +0 -28
- package/util/Util.d.ts +0 -334
- package/util/Util.js +0 -844
- package/webgl/BezierConverter.d.ts +0 -59
- package/webgl/BezierConverter.js +0 -106
- package/webgl/CanvasGradientToWebGL.d.ts +0 -94
- package/webgl/CanvasGradientToWebGL.js +0 -181
- package/webgl/CanvasPatternToWebGL.d.ts +0 -39
- package/webgl/CanvasPatternToWebGL.js +0 -66
- package/webgl/CanvasToWebGLContext.d.ts +0 -596
- package/webgl/CanvasToWebGLContext.js +0 -1421
- package/webgl/CanvasToWebGLContextBlend.d.ts +0 -97
- package/webgl/CanvasToWebGLContextBlend.js +0 -299
- package/webgl/CanvasToWebGLContextGrid.d.ts +0 -74
- package/webgl/CanvasToWebGLContextGrid.js +0 -283
- package/webgl/CanvasToWebGLContextMask.d.ts +0 -113
- package/webgl/CanvasToWebGLContextMask.js +0 -436
- package/webgl/CanvasToWebGLContextPath.d.ts +0 -111
- package/webgl/CanvasToWebGLContextPath.js +0 -210
- package/webgl/CanvasToWebGLContextStyle.d.ts +0 -77
- package/webgl/CanvasToWebGLContextStyle.js +0 -139
- package/webgl/ColorBufferPool.d.ts +0 -58
- package/webgl/ColorBufferPool.js +0 -134
- package/webgl/FrameBufferManager.d.ts +0 -135
- package/webgl/FrameBufferManager.js +0 -358
- package/webgl/StencilBufferPool.d.ts +0 -56
- package/webgl/StencilBufferPool.js +0 -142
- package/webgl/TextureManager.d.ts +0 -130
- package/webgl/TextureManager.js +0 -296
- package/webgl/VertexArrayObjectManager.d.ts +0 -95
- package/webgl/VertexArrayObjectManager.js +0 -277
- package/webgl/WebGLFillMeshGenerator.d.ts +0 -31
- package/webgl/WebGLFillMeshGenerator.js +0 -101
- package/webgl/WebGLStrokeMeshGenerator.d.ts +0 -182
- package/webgl/WebGLStrokeMeshGenerator.js +0 -504
- package/webgl/shader/CanvasToWebGLShader.d.ts +0 -85
- package/webgl/shader/CanvasToWebGLShader.js +0 -192
- package/webgl/shader/CanvasToWebGLShaderList.d.ts +0 -70
- package/webgl/shader/CanvasToWebGLShaderList.js +0 -109
- package/webgl/shader/GradientLUTGenerator.d.ts +0 -36
- package/webgl/shader/GradientLUTGenerator.js +0 -123
- package/webgl/shader/WebGLShaderUniform.d.ts +0 -52
- package/webgl/shader/WebGLShaderUniform.js +0 -165
- package/webgl/shader/fragment/FragmentShaderLibrary.d.ts +0 -18
- package/webgl/shader/fragment/FragmentShaderLibrary.js +0 -35
- package/webgl/shader/fragment/FragmentShaderSource.d.ts +0 -29
- package/webgl/shader/fragment/FragmentShaderSource.js +0 -99
- package/webgl/shader/fragment/FragmentShaderSourceBlend.d.ts +0 -67
- package/webgl/shader/fragment/FragmentShaderSourceBlend.js +0 -319
- package/webgl/shader/fragment/FragmentShaderSourceGradient.d.ts +0 -44
- package/webgl/shader/fragment/FragmentShaderSourceGradient.js +0 -114
- package/webgl/shader/fragment/FragmentShaderSourceGradientLUT.d.ts +0 -14
- package/webgl/shader/fragment/FragmentShaderSourceGradientLUT.js +0 -58
- package/webgl/shader/fragment/FragmentShaderSourceTexture.d.ts +0 -12
- package/webgl/shader/fragment/FragmentShaderSourceTexture.js +0 -36
- package/webgl/shader/fragment/filter/FragmentShaderSourceBlurFilter.d.ts +0 -12
- package/webgl/shader/fragment/filter/FragmentShaderSourceBlurFilter.js +0 -42
- package/webgl/shader/fragment/filter/FragmentShaderSourceColorMatrixFilter.d.ts +0 -11
- package/webgl/shader/fragment/filter/FragmentShaderSourceColorMatrixFilter.js +0 -35
- package/webgl/shader/fragment/filter/FragmentShaderSourceConvolutionFilter.d.ts +0 -16
- package/webgl/shader/fragment/filter/FragmentShaderSourceConvolutionFilter.js +0 -80
- package/webgl/shader/fragment/filter/FragmentShaderSourceDisplacementMapFilter.d.ts +0 -15
- package/webgl/shader/fragment/filter/FragmentShaderSourceDisplacementMapFilter.js +0 -106
- package/webgl/shader/fragment/filter/FragmentShaderSourceFilter.d.ts +0 -112
- package/webgl/shader/fragment/filter/FragmentShaderSourceFilter.js +0 -275
- package/webgl/shader/variants/BlendShaderVariantCollection.d.ts +0 -99
- package/webgl/shader/variants/BlendShaderVariantCollection.js +0 -239
- package/webgl/shader/variants/FilterShaderVariantCollection.d.ts +0 -150
- package/webgl/shader/variants/FilterShaderVariantCollection.js +0 -395
- package/webgl/shader/variants/GradientLUTShaderVariantCollection.d.ts +0 -49
- package/webgl/shader/variants/GradientLUTShaderVariantCollection.js +0 -107
- package/webgl/shader/variants/GradientShapeShaderVariantCollection.d.ts +0 -61
- package/webgl/shader/variants/GradientShapeShaderVariantCollection.js +0 -196
- package/webgl/shader/variants/ShapeShaderVariantCollection.d.ts +0 -117
- package/webgl/shader/variants/ShapeShaderVariantCollection.js +0 -427
- package/webgl/shader/vertex/VertexShaderLibrary.d.ts +0 -18
- package/webgl/shader/vertex/VertexShaderLibrary.js +0 -75
- package/webgl/shader/vertex/VertexShaderSource.d.ts +0 -23
- package/webgl/shader/vertex/VertexShaderSource.js +0 -92
- package/webgl/shader/vertex/VertexShaderSourceFill.d.ts +0 -45
- package/webgl/shader/vertex/VertexShaderSourceFill.js +0 -112
- package/webgl/shader/vertex/VertexShaderSourceStroke.d.ts +0 -27
- package/webgl/shader/vertex/VertexShaderSourceStroke.js +0 -149
|
@@ -1,1421 +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 { $Math, $getFloat32Array9, $getArray, $clamp, $poolArray, $inverseMatrix, $getFloat32Array6, $poolFloat32Array9, $poolBoundsObject, $getBoundsObject } from "../util/RenderUtil";
|
|
14
|
-
/**
|
|
15
|
-
* @class
|
|
16
|
-
*/
|
|
17
|
-
export class CanvasToWebGLContext {
|
|
18
|
-
/**
|
|
19
|
-
* @param {WebGL2RenderingContext} gl
|
|
20
|
-
* @param {number} sample
|
|
21
|
-
* @constructor
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
constructor(gl, sample) {
|
|
25
|
-
/**
|
|
26
|
-
* @type {WebGL2RenderingContext}
|
|
27
|
-
* @private
|
|
28
|
-
*/
|
|
29
|
-
this._$gl = gl;
|
|
30
|
-
/**
|
|
31
|
-
* @type {number}
|
|
32
|
-
* @private
|
|
33
|
-
*/
|
|
34
|
-
const samples = $Math.min(sample, gl.getParameter(gl.MAX_SAMPLES));
|
|
35
|
-
/**
|
|
36
|
-
* @type {number}
|
|
37
|
-
* @private
|
|
38
|
-
*/
|
|
39
|
-
this._$maxTextureSize = $Math.min(8192, gl.getParameter(gl.MAX_TEXTURE_SIZE)) - 2;
|
|
40
|
-
/**
|
|
41
|
-
* @type {CanvasToWebGLContextStyle}
|
|
42
|
-
* @private
|
|
43
|
-
*/
|
|
44
|
-
this._$contextStyle = new CanvasToWebGLContextStyle();
|
|
45
|
-
/**
|
|
46
|
-
* @type {BoundsImpl}
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
this._$cacheBounds = $getBoundsObject();
|
|
50
|
-
/**
|
|
51
|
-
* @type {Float32Array}
|
|
52
|
-
* @private
|
|
53
|
-
*/
|
|
54
|
-
this._$matrix = $getFloat32Array9(1, 0, 0, 0, 1, 0, 0, 0, 1);
|
|
55
|
-
/**
|
|
56
|
-
* @type {AttachmentImpl}
|
|
57
|
-
* @default null
|
|
58
|
-
* @private
|
|
59
|
-
*/
|
|
60
|
-
this._$cacheAttachment = null;
|
|
61
|
-
/**
|
|
62
|
-
* @type {array}
|
|
63
|
-
* @private
|
|
64
|
-
*/
|
|
65
|
-
this._$stack = [];
|
|
66
|
-
/**
|
|
67
|
-
* @type {number}
|
|
68
|
-
* @default 1
|
|
69
|
-
* @private
|
|
70
|
-
*/
|
|
71
|
-
this._$globalAlpha = 1;
|
|
72
|
-
/**
|
|
73
|
-
* @type {boolean}
|
|
74
|
-
* @default false
|
|
75
|
-
* @private
|
|
76
|
-
*/
|
|
77
|
-
this._$imageSmoothingEnabled = false;
|
|
78
|
-
/**
|
|
79
|
-
* @type {string}
|
|
80
|
-
* @default "normal"
|
|
81
|
-
* @private
|
|
82
|
-
*/
|
|
83
|
-
this._$globalCompositeOperation = "normal";
|
|
84
|
-
/**
|
|
85
|
-
* @type {number}
|
|
86
|
-
* @default 1
|
|
87
|
-
* @private
|
|
88
|
-
*/
|
|
89
|
-
this._$clearColorR = 1;
|
|
90
|
-
/**
|
|
91
|
-
* @type {number}
|
|
92
|
-
* @default 1
|
|
93
|
-
* @private
|
|
94
|
-
*/
|
|
95
|
-
this._$clearColorG = 1;
|
|
96
|
-
/**
|
|
97
|
-
* @type {number}
|
|
98
|
-
* @default 1
|
|
99
|
-
* @private
|
|
100
|
-
*/
|
|
101
|
-
this._$clearColorB = 1;
|
|
102
|
-
/**
|
|
103
|
-
* @type {number}
|
|
104
|
-
* @default 1
|
|
105
|
-
* @private
|
|
106
|
-
*/
|
|
107
|
-
this._$clearColorA = 1;
|
|
108
|
-
/**
|
|
109
|
-
* @type {number}
|
|
110
|
-
* @default 0
|
|
111
|
-
* @private
|
|
112
|
-
*/
|
|
113
|
-
this._$viewportWidth = 0;
|
|
114
|
-
/**
|
|
115
|
-
* @type {number}
|
|
116
|
-
* @default 0
|
|
117
|
-
* @private
|
|
118
|
-
*/
|
|
119
|
-
this._$viewportHeight = 0;
|
|
120
|
-
/**
|
|
121
|
-
* @type {FrameBufferManager}
|
|
122
|
-
* @private
|
|
123
|
-
*/
|
|
124
|
-
this._$frameBufferManager = new FrameBufferManager(gl, samples);
|
|
125
|
-
/**
|
|
126
|
-
* @type {CanvasToWebGLContextPath}
|
|
127
|
-
* @private
|
|
128
|
-
*/
|
|
129
|
-
this._$path = new CanvasToWebGLContextPath();
|
|
130
|
-
/**
|
|
131
|
-
* @type {CanvasToWebGLContextGrid}
|
|
132
|
-
* @private
|
|
133
|
-
*/
|
|
134
|
-
this._$grid = new CanvasToWebGLContextGrid();
|
|
135
|
-
/**
|
|
136
|
-
* @type {number}
|
|
137
|
-
* @default 0
|
|
138
|
-
* @private
|
|
139
|
-
*/
|
|
140
|
-
this._$offsetX = 0;
|
|
141
|
-
/**
|
|
142
|
-
* @type {number}
|
|
143
|
-
* @default 0
|
|
144
|
-
* @private
|
|
145
|
-
*/
|
|
146
|
-
this._$offsetY = 0;
|
|
147
|
-
/**
|
|
148
|
-
* @type {array}
|
|
149
|
-
* @private
|
|
150
|
-
*/
|
|
151
|
-
this._$blends = $getArray();
|
|
152
|
-
/**
|
|
153
|
-
* @type {array}
|
|
154
|
-
* @private
|
|
155
|
-
*/
|
|
156
|
-
this._$positions = $getArray();
|
|
157
|
-
/**
|
|
158
|
-
* @type {boolean}
|
|
159
|
-
* @default false
|
|
160
|
-
* @private
|
|
161
|
-
*/
|
|
162
|
-
this._$isLayer = false;
|
|
163
|
-
/**
|
|
164
|
-
* @type {CanvasToWebGLShaderList}
|
|
165
|
-
* @private
|
|
166
|
-
*/
|
|
167
|
-
this._$shaderList = new CanvasToWebGLShaderList(this, gl);
|
|
168
|
-
/**
|
|
169
|
-
* @type {GradientLUTGenerator}
|
|
170
|
-
* @private
|
|
171
|
-
*/
|
|
172
|
-
this._$gradientLUT = new GradientLUTGenerator(this, gl);
|
|
173
|
-
/**
|
|
174
|
-
* @type {VertexArrayObjectManager}
|
|
175
|
-
* @private
|
|
176
|
-
*/
|
|
177
|
-
this._$vao = new VertexArrayObjectManager(gl);
|
|
178
|
-
/**
|
|
179
|
-
* @type {CanvasToWebGLContextMask}
|
|
180
|
-
* @private
|
|
181
|
-
*/
|
|
182
|
-
this._$mask = new CanvasToWebGLContextMask(this, gl);
|
|
183
|
-
/**
|
|
184
|
-
* @type {CanvasToWebGLContextBlend}
|
|
185
|
-
* @private
|
|
186
|
-
*/
|
|
187
|
-
this._$blend = new CanvasToWebGLContextBlend(this, gl);
|
|
188
|
-
/**
|
|
189
|
-
* @type {array}
|
|
190
|
-
* @private
|
|
191
|
-
*/
|
|
192
|
-
this._$maskBufferArray = [];
|
|
193
|
-
/**
|
|
194
|
-
* @type {array}
|
|
195
|
-
* @private
|
|
196
|
-
*/
|
|
197
|
-
this._$maskBoundsArray = [];
|
|
198
|
-
/**
|
|
199
|
-
* @type {array}
|
|
200
|
-
* @private
|
|
201
|
-
*/
|
|
202
|
-
this._$attachmentArray = [];
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* @return {void}
|
|
206
|
-
* @method
|
|
207
|
-
* @public
|
|
208
|
-
*/
|
|
209
|
-
reset() {
|
|
210
|
-
// reset
|
|
211
|
-
this._$globalAlpha = 1;
|
|
212
|
-
this._$globalCompositeOperation = "normal";
|
|
213
|
-
this._$imageSmoothingEnabled = false;
|
|
214
|
-
// reset color
|
|
215
|
-
this._$contextStyle.clear();
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* @return {boolean}
|
|
219
|
-
* @public
|
|
220
|
-
*/
|
|
221
|
-
get isLayer() {
|
|
222
|
-
return this._$isLayer;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* @memberof CanvasToWebGLContext#
|
|
226
|
-
* @return {HTMLCanvasElement}
|
|
227
|
-
* @public
|
|
228
|
-
*/
|
|
229
|
-
get canvas() {
|
|
230
|
-
return this._$gl.canvas;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* @return {AttachmentImpl|null}
|
|
234
|
-
* @public
|
|
235
|
-
*/
|
|
236
|
-
get cacheAttachment() {
|
|
237
|
-
return this._$cacheAttachment;
|
|
238
|
-
}
|
|
239
|
-
set cacheAttachment(attachment) {
|
|
240
|
-
this._$cacheAttachment = attachment;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* @return {BoundsImpl}
|
|
244
|
-
* @readonly
|
|
245
|
-
* @public
|
|
246
|
-
*/
|
|
247
|
-
get cacheBounds() {
|
|
248
|
-
return this._$cacheBounds;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* @member {Float32Array|CanvasGradientToWebGL|CanvasPatternToWebGL}
|
|
252
|
-
* @public
|
|
253
|
-
*/
|
|
254
|
-
get fillStyle() {
|
|
255
|
-
return this._$contextStyle.fillStyle;
|
|
256
|
-
}
|
|
257
|
-
set fillStyle(fill_style) {
|
|
258
|
-
this._$contextStyle.fillStyle = fill_style;
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* @member {Float32Array|CanvasGradientToWebGL|CanvasPatternToWebGL}
|
|
262
|
-
* @public
|
|
263
|
-
*/
|
|
264
|
-
get strokeStyle() {
|
|
265
|
-
return this._$contextStyle.strokeStyle;
|
|
266
|
-
}
|
|
267
|
-
set strokeStyle(stroke_style) {
|
|
268
|
-
this._$contextStyle.strokeStyle = stroke_style;
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* @member {number}
|
|
272
|
-
* @public
|
|
273
|
-
*/
|
|
274
|
-
get lineWidth() {
|
|
275
|
-
return this._$contextStyle.lineWidth;
|
|
276
|
-
}
|
|
277
|
-
set lineWidth(line_width) {
|
|
278
|
-
this._$contextStyle.lineWidth = line_width;
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* @member {string}
|
|
282
|
-
* @public
|
|
283
|
-
*/
|
|
284
|
-
get lineCap() {
|
|
285
|
-
return this._$contextStyle.lineCap;
|
|
286
|
-
}
|
|
287
|
-
set lineCap(line_cap) {
|
|
288
|
-
this._$contextStyle.lineCap = line_cap;
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
* @member {string}
|
|
292
|
-
* @public
|
|
293
|
-
*/
|
|
294
|
-
get lineJoin() {
|
|
295
|
-
return this._$contextStyle.lineJoin;
|
|
296
|
-
}
|
|
297
|
-
set lineJoin(line_join) {
|
|
298
|
-
this._$contextStyle.lineJoin = line_join;
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* @member {number}
|
|
302
|
-
* @public
|
|
303
|
-
*/
|
|
304
|
-
get miterLimit() {
|
|
305
|
-
return this._$contextStyle.miterLimit;
|
|
306
|
-
}
|
|
307
|
-
set miterLimit(miter_limit) {
|
|
308
|
-
this._$contextStyle.miterLimit = miter_limit;
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* @member {number}
|
|
312
|
-
* @public
|
|
313
|
-
*/
|
|
314
|
-
get globalAlpha() {
|
|
315
|
-
return this._$globalAlpha;
|
|
316
|
-
}
|
|
317
|
-
set globalAlpha(global_alpha) {
|
|
318
|
-
this._$globalAlpha = $clamp(global_alpha, 0, 1, 1);
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* @member {boolean}
|
|
322
|
-
* @public
|
|
323
|
-
*/
|
|
324
|
-
get imageSmoothingEnabled() {
|
|
325
|
-
return this._$imageSmoothingEnabled;
|
|
326
|
-
}
|
|
327
|
-
set imageSmoothingEnabled(image_smoothing_enabled) {
|
|
328
|
-
this._$imageSmoothingEnabled = image_smoothing_enabled;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* @member {BlendModeImpl}
|
|
332
|
-
* @public
|
|
333
|
-
*/
|
|
334
|
-
get globalCompositeOperation() {
|
|
335
|
-
return this._$globalCompositeOperation;
|
|
336
|
-
}
|
|
337
|
-
set globalCompositeOperation(global_composite_operation) {
|
|
338
|
-
this._$globalCompositeOperation = global_composite_operation;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* @member {FrameBufferManager}
|
|
342
|
-
* @readonly
|
|
343
|
-
* @public
|
|
344
|
-
*/
|
|
345
|
-
get frameBuffer() {
|
|
346
|
-
return this._$frameBufferManager;
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* @member {CanvasToWebGLShaderList}
|
|
350
|
-
* @readonly
|
|
351
|
-
* @public
|
|
352
|
-
*/
|
|
353
|
-
get shaderList() {
|
|
354
|
-
return this._$shaderList;
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* @member {CanvasToWebGLContextPath}
|
|
358
|
-
* @readonly
|
|
359
|
-
* @public
|
|
360
|
-
*/
|
|
361
|
-
get path() {
|
|
362
|
-
return this._$path;
|
|
363
|
-
}
|
|
364
|
-
/**
|
|
365
|
-
* @member {CanvasToWebGLContextGrid}
|
|
366
|
-
* @readonly
|
|
367
|
-
* @public
|
|
368
|
-
*/
|
|
369
|
-
get grid() {
|
|
370
|
-
return this._$grid;
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* @member {VertexArrayObjectManager}
|
|
374
|
-
* @readonly
|
|
375
|
-
* @public
|
|
376
|
-
*/
|
|
377
|
-
get vao() {
|
|
378
|
-
return this._$vao;
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* @member {CanvasToWebGLContextBlend}
|
|
382
|
-
* @readonly
|
|
383
|
-
* @public
|
|
384
|
-
*/
|
|
385
|
-
get blend() {
|
|
386
|
-
return this._$blend;
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* @return {object}
|
|
390
|
-
* @private
|
|
391
|
-
*/
|
|
392
|
-
_$getCurrentPosition() {
|
|
393
|
-
return this._$positions[this._$positions.length - 1];
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* @description textureの最大描画可能サイズからリサイズの比率を算出して返す
|
|
397
|
-
* Calculate and return the resize ratio from the maximum drawable size of texture
|
|
398
|
-
*
|
|
399
|
-
* @param {number} width
|
|
400
|
-
* @param {number} height
|
|
401
|
-
* @return {number}
|
|
402
|
-
* @method
|
|
403
|
-
* @public
|
|
404
|
-
*/
|
|
405
|
-
_$getTextureScale(width, height) {
|
|
406
|
-
const maxSize = $Math.max(width, height);
|
|
407
|
-
if (maxSize > this._$maxTextureSize) {
|
|
408
|
-
return this._$maxTextureSize / maxSize;
|
|
409
|
-
}
|
|
410
|
-
return 1;
|
|
411
|
-
}
|
|
412
|
-
/**
|
|
413
|
-
* @param {object} [attachment = null]
|
|
414
|
-
* @return {void}
|
|
415
|
-
* @method
|
|
416
|
-
* @public
|
|
417
|
-
*/
|
|
418
|
-
_$bind(attachment = null) {
|
|
419
|
-
if (!attachment) {
|
|
420
|
-
return;
|
|
421
|
-
}
|
|
422
|
-
this._$frameBufferManager.bind(attachment);
|
|
423
|
-
const colorBuffer = attachment.color;
|
|
424
|
-
const stencilBuffer = attachment.stencil;
|
|
425
|
-
const width = attachment.width;
|
|
426
|
-
const height = attachment.height;
|
|
427
|
-
if (this._$viewportWidth !== width || this._$viewportHeight !== height) {
|
|
428
|
-
this._$viewportWidth = width;
|
|
429
|
-
this._$viewportHeight = height;
|
|
430
|
-
this._$gl.viewport(0, 0, width, height);
|
|
431
|
-
}
|
|
432
|
-
// カラーバッファorステンシルバッファが、未初期化の場合はクリアする
|
|
433
|
-
if (colorBuffer && colorBuffer.dirty
|
|
434
|
-
|| stencilBuffer && stencilBuffer.dirty) {
|
|
435
|
-
if (colorBuffer) {
|
|
436
|
-
colorBuffer.dirty = false;
|
|
437
|
-
}
|
|
438
|
-
if (stencilBuffer) {
|
|
439
|
-
stencilBuffer.dirty = false;
|
|
440
|
-
}
|
|
441
|
-
this._$gl.clearColor(0, 0, 0, 0);
|
|
442
|
-
this.clearRect(0, 0, this._$viewportWidth, this._$viewportHeight);
|
|
443
|
-
this._$gl.clearColor(this._$clearColorR, this._$clearColorG, this._$clearColorB, this._$clearColorA);
|
|
444
|
-
this._$mask._$onClear(attachment.mask);
|
|
445
|
-
}
|
|
446
|
-
this._$mask._$onBind(attachment.mask);
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* @param {number} a
|
|
450
|
-
* @param {number} b
|
|
451
|
-
* @param {number} c
|
|
452
|
-
* @param {number} d
|
|
453
|
-
* @param {number} e
|
|
454
|
-
* @param {number} f
|
|
455
|
-
* @return {void}
|
|
456
|
-
* @method
|
|
457
|
-
* @public
|
|
458
|
-
*/
|
|
459
|
-
setTransform(a, b, c, d, e, f) {
|
|
460
|
-
this._$matrix[0] = a;
|
|
461
|
-
this._$matrix[1] = b;
|
|
462
|
-
this._$matrix[3] = c;
|
|
463
|
-
this._$matrix[4] = d;
|
|
464
|
-
this._$matrix[6] = e;
|
|
465
|
-
this._$matrix[7] = f;
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* @param {number} width
|
|
469
|
-
* @param {number} height
|
|
470
|
-
* @return {void}
|
|
471
|
-
* @method
|
|
472
|
-
* @public
|
|
473
|
-
*/
|
|
474
|
-
setMaxSize(width, height) {
|
|
475
|
-
this._$frameBufferManager.setMaxSize(width, height);
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* @param {number} a
|
|
479
|
-
* @param {number} b
|
|
480
|
-
* @param {number} c
|
|
481
|
-
* @param {number} d
|
|
482
|
-
* @param {number} e
|
|
483
|
-
* @param {number} f
|
|
484
|
-
* @return {void}
|
|
485
|
-
* @method
|
|
486
|
-
* @public
|
|
487
|
-
*/
|
|
488
|
-
transform(a, b, c, d, e, f) {
|
|
489
|
-
const a00 = this._$matrix[0];
|
|
490
|
-
const a01 = this._$matrix[1];
|
|
491
|
-
const a10 = this._$matrix[3];
|
|
492
|
-
const a11 = this._$matrix[4];
|
|
493
|
-
const a20 = this._$matrix[6];
|
|
494
|
-
const a21 = this._$matrix[7];
|
|
495
|
-
this._$matrix[0] = a * a00 + b * a10;
|
|
496
|
-
this._$matrix[1] = a * a01 + b * a11;
|
|
497
|
-
this._$matrix[3] = c * a00 + d * a10;
|
|
498
|
-
this._$matrix[4] = c * a01 + d * a11;
|
|
499
|
-
this._$matrix[6] = e * a00 + f * a10 + a20;
|
|
500
|
-
this._$matrix[7] = e * a01 + f * a11 + a21;
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* @param {WebGLTexture} image
|
|
504
|
-
* @param {number} x
|
|
505
|
-
* @param {number} y
|
|
506
|
-
* @param {number} w
|
|
507
|
-
* @param {number} h
|
|
508
|
-
* @param {Float32Array} [color_transform=null]
|
|
509
|
-
* @return {void}
|
|
510
|
-
* @method
|
|
511
|
-
* @public
|
|
512
|
-
*/
|
|
513
|
-
drawImage(image, x, y, w, h, color_transform = null) {
|
|
514
|
-
let ct0 = 1;
|
|
515
|
-
let ct1 = 1;
|
|
516
|
-
let ct2 = 1;
|
|
517
|
-
let ct4 = 0;
|
|
518
|
-
let ct5 = 0;
|
|
519
|
-
let ct6 = 0;
|
|
520
|
-
const ct3 = this._$globalAlpha;
|
|
521
|
-
const ct7 = 0;
|
|
522
|
-
if (color_transform) {
|
|
523
|
-
ct0 = color_transform[0];
|
|
524
|
-
ct1 = color_transform[1];
|
|
525
|
-
ct2 = color_transform[2];
|
|
526
|
-
ct4 = color_transform[4] / 255;
|
|
527
|
-
ct5 = color_transform[5] / 255;
|
|
528
|
-
ct6 = color_transform[6] / 255;
|
|
529
|
-
}
|
|
530
|
-
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);
|
|
531
|
-
}
|
|
532
|
-
/**
|
|
533
|
-
* @param {number} r
|
|
534
|
-
* @param {number} g
|
|
535
|
-
* @param {number} b
|
|
536
|
-
* @param {number} a
|
|
537
|
-
* @return {void}
|
|
538
|
-
* @method
|
|
539
|
-
* @public
|
|
540
|
-
*/
|
|
541
|
-
_$setColor(r = 0, g = 0, b = 0, a = 0) {
|
|
542
|
-
this._$clearColorR = r;
|
|
543
|
-
this._$clearColorG = g;
|
|
544
|
-
this._$clearColorB = b;
|
|
545
|
-
this._$clearColorA = a;
|
|
546
|
-
this._$gl.clearColor(r, g, b, a);
|
|
547
|
-
}
|
|
548
|
-
/**
|
|
549
|
-
* @param {number} x
|
|
550
|
-
* @param {number} y
|
|
551
|
-
* @param {number} w
|
|
552
|
-
* @param {number} h
|
|
553
|
-
* @return {void}
|
|
554
|
-
* @method
|
|
555
|
-
* @public
|
|
556
|
-
*/
|
|
557
|
-
clearRect(x, y, w, h) {
|
|
558
|
-
this._$mask._$onClearRect();
|
|
559
|
-
this._$gl.enable(this._$gl.SCISSOR_TEST);
|
|
560
|
-
this._$gl.scissor(x, y, w, h);
|
|
561
|
-
this._$gl.clear(this._$gl.COLOR_BUFFER_BIT | this._$gl.STENCIL_BUFFER_BIT);
|
|
562
|
-
this._$gl.disable(this._$gl.SCISSOR_TEST);
|
|
563
|
-
}
|
|
564
|
-
/**
|
|
565
|
-
* @param {number} x
|
|
566
|
-
* @param {number} y
|
|
567
|
-
* @param {number} w
|
|
568
|
-
* @param {number} h
|
|
569
|
-
* @return {void}
|
|
570
|
-
* @method
|
|
571
|
-
* @public
|
|
572
|
-
*/
|
|
573
|
-
_$clearRectStencil(x, y, w, h) {
|
|
574
|
-
this._$mask._$onClearRect();
|
|
575
|
-
this._$gl.enable(this._$gl.SCISSOR_TEST);
|
|
576
|
-
this._$gl.scissor(x, y, w, h);
|
|
577
|
-
this._$gl.clear(this._$gl.STENCIL_BUFFER_BIT);
|
|
578
|
-
this._$gl.disable(this._$gl.SCISSOR_TEST);
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* @param {number} x
|
|
582
|
-
* @param {number} y
|
|
583
|
-
* @return {void}
|
|
584
|
-
* @method
|
|
585
|
-
* @public
|
|
586
|
-
*/
|
|
587
|
-
moveTo(x, y) {
|
|
588
|
-
this._$path.moveTo(x, y);
|
|
589
|
-
}
|
|
590
|
-
/**
|
|
591
|
-
* @param {number} x
|
|
592
|
-
* @param {number} y
|
|
593
|
-
* @return {void}
|
|
594
|
-
* @method
|
|
595
|
-
* @public
|
|
596
|
-
*/
|
|
597
|
-
lineTo(x, y) {
|
|
598
|
-
this._$path.lineTo(x, y);
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* @return {void}
|
|
602
|
-
* @method
|
|
603
|
-
* @public
|
|
604
|
-
*/
|
|
605
|
-
beginPath() {
|
|
606
|
-
this._$path.begin();
|
|
607
|
-
}
|
|
608
|
-
/**
|
|
609
|
-
* @param {number} cx
|
|
610
|
-
* @param {number} cy
|
|
611
|
-
* @param {number} x
|
|
612
|
-
* @param {number} y
|
|
613
|
-
* @return {void}
|
|
614
|
-
* @method
|
|
615
|
-
* @public
|
|
616
|
-
*/
|
|
617
|
-
quadraticCurveTo(cx, cy, x, y) {
|
|
618
|
-
this._$path.quadTo(cx, cy, x, y);
|
|
619
|
-
}
|
|
620
|
-
/**
|
|
621
|
-
* @param {number} cp1x
|
|
622
|
-
* @param {number} cp1y
|
|
623
|
-
* @param {number} cp2x
|
|
624
|
-
* @param {number} cp2y
|
|
625
|
-
* @param {number} dx
|
|
626
|
-
* @param {number} dy
|
|
627
|
-
* @return {void}
|
|
628
|
-
* @method
|
|
629
|
-
* @public
|
|
630
|
-
*/
|
|
631
|
-
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, dx, dy) {
|
|
632
|
-
this._$path.cubicTo(cp1x, cp1y, cp2x, cp2y, dx, dy);
|
|
633
|
-
}
|
|
634
|
-
/**
|
|
635
|
-
* @return {void}
|
|
636
|
-
* @method
|
|
637
|
-
* @public
|
|
638
|
-
*/
|
|
639
|
-
fill() {
|
|
640
|
-
// to triangle
|
|
641
|
-
const fillVertices = this._$path.vertices;
|
|
642
|
-
if (!fillVertices.length) {
|
|
643
|
-
return;
|
|
644
|
-
}
|
|
645
|
-
const checkVertices = $getArray();
|
|
646
|
-
for (let idx = 0; idx < fillVertices.length; ++idx) {
|
|
647
|
-
const vertices = fillVertices[idx];
|
|
648
|
-
if (10 > vertices.length) {
|
|
649
|
-
continue;
|
|
650
|
-
}
|
|
651
|
-
checkVertices.push(vertices);
|
|
652
|
-
}
|
|
653
|
-
if (!checkVertices.length) {
|
|
654
|
-
$poolArray(checkVertices);
|
|
655
|
-
return;
|
|
656
|
-
}
|
|
657
|
-
const fillVertexArrayObject = this._$vao.createFill(checkVertices);
|
|
658
|
-
const fillStyle = this.fillStyle;
|
|
659
|
-
let matrix = this._$matrix;
|
|
660
|
-
let texture;
|
|
661
|
-
let variants;
|
|
662
|
-
let shader;
|
|
663
|
-
const hasGrid = this._$grid.enabled;
|
|
664
|
-
if (fillStyle instanceof CanvasGradientToWebGL) {
|
|
665
|
-
const stops = fillStyle.stops;
|
|
666
|
-
const isLinearSpace = fillStyle.rgb === "linearRGB";
|
|
667
|
-
texture = this
|
|
668
|
-
._$gradientLUT
|
|
669
|
-
.generateForShape(stops, isLinearSpace);
|
|
670
|
-
this
|
|
671
|
-
._$frameBufferManager
|
|
672
|
-
.textureManager
|
|
673
|
-
.bind0(texture, true);
|
|
674
|
-
variants = this
|
|
675
|
-
._$shaderList
|
|
676
|
-
.gradientShapeShaderVariants;
|
|
677
|
-
if (fillStyle.type === "linear") {
|
|
678
|
-
shader = variants
|
|
679
|
-
.getGradientShapeShader(false, hasGrid, false, false, fillStyle.mode);
|
|
680
|
-
variants.setGradientShapeUniform(shader.uniform, false, 0, 0, 0, hasGrid, matrix, $inverseMatrix(this._$matrix), this._$viewportWidth, this._$viewportHeight, this._$grid, false, fillStyle.points, 0);
|
|
681
|
-
}
|
|
682
|
-
else {
|
|
683
|
-
matrix = this._$stack[this._$stack.length - 1];
|
|
684
|
-
const hasFocalPoint = fillStyle.focalPointRatio !== 0;
|
|
685
|
-
shader = variants
|
|
686
|
-
.getGradientShapeShader(false, hasGrid, true, hasFocalPoint, fillStyle.mode);
|
|
687
|
-
variants.setGradientShapeUniform(shader.uniform, false, 0, 0, 0, hasGrid, matrix, $inverseMatrix(this._$matrix), this._$viewportWidth, this._$viewportHeight, this._$grid, true, fillStyle.points, fillStyle.focalPointRatio);
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
else if (fillStyle instanceof CanvasPatternToWebGL) {
|
|
691
|
-
matrix = this._$stack[this._$stack.length - 1];
|
|
692
|
-
const pct = fillStyle.colorTransform;
|
|
693
|
-
texture = fillStyle.texture;
|
|
694
|
-
this
|
|
695
|
-
._$frameBufferManager
|
|
696
|
-
.textureManager
|
|
697
|
-
.bind0(texture, this._$imageSmoothingEnabled);
|
|
698
|
-
variants = this
|
|
699
|
-
._$shaderList
|
|
700
|
-
.shapeShaderVariants;
|
|
701
|
-
shader = variants
|
|
702
|
-
.getBitmapShapeShader(false, fillStyle.repeat, hasGrid);
|
|
703
|
-
if (pct) {
|
|
704
|
-
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);
|
|
705
|
-
}
|
|
706
|
-
else {
|
|
707
|
-
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);
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
else {
|
|
711
|
-
variants = this
|
|
712
|
-
._$shaderList
|
|
713
|
-
.shapeShaderVariants;
|
|
714
|
-
shader = variants
|
|
715
|
-
.getSolidColorShapeShader(false, this._$grid.enabled);
|
|
716
|
-
variants.setSolidColorShapeUniform(shader.uniform, false, 0, 0, 0, hasGrid, matrix, this._$viewportWidth, this._$viewportHeight, this._$grid, fillStyle, this._$globalAlpha);
|
|
717
|
-
}
|
|
718
|
-
const coverageVariants = this
|
|
719
|
-
._$shaderList
|
|
720
|
-
.shapeShaderVariants;
|
|
721
|
-
const coverageShader = coverageVariants
|
|
722
|
-
.getMaskShapeShader(false, hasGrid);
|
|
723
|
-
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);
|
|
724
|
-
// mask on
|
|
725
|
-
this._$gl.enable(this._$gl.STENCIL_TEST);
|
|
726
|
-
this._$gl.stencilMask(0xff);
|
|
727
|
-
// draw shape
|
|
728
|
-
this._$gl.enable(this._$gl.SAMPLE_ALPHA_TO_COVERAGE);
|
|
729
|
-
this._$gl.stencilFunc(this._$gl.ALWAYS, 0, 0xff);
|
|
730
|
-
this._$gl.stencilOp(this._$gl.KEEP, this._$gl.INVERT, this._$gl.INVERT);
|
|
731
|
-
this._$gl.colorMask(false, false, false, false);
|
|
732
|
-
coverageShader._$fill(fillVertexArrayObject);
|
|
733
|
-
this._$gl.disable(this._$gl.SAMPLE_ALPHA_TO_COVERAGE);
|
|
734
|
-
// draw shape range
|
|
735
|
-
this._$gl.stencilFunc(this._$gl.NOTEQUAL, 0, 0xff);
|
|
736
|
-
this._$gl.stencilOp(this._$gl.KEEP, this._$gl.ZERO, this._$gl.ZERO);
|
|
737
|
-
this._$gl.colorMask(true, true, true, true);
|
|
738
|
-
shader._$fill(fillVertexArrayObject);
|
|
739
|
-
// mask off
|
|
740
|
-
this._$gl.disable(this._$gl.STENCIL_TEST);
|
|
741
|
-
// release vertex array
|
|
742
|
-
this.releaseFillVertexArray(fillVertexArrayObject);
|
|
743
|
-
}
|
|
744
|
-
/**
|
|
745
|
-
* @param {WebGLVertexArrayObject} vertex_array
|
|
746
|
-
* @return {void}
|
|
747
|
-
* @method
|
|
748
|
-
* @public
|
|
749
|
-
*/
|
|
750
|
-
releaseFillVertexArray(vertex_array) {
|
|
751
|
-
// release shape vertex array object
|
|
752
|
-
this._$vao.releaseFill(vertex_array);
|
|
753
|
-
const indexRanges = vertex_array.indexRanges;
|
|
754
|
-
for (let idx = 0; idx < indexRanges.length; ++idx) {
|
|
755
|
-
WebGLFillMeshGenerator
|
|
756
|
-
.indexRangePool
|
|
757
|
-
.push(indexRanges[idx]);
|
|
758
|
-
}
|
|
759
|
-
$poolArray(indexRanges);
|
|
760
|
-
}
|
|
761
|
-
/**
|
|
762
|
-
* @return {void}
|
|
763
|
-
* @method
|
|
764
|
-
* @public
|
|
765
|
-
*/
|
|
766
|
-
_$enterClip() {
|
|
767
|
-
this._$mask._$enterClip();
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
* @return {void}
|
|
771
|
-
* @method
|
|
772
|
-
* @public
|
|
773
|
-
*/
|
|
774
|
-
_$beginClipDef() {
|
|
775
|
-
this._$mask._$beginClipDef();
|
|
776
|
-
}
|
|
777
|
-
/**
|
|
778
|
-
* @param {boolean} flag
|
|
779
|
-
* @return {void}
|
|
780
|
-
* @method
|
|
781
|
-
* @private
|
|
782
|
-
*/
|
|
783
|
-
_$updateContainerClipFlag(flag) {
|
|
784
|
-
this._$mask.containerClip = flag;
|
|
785
|
-
}
|
|
786
|
-
/**
|
|
787
|
-
* @description マスク処理の開始関数
|
|
788
|
-
* Mask processing start function
|
|
789
|
-
*
|
|
790
|
-
* @param {Float32Array} matrix
|
|
791
|
-
* @param {object} bounds
|
|
792
|
-
* @return {Float32Array}
|
|
793
|
-
* @method
|
|
794
|
-
* @public
|
|
795
|
-
*/
|
|
796
|
-
_$startClip(matrix, bounds) {
|
|
797
|
-
let x = bounds.xMin;
|
|
798
|
-
let y = bounds.yMin;
|
|
799
|
-
let width = Math.abs(bounds.xMax - bounds.xMin);
|
|
800
|
-
let height = Math.abs(bounds.yMax - bounds.yMin);
|
|
801
|
-
// resize
|
|
802
|
-
const manager = this._$frameBufferManager;
|
|
803
|
-
const currentAttachment = manager.currentAttachment;
|
|
804
|
-
if (!currentAttachment || !currentAttachment.texture) {
|
|
805
|
-
throw new Error("the current Attachment is null.");
|
|
806
|
-
}
|
|
807
|
-
if (x > currentAttachment.width
|
|
808
|
-
|| y > currentAttachment.height) {
|
|
809
|
-
return null;
|
|
810
|
-
}
|
|
811
|
-
if (width + x > currentAttachment.width) {
|
|
812
|
-
width = currentAttachment.width - x;
|
|
813
|
-
}
|
|
814
|
-
if (height + y > currentAttachment.height) {
|
|
815
|
-
height = currentAttachment.height - y;
|
|
816
|
-
}
|
|
817
|
-
if (0 > x) {
|
|
818
|
-
width += x;
|
|
819
|
-
x = 0;
|
|
820
|
-
}
|
|
821
|
-
if (0 > y) {
|
|
822
|
-
height += y;
|
|
823
|
-
y = 0;
|
|
824
|
-
}
|
|
825
|
-
if (0 >= width || 0 >= height) {
|
|
826
|
-
return null;
|
|
827
|
-
}
|
|
828
|
-
width = $Math.ceil(width);
|
|
829
|
-
height = $Math.ceil(height);
|
|
830
|
-
this._$cacheBounds.xMin = x;
|
|
831
|
-
this._$cacheBounds.yMin = y;
|
|
832
|
-
this._$cacheBounds.xMax = width;
|
|
833
|
-
this._$cacheBounds.yMax = height;
|
|
834
|
-
this._$cacheAttachment = currentAttachment;
|
|
835
|
-
// create new buffer
|
|
836
|
-
this._$bind(manager.createCacheAttachment(width, height, true));
|
|
837
|
-
// draw background
|
|
838
|
-
const texture = currentAttachment.texture;
|
|
839
|
-
this.reset();
|
|
840
|
-
this.setTransform(1, 0, 0, 1, 0, 0);
|
|
841
|
-
this.drawImage(texture, -x, -y, texture.width, texture.height);
|
|
842
|
-
return $getFloat32Array6(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4] - bounds.xMin, matrix[5] - bounds.yMin);
|
|
843
|
-
}
|
|
844
|
-
/**
|
|
845
|
-
* @return {void}
|
|
846
|
-
* @method
|
|
847
|
-
* @public
|
|
848
|
-
*/
|
|
849
|
-
_$endClipDef() {
|
|
850
|
-
this._$mask._$endClipDef();
|
|
851
|
-
}
|
|
852
|
-
/**
|
|
853
|
-
* @return {void}
|
|
854
|
-
* @method
|
|
855
|
-
* @public
|
|
856
|
-
*/
|
|
857
|
-
_$leaveClip() {
|
|
858
|
-
this._$mask._$leaveClip();
|
|
859
|
-
}
|
|
860
|
-
/**
|
|
861
|
-
* @return {void}
|
|
862
|
-
* @method
|
|
863
|
-
* @public
|
|
864
|
-
*/
|
|
865
|
-
_$drawContainerClip() {
|
|
866
|
-
this._$mask._$drawContainerClip();
|
|
867
|
-
}
|
|
868
|
-
/**
|
|
869
|
-
* @return {void}
|
|
870
|
-
* @method
|
|
871
|
-
* @public
|
|
872
|
-
*/
|
|
873
|
-
closePath() {
|
|
874
|
-
this._$path.close();
|
|
875
|
-
}
|
|
876
|
-
/**
|
|
877
|
-
* @return {void}
|
|
878
|
-
* @method
|
|
879
|
-
* @public
|
|
880
|
-
*/
|
|
881
|
-
stroke() {
|
|
882
|
-
const strokeVertices = this._$path.vertices;
|
|
883
|
-
if (!strokeVertices.length) {
|
|
884
|
-
return;
|
|
885
|
-
}
|
|
886
|
-
const checkVertices = $getArray();
|
|
887
|
-
for (let idx = 0; idx < strokeVertices.length; ++idx) {
|
|
888
|
-
const vertices = strokeVertices[idx];
|
|
889
|
-
if (6 > vertices.length) {
|
|
890
|
-
continue;
|
|
891
|
-
}
|
|
892
|
-
checkVertices.push(vertices);
|
|
893
|
-
}
|
|
894
|
-
if (!checkVertices.length) {
|
|
895
|
-
$poolArray(checkVertices);
|
|
896
|
-
return;
|
|
897
|
-
}
|
|
898
|
-
const strokeBuffer = this._$vao.createStroke(strokeVertices, this.lineCap, this.lineJoin);
|
|
899
|
-
let matrix = this._$matrix;
|
|
900
|
-
const strokeStyle = this.strokeStyle;
|
|
901
|
-
let face = $Math.sign(matrix[0] * matrix[4]);
|
|
902
|
-
if (face > 0 && matrix[1] !== 0 && matrix[3] !== 0) {
|
|
903
|
-
face = -$Math.sign(matrix[1] * matrix[3]);
|
|
904
|
-
}
|
|
905
|
-
let lineWidth = this.lineWidth * 0.5;
|
|
906
|
-
let scaleX;
|
|
907
|
-
let scaleY;
|
|
908
|
-
if (this._$grid.enabled) {
|
|
909
|
-
// lineWidth *= $getSameScaleBase();
|
|
910
|
-
scaleX = $Math.abs(this._$grid.ancestorMatrixA + this._$grid.ancestorMatrixD);
|
|
911
|
-
scaleY = $Math.abs(this._$grid.ancestorMatrixB + this._$grid.ancestorMatrixE);
|
|
912
|
-
}
|
|
913
|
-
else {
|
|
914
|
-
scaleX = $Math.abs(matrix[0] + matrix[3]);
|
|
915
|
-
scaleY = $Math.abs(matrix[1] + matrix[4]);
|
|
916
|
-
}
|
|
917
|
-
const scaleMin = $Math.min(scaleX, scaleY);
|
|
918
|
-
const scaleMax = $Math.max(scaleX, scaleY);
|
|
919
|
-
lineWidth *= scaleMax * (1 - 0.3 * $Math.cos($Math.PI * 0.5 * (scaleMin / scaleMax)));
|
|
920
|
-
lineWidth = $Math.max(1, lineWidth);
|
|
921
|
-
const hasGrid = this._$grid.enabled;
|
|
922
|
-
let texture;
|
|
923
|
-
let variants;
|
|
924
|
-
let shader;
|
|
925
|
-
if (strokeStyle instanceof CanvasGradientToWebGL) {
|
|
926
|
-
if (strokeStyle.type === "radial") {
|
|
927
|
-
matrix = this._$stack[this._$stack.length - 1];
|
|
928
|
-
}
|
|
929
|
-
const stops = strokeStyle.stops;
|
|
930
|
-
const isLinearSpace = strokeStyle.rgb === "linearRGB";
|
|
931
|
-
texture = this
|
|
932
|
-
._$gradientLUT
|
|
933
|
-
.generateForShape(stops, isLinearSpace);
|
|
934
|
-
this
|
|
935
|
-
._$frameBufferManager
|
|
936
|
-
.textureManager
|
|
937
|
-
.bind0(texture, true);
|
|
938
|
-
variants = this
|
|
939
|
-
._$shaderList
|
|
940
|
-
.gradientShapeShaderVariants;
|
|
941
|
-
if (strokeStyle.type === "linear") {
|
|
942
|
-
shader = variants
|
|
943
|
-
.getGradientShapeShader(true, hasGrid, false, false, strokeStyle.mode);
|
|
944
|
-
variants.setGradientShapeUniform(shader.uniform, true, lineWidth, face, this.miterLimit, hasGrid, matrix, $inverseMatrix(this._$matrix), this._$viewportWidth, this._$viewportHeight, this._$grid, false, strokeStyle.points, 0);
|
|
945
|
-
}
|
|
946
|
-
else {
|
|
947
|
-
matrix = this._$stack[this._$stack.length - 1];
|
|
948
|
-
const hasFocalPoint = strokeStyle.focalPointRatio !== 0;
|
|
949
|
-
shader = variants
|
|
950
|
-
.getGradientShapeShader(true, hasGrid, true, hasFocalPoint, strokeStyle.mode);
|
|
951
|
-
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);
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
else if (strokeStyle instanceof CanvasPatternToWebGL) {
|
|
955
|
-
matrix = this._$stack[this._$stack.length - 1];
|
|
956
|
-
const pct = strokeStyle.colorTransform;
|
|
957
|
-
texture = strokeStyle.texture;
|
|
958
|
-
this
|
|
959
|
-
._$frameBufferManager
|
|
960
|
-
.textureManager
|
|
961
|
-
.bind0(texture);
|
|
962
|
-
variants = this
|
|
963
|
-
._$shaderList
|
|
964
|
-
.shapeShaderVariants;
|
|
965
|
-
shader = variants
|
|
966
|
-
.getBitmapShapeShader(true, strokeStyle.repeat, this._$grid.enabled);
|
|
967
|
-
if (pct) {
|
|
968
|
-
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);
|
|
969
|
-
}
|
|
970
|
-
else {
|
|
971
|
-
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);
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
else {
|
|
975
|
-
variants = this
|
|
976
|
-
._$shaderList
|
|
977
|
-
.shapeShaderVariants;
|
|
978
|
-
shader = variants
|
|
979
|
-
.getSolidColorShapeShader(true, this._$grid.enabled);
|
|
980
|
-
variants.setSolidColorShapeUniform(shader.uniform, true, lineWidth, face, this.miterLimit, hasGrid, matrix, this._$viewportWidth, this._$viewportHeight, this._$grid, strokeStyle, this._$globalAlpha);
|
|
981
|
-
}
|
|
982
|
-
shader._$stroke(strokeBuffer);
|
|
983
|
-
this._$vao.releaseStroke(strokeBuffer);
|
|
984
|
-
}
|
|
985
|
-
/**
|
|
986
|
-
* @param {number} x
|
|
987
|
-
* @param {number} y
|
|
988
|
-
* @param {number} radius
|
|
989
|
-
* @return {void}
|
|
990
|
-
* @method
|
|
991
|
-
* @public
|
|
992
|
-
*/
|
|
993
|
-
arc(x, y, radius) {
|
|
994
|
-
this._$path.drawCircle(x, y, radius);
|
|
995
|
-
}
|
|
996
|
-
/**
|
|
997
|
-
* @return {void}
|
|
998
|
-
* @method
|
|
999
|
-
* @public
|
|
1000
|
-
*/
|
|
1001
|
-
clip() {
|
|
1002
|
-
// to triangle
|
|
1003
|
-
const fillVertices = this._$path.vertices;
|
|
1004
|
-
if (!fillVertices.length) {
|
|
1005
|
-
return;
|
|
1006
|
-
}
|
|
1007
|
-
const checkVertices = $getArray();
|
|
1008
|
-
for (let idx = 0; idx < fillVertices.length; ++idx) {
|
|
1009
|
-
const vertices = fillVertices[idx];
|
|
1010
|
-
if (10 > vertices.length) {
|
|
1011
|
-
continue;
|
|
1012
|
-
}
|
|
1013
|
-
checkVertices.push(vertices);
|
|
1014
|
-
}
|
|
1015
|
-
if (!checkVertices.length) {
|
|
1016
|
-
$poolArray(checkVertices);
|
|
1017
|
-
return;
|
|
1018
|
-
}
|
|
1019
|
-
const fillVertexArrayObject = this._$vao.createFill(checkVertices);
|
|
1020
|
-
// mask render
|
|
1021
|
-
const variants = this
|
|
1022
|
-
._$shaderList
|
|
1023
|
-
.shapeShaderVariants;
|
|
1024
|
-
const shader = variants.getMaskShapeShader(false, false);
|
|
1025
|
-
const uniform = shader.uniform;
|
|
1026
|
-
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);
|
|
1027
|
-
if (this._$mask._$onClip(fillVertexArrayObject, this._$matrix, this._$viewportWidth, this._$viewportHeight)) {
|
|
1028
|
-
return;
|
|
1029
|
-
}
|
|
1030
|
-
shader._$fill(fillVertexArrayObject);
|
|
1031
|
-
this.beginPath();
|
|
1032
|
-
}
|
|
1033
|
-
/**
|
|
1034
|
-
* @return {void}
|
|
1035
|
-
* @method
|
|
1036
|
-
* @public
|
|
1037
|
-
*/
|
|
1038
|
-
save() {
|
|
1039
|
-
// matrix
|
|
1040
|
-
const matrix = this._$matrix;
|
|
1041
|
-
this._$stack.push($getFloat32Array9(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]));
|
|
1042
|
-
// mask
|
|
1043
|
-
this._$mask._$onSave();
|
|
1044
|
-
}
|
|
1045
|
-
/**
|
|
1046
|
-
* @return {void}
|
|
1047
|
-
* @method
|
|
1048
|
-
* @public
|
|
1049
|
-
*/
|
|
1050
|
-
restore() {
|
|
1051
|
-
//matrix
|
|
1052
|
-
if (this._$stack.length) {
|
|
1053
|
-
$poolFloat32Array9(this._$matrix);
|
|
1054
|
-
this._$matrix = this._$stack.pop() || $getFloat32Array9();
|
|
1055
|
-
}
|
|
1056
|
-
// mask
|
|
1057
|
-
this._$mask._$onRestore();
|
|
1058
|
-
}
|
|
1059
|
-
/**
|
|
1060
|
-
* @param {WebGLTexture} texture
|
|
1061
|
-
* @param {boolean} repeat
|
|
1062
|
-
* @param {Float32Array} color_transform
|
|
1063
|
-
* @return {CanvasPatternToWebGL}
|
|
1064
|
-
* @method
|
|
1065
|
-
* @public
|
|
1066
|
-
*/
|
|
1067
|
-
createPattern(texture, repeat, color_transform) {
|
|
1068
|
-
return new CanvasPatternToWebGL(this, texture, repeat, color_transform);
|
|
1069
|
-
}
|
|
1070
|
-
/**
|
|
1071
|
-
* @param {number} x0
|
|
1072
|
-
* @param {number} y0
|
|
1073
|
-
* @param {number} x1
|
|
1074
|
-
* @param {number} y1
|
|
1075
|
-
* @param {string} [rgb=InterpolationMethod.RGB]
|
|
1076
|
-
* @param {string} [mode=SpreadMethod.PAD]
|
|
1077
|
-
* @return {CanvasGradientToWebGL}
|
|
1078
|
-
* @method
|
|
1079
|
-
* @public
|
|
1080
|
-
*/
|
|
1081
|
-
createLinearGradient(x0, y0, x1, y1, rgb = "rgb", mode = "pad") {
|
|
1082
|
-
return new CanvasGradientToWebGL()
|
|
1083
|
-
.linear(x0, y0, x1, y1, rgb, mode);
|
|
1084
|
-
}
|
|
1085
|
-
/**
|
|
1086
|
-
* @param {number} x0
|
|
1087
|
-
* @param {number} y0
|
|
1088
|
-
* @param {number} r0
|
|
1089
|
-
* @param {number} x1
|
|
1090
|
-
* @param {number} y1
|
|
1091
|
-
* @param {number} r1
|
|
1092
|
-
* @param {string} [rgb=InterpolationMethod.RGB]
|
|
1093
|
-
* @param {string} [mode=SpreadMethod.PAD]
|
|
1094
|
-
* @param {number} [focal_point_ratio=0]
|
|
1095
|
-
* @return {CanvasGradientToWebGL}
|
|
1096
|
-
* @method
|
|
1097
|
-
* @public
|
|
1098
|
-
*/
|
|
1099
|
-
createRadialGradient(x0, y0, r0, x1, y1, r1, rgb = "rgb", mode = "pad", focal_point_ratio = 0) {
|
|
1100
|
-
return new CanvasGradientToWebGL()
|
|
1101
|
-
.radial(x0, y0, r0, x1, y1, r1, rgb, mode, focal_point_ratio);
|
|
1102
|
-
}
|
|
1103
|
-
/**
|
|
1104
|
-
* @param {WebGLTexture} texture
|
|
1105
|
-
* @param {boolean} is_horizontal
|
|
1106
|
-
* @param {number} blur
|
|
1107
|
-
* @return {void}
|
|
1108
|
-
* @method
|
|
1109
|
-
* @public
|
|
1110
|
-
*/
|
|
1111
|
-
_$applyBlurFilter(texture, is_horizontal, blur) {
|
|
1112
|
-
const manager = this._$frameBufferManager;
|
|
1113
|
-
const currentAttachment = manager.currentAttachment;
|
|
1114
|
-
if (!currentAttachment) {
|
|
1115
|
-
throw new Error("the current attachment is null.");
|
|
1116
|
-
}
|
|
1117
|
-
const width = currentAttachment.width;
|
|
1118
|
-
const height = currentAttachment.height;
|
|
1119
|
-
manager
|
|
1120
|
-
.textureManager
|
|
1121
|
-
.bind0(texture, true);
|
|
1122
|
-
const halfBlur = $Math.ceil(blur * 0.5);
|
|
1123
|
-
const fraction = 1 - (halfBlur - blur * 0.5);
|
|
1124
|
-
const samples = 1 + blur;
|
|
1125
|
-
const variants = this
|
|
1126
|
-
._$shaderList
|
|
1127
|
-
.filterShaderVariants;
|
|
1128
|
-
const shader = variants
|
|
1129
|
-
.getBlurFilterShader(halfBlur);
|
|
1130
|
-
variants
|
|
1131
|
-
.setBlurFilterUniform(shader.uniform, width, height, is_horizontal, fraction, samples);
|
|
1132
|
-
shader._$drawImage();
|
|
1133
|
-
}
|
|
1134
|
-
/**
|
|
1135
|
-
* @param {WebGLTexture} texture
|
|
1136
|
-
* @param {number} width
|
|
1137
|
-
* @param {number} height
|
|
1138
|
-
* @param {number} base_width
|
|
1139
|
-
* @param {number} base_height
|
|
1140
|
-
* @param {number} base_offset_x
|
|
1141
|
-
* @param {number} base_offset_y
|
|
1142
|
-
* @param {number} blur_width
|
|
1143
|
-
* @param {number} blur_height
|
|
1144
|
-
* @param {number} blur_offset_x
|
|
1145
|
-
* @param {number} blur_offset_y
|
|
1146
|
-
* @param {boolean} is_glow
|
|
1147
|
-
* @param {string} type
|
|
1148
|
-
* @param {boolean} knockout
|
|
1149
|
-
* @param {number} strength
|
|
1150
|
-
* @param {array | null} [ratios = null]
|
|
1151
|
-
* @param {array | null} [colors = null]
|
|
1152
|
-
* @param {array | null} [alphas = null]
|
|
1153
|
-
* @param {number} [color_r1 = 0]
|
|
1154
|
-
* @param {number} [color_g1 = 0]
|
|
1155
|
-
* @param {number} [color_b1 = 0]
|
|
1156
|
-
* @param {number} [color_a1 = 0]
|
|
1157
|
-
* @param {number} [color_r2 = 0]
|
|
1158
|
-
* @param {number} [color_g2 = 0]
|
|
1159
|
-
* @param {number} [color_b2 = 0]
|
|
1160
|
-
* @param {number} [color_a2 = 0]
|
|
1161
|
-
* @return {void}
|
|
1162
|
-
* @method
|
|
1163
|
-
* @public
|
|
1164
|
-
*/
|
|
1165
|
-
_$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) {
|
|
1166
|
-
const manager = this._$frameBufferManager;
|
|
1167
|
-
const isInner = type === "inner";
|
|
1168
|
-
const baseAttachment = manager.currentAttachment;
|
|
1169
|
-
const baseTexture = manager.getTextureFromCurrentAttachment();
|
|
1170
|
-
let lut = null;
|
|
1171
|
-
const isGradient = ratios !== null && colors !== null && alphas !== null;
|
|
1172
|
-
if (ratios !== null && colors !== null && alphas !== null) {
|
|
1173
|
-
lut = this
|
|
1174
|
-
._$gradientLUT
|
|
1175
|
-
.generateForFilter(ratios, colors, alphas);
|
|
1176
|
-
}
|
|
1177
|
-
let targetTextureAttachment;
|
|
1178
|
-
if (isInner) {
|
|
1179
|
-
if (isGradient && lut) {
|
|
1180
|
-
manager
|
|
1181
|
-
.textureManager
|
|
1182
|
-
.bind02(texture, lut, true);
|
|
1183
|
-
}
|
|
1184
|
-
else {
|
|
1185
|
-
manager
|
|
1186
|
-
.textureManager
|
|
1187
|
-
.bind0(texture);
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
else {
|
|
1191
|
-
targetTextureAttachment = this
|
|
1192
|
-
._$frameBufferManager
|
|
1193
|
-
.createTextureAttachment(width, height);
|
|
1194
|
-
this._$bind(targetTextureAttachment);
|
|
1195
|
-
if (isGradient && lut) {
|
|
1196
|
-
manager
|
|
1197
|
-
.textureManager
|
|
1198
|
-
.bind012(texture, baseTexture, lut, true);
|
|
1199
|
-
}
|
|
1200
|
-
else {
|
|
1201
|
-
manager
|
|
1202
|
-
.textureManager
|
|
1203
|
-
.bind01(texture, baseTexture);
|
|
1204
|
-
}
|
|
1205
|
-
}
|
|
1206
|
-
const transformsBase = !(isInner || type === "full" && knockout);
|
|
1207
|
-
const transformsBlur = !(width === blur_width && height === blur_height && blur_offset_x === 0 && blur_offset_y === 0);
|
|
1208
|
-
const appliesStrength = !(strength === 1);
|
|
1209
|
-
const variants = this
|
|
1210
|
-
._$shaderList
|
|
1211
|
-
.filterShaderVariants;
|
|
1212
|
-
const shader = variants.getBitmapFilterShader(transformsBase, transformsBlur, is_glow, type, knockout, appliesStrength, isGradient);
|
|
1213
|
-
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);
|
|
1214
|
-
if (!isInner) {
|
|
1215
|
-
this.blend.toOneZero();
|
|
1216
|
-
}
|
|
1217
|
-
else if (knockout) {
|
|
1218
|
-
this.blend.toSourceIn();
|
|
1219
|
-
}
|
|
1220
|
-
else {
|
|
1221
|
-
this.blend.toSourceAtop();
|
|
1222
|
-
}
|
|
1223
|
-
shader._$drawImage();
|
|
1224
|
-
if (!isInner) {
|
|
1225
|
-
manager
|
|
1226
|
-
.releaseAttachment(baseAttachment, true);
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
/**
|
|
1230
|
-
* @param {WebGLTexture} texture
|
|
1231
|
-
* @param {array} matrix
|
|
1232
|
-
* @return {void}
|
|
1233
|
-
* @method
|
|
1234
|
-
* @public
|
|
1235
|
-
*/
|
|
1236
|
-
_$applyColorMatrixFilter(texture, matrix) {
|
|
1237
|
-
this
|
|
1238
|
-
._$frameBufferManager
|
|
1239
|
-
.textureManager
|
|
1240
|
-
.bind0(texture, true);
|
|
1241
|
-
const variants = this
|
|
1242
|
-
._$shaderList
|
|
1243
|
-
.filterShaderVariants;
|
|
1244
|
-
const shader = variants
|
|
1245
|
-
.getColorMatrixFilterShader();
|
|
1246
|
-
variants
|
|
1247
|
-
.setColorMatrixFilterUniform(shader.uniform, matrix);
|
|
1248
|
-
this.blend.reset();
|
|
1249
|
-
shader._$drawImage();
|
|
1250
|
-
}
|
|
1251
|
-
/**
|
|
1252
|
-
* @param {WebGLTexture} texture
|
|
1253
|
-
* @param {number} matrix_x
|
|
1254
|
-
* @param {number} matrix_y
|
|
1255
|
-
* @param {Float32Array} matrix
|
|
1256
|
-
* @param {number} divisor
|
|
1257
|
-
* @param {number} bias
|
|
1258
|
-
* @param {boolean} preserve_alpha
|
|
1259
|
-
* @param {boolean} clamp
|
|
1260
|
-
* @param {number} color_r
|
|
1261
|
-
* @param {number} color_g
|
|
1262
|
-
* @param {number} color_b
|
|
1263
|
-
* @param {number} color_a
|
|
1264
|
-
* @return {void}
|
|
1265
|
-
* @method
|
|
1266
|
-
* @public
|
|
1267
|
-
*/
|
|
1268
|
-
_$applyConvolutionFilter(texture, matrix_x, matrix_y, matrix, divisor, bias, preserve_alpha, clamp, color_r, color_g, color_b, color_a) {
|
|
1269
|
-
const width = texture.width;
|
|
1270
|
-
const height = texture.height;
|
|
1271
|
-
const targetTextureAttachment = this
|
|
1272
|
-
._$frameBufferManager
|
|
1273
|
-
.createTextureAttachment(width, height);
|
|
1274
|
-
this._$bind(targetTextureAttachment);
|
|
1275
|
-
this
|
|
1276
|
-
._$frameBufferManager
|
|
1277
|
-
.textureManager
|
|
1278
|
-
.bind0(texture, true);
|
|
1279
|
-
const variants = this
|
|
1280
|
-
._$shaderList
|
|
1281
|
-
.filterShaderVariants;
|
|
1282
|
-
const shader = variants
|
|
1283
|
-
.getConvolutionFilterShader(matrix_x, matrix_y, preserve_alpha, clamp);
|
|
1284
|
-
variants.setConvolutionFilterUniform(shader.uniform, width, height, matrix, divisor, bias, clamp, color_r, color_g, color_b, color_a);
|
|
1285
|
-
this.blend.reset();
|
|
1286
|
-
shader._$drawImage();
|
|
1287
|
-
}
|
|
1288
|
-
/**
|
|
1289
|
-
* @param {WebGLTexture} texture
|
|
1290
|
-
* @param {WebGLTexture} map
|
|
1291
|
-
* @param {number} base_width
|
|
1292
|
-
* @param {number} base_height
|
|
1293
|
-
* @param {PointImpl} [point=null]
|
|
1294
|
-
* @param {number} component_x
|
|
1295
|
-
* @param {number} component_y
|
|
1296
|
-
* @param {number} scale_x
|
|
1297
|
-
* @param {number} scale_y
|
|
1298
|
-
* @param {string} mode
|
|
1299
|
-
* @param {number} color_r
|
|
1300
|
-
* @param {number} color_g
|
|
1301
|
-
* @param {number} color_b
|
|
1302
|
-
* @param {number} color_a
|
|
1303
|
-
* @return {void}
|
|
1304
|
-
* @method
|
|
1305
|
-
* @private
|
|
1306
|
-
*/
|
|
1307
|
-
_$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) {
|
|
1308
|
-
const width = texture.width;
|
|
1309
|
-
const height = texture.height;
|
|
1310
|
-
const targetTextureAttachment = this
|
|
1311
|
-
._$frameBufferManager
|
|
1312
|
-
.createTextureAttachment(width, height);
|
|
1313
|
-
this._$bind(targetTextureAttachment);
|
|
1314
|
-
if (!point) {
|
|
1315
|
-
point = { "x": 0, "y": 0 };
|
|
1316
|
-
}
|
|
1317
|
-
this
|
|
1318
|
-
._$frameBufferManager
|
|
1319
|
-
.textureManager
|
|
1320
|
-
.bind01(texture, map);
|
|
1321
|
-
const variants = this
|
|
1322
|
-
._$shaderList
|
|
1323
|
-
.filterShaderVariants;
|
|
1324
|
-
const shader = variants
|
|
1325
|
-
.getDisplacementMapFilterShader(component_x, component_y, mode);
|
|
1326
|
-
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);
|
|
1327
|
-
this.blend.reset();
|
|
1328
|
-
shader._$drawImage();
|
|
1329
|
-
}
|
|
1330
|
-
/**
|
|
1331
|
-
* @param {BoundsImpl} position
|
|
1332
|
-
* @return {void}
|
|
1333
|
-
* @method
|
|
1334
|
-
* @private
|
|
1335
|
-
*/
|
|
1336
|
-
_$startLayer(position) {
|
|
1337
|
-
this._$positions.push(position);
|
|
1338
|
-
this._$blends.push(this._$isLayer);
|
|
1339
|
-
this._$isLayer = true;
|
|
1340
|
-
}
|
|
1341
|
-
/**
|
|
1342
|
-
* @return {void}
|
|
1343
|
-
* @method
|
|
1344
|
-
* @private
|
|
1345
|
-
*/
|
|
1346
|
-
_$endLayer() {
|
|
1347
|
-
const bounds = this._$positions.pop();
|
|
1348
|
-
if (bounds) {
|
|
1349
|
-
$poolBoundsObject(bounds);
|
|
1350
|
-
}
|
|
1351
|
-
this._$isLayer = !!this._$blends.pop();
|
|
1352
|
-
}
|
|
1353
|
-
/**
|
|
1354
|
-
* @return {void}
|
|
1355
|
-
* @method
|
|
1356
|
-
* @private
|
|
1357
|
-
*/
|
|
1358
|
-
_$saveCurrentMask() {
|
|
1359
|
-
this._$maskBufferArray.push(this._$cacheAttachment);
|
|
1360
|
-
this._$cacheAttachment = null;
|
|
1361
|
-
const bounds = this._$cacheBounds;
|
|
1362
|
-
this._$maskBoundsArray.push($getBoundsObject(bounds.xMin, bounds.xMax, bounds.yMin, bounds.yMax));
|
|
1363
|
-
}
|
|
1364
|
-
/**
|
|
1365
|
-
* @param {number} width
|
|
1366
|
-
* @param {number} height
|
|
1367
|
-
* @param {boolean} [multisample=false]
|
|
1368
|
-
* @return {void}
|
|
1369
|
-
* @method
|
|
1370
|
-
* @private
|
|
1371
|
-
*/
|
|
1372
|
-
_$saveAttachment(width, height, multisample = false) {
|
|
1373
|
-
const manager = this._$frameBufferManager;
|
|
1374
|
-
this
|
|
1375
|
-
._$attachmentArray
|
|
1376
|
-
.push(manager.currentAttachment);
|
|
1377
|
-
this._$bind(manager.createCacheAttachment(width, height, multisample));
|
|
1378
|
-
}
|
|
1379
|
-
/**
|
|
1380
|
-
* @return {void}
|
|
1381
|
-
* @method
|
|
1382
|
-
* @private
|
|
1383
|
-
*/
|
|
1384
|
-
_$restoreAttachment(release_texture = false) {
|
|
1385
|
-
const manager = this._$frameBufferManager;
|
|
1386
|
-
manager.releaseAttachment(manager.currentAttachment, release_texture);
|
|
1387
|
-
this._$bind(this._$attachmentArray.pop());
|
|
1388
|
-
}
|
|
1389
|
-
/**
|
|
1390
|
-
* @return {void}
|
|
1391
|
-
* @method
|
|
1392
|
-
* @private
|
|
1393
|
-
*/
|
|
1394
|
-
_$restoreCurrentMask() {
|
|
1395
|
-
this._$cacheAttachment = this._$maskBufferArray.pop() || null;
|
|
1396
|
-
this._$cacheBounds = this._$maskBoundsArray.pop() || $getBoundsObject();
|
|
1397
|
-
}
|
|
1398
|
-
/**
|
|
1399
|
-
* @return {object}
|
|
1400
|
-
* @method
|
|
1401
|
-
* @private
|
|
1402
|
-
*/
|
|
1403
|
-
getCurrentPosition() {
|
|
1404
|
-
return this._$positions[this._$positions.length - 1];
|
|
1405
|
-
}
|
|
1406
|
-
/**
|
|
1407
|
-
* @description 最大テクスチャサイズを超えないスケール値を取得する
|
|
1408
|
-
* @param {number} width
|
|
1409
|
-
* @param {number} height
|
|
1410
|
-
* @return {number}
|
|
1411
|
-
* @method
|
|
1412
|
-
* @public
|
|
1413
|
-
*/
|
|
1414
|
-
textureScale(width, height) {
|
|
1415
|
-
const maxSize = $Math.max(width, height);
|
|
1416
|
-
if (maxSize > this._$maxTextureSize) {
|
|
1417
|
-
return this._$maxTextureSize / maxSize;
|
|
1418
|
-
}
|
|
1419
|
-
return 1;
|
|
1420
|
-
}
|
|
1421
|
-
}
|