@next2d/player 1.14.6 → 1.14.8

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.
Files changed (415) hide show
  1. package/@types/next2d.d.ts +4 -0
  2. package/@types/window.d.ts +74 -0
  3. package/README.ja.md +8 -7
  4. package/README.md +17 -12
  5. package/dist/interface/AjaxEventImpl.d.ts +5 -0
  6. package/dist/interface/AjaxEventImpl.js +1 -0
  7. package/dist/interface/AjaxOptionImpl.d.ts +13 -0
  8. package/dist/interface/AjaxOptionImpl.js +1 -0
  9. package/dist/interface/AttachmentImpl.d.ts +11 -0
  10. package/dist/interface/AttachmentImpl.js +1 -0
  11. package/dist/interface/BitmapDataChannelImpl.d.ts +1 -0
  12. package/dist/interface/BitmapDataChannelImpl.js +1 -0
  13. package/dist/interface/BitmapDrawObjectImpl.d.ts +6 -0
  14. package/dist/interface/BitmapDrawObjectImpl.js +1 -0
  15. package/dist/interface/BitmapFilterTypeImpl.d.ts +1 -0
  16. package/dist/interface/BitmapFilterTypeImpl.js +1 -0
  17. package/dist/interface/BlendModeImpl.d.ts +1 -0
  18. package/dist/interface/BlendModeImpl.js +1 -0
  19. package/dist/interface/BoundsImpl.d.ts +6 -0
  20. package/dist/interface/BoundsImpl.js +1 -0
  21. package/dist/interface/Character.d.ts +2 -0
  22. package/dist/interface/Character.js +1 -0
  23. package/dist/interface/CharacterImpl.d.ts +2 -0
  24. package/dist/interface/CharacterImpl.js +1 -0
  25. package/dist/interface/ClassNameMap.d.ts +4 -0
  26. package/dist/interface/ClassNameMap.js +1 -0
  27. package/dist/interface/ClipObjectImpl.d.ts +14 -0
  28. package/dist/interface/ClipObjectImpl.js +1 -0
  29. package/dist/interface/ColorStopImpl.d.ts +7 -0
  30. package/dist/interface/ColorStopImpl.js +1 -0
  31. package/dist/interface/DictionaryTagImpl.d.ts +7 -0
  32. package/dist/interface/DictionaryTagImpl.js +1 -0
  33. package/dist/interface/DisplacementMapFilterModeImpl.d.ts +1 -0
  34. package/dist/interface/DisplacementMapFilterModeImpl.js +1 -0
  35. package/dist/interface/DisplayImpl.d.ts +28 -0
  36. package/dist/interface/DisplayImpl.js +1 -0
  37. package/dist/interface/DisplayObjectImpl.d.ts +2 -0
  38. package/dist/interface/DisplayObjectImpl.js +1 -0
  39. package/dist/interface/DragRulesImpl.d.ts +7 -0
  40. package/dist/interface/DragRulesImpl.js +1 -0
  41. package/dist/interface/DropTargetImpl.d.ts +2 -0
  42. package/dist/interface/DropTargetImpl.js +1 -0
  43. package/dist/interface/EventDispatcherImpl.d.ts +2 -0
  44. package/dist/interface/EventDispatcherImpl.js +1 -0
  45. package/dist/interface/EventListenerImpl.d.ts +6 -0
  46. package/dist/interface/EventListenerImpl.js +1 -0
  47. package/dist/interface/EventsImpl.d.ts +20 -0
  48. package/dist/interface/EventsImpl.js +1 -0
  49. package/dist/interface/FillMeshImpl.d.ts +5 -0
  50. package/dist/interface/FillMeshImpl.js +1 -0
  51. package/dist/interface/FilterArrayImpl.d.ts +10 -0
  52. package/dist/interface/FilterArrayImpl.js +1 -0
  53. package/dist/interface/FilterQualityImpl.d.ts +1 -0
  54. package/dist/interface/FilterQualityImpl.js +1 -0
  55. package/dist/interface/FiltersImpl.d.ts +20 -0
  56. package/dist/interface/FiltersImpl.js +1 -0
  57. package/dist/interface/GeomImpl.d.ts +12 -0
  58. package/dist/interface/GeomImpl.js +1 -0
  59. package/dist/interface/GradientTypeImpl.d.ts +3 -0
  60. package/dist/interface/GradientTypeImpl.js +1 -0
  61. package/dist/interface/GraphicsParentImpl.d.ts +2 -0
  62. package/dist/interface/GraphicsParentImpl.js +1 -0
  63. package/dist/interface/GridImpl.d.ts +6 -0
  64. package/dist/interface/GridImpl.js +1 -0
  65. package/dist/interface/ImageTypeImpl.d.ts +1 -0
  66. package/dist/interface/ImageTypeImpl.js +1 -0
  67. package/dist/interface/IndexRangeImpl.d.ts +4 -0
  68. package/dist/interface/IndexRangeImpl.js +1 -0
  69. package/dist/interface/LoaderInfoDataImpl.d.ts +7 -0
  70. package/dist/interface/LoaderInfoDataImpl.js +1 -0
  71. package/dist/interface/LoopConfigImpl.d.ts +8 -0
  72. package/dist/interface/LoopConfigImpl.js +1 -0
  73. package/dist/interface/LoopTypeImpl.d.ts +1 -0
  74. package/dist/interface/LoopTypeImpl.js +1 -0
  75. package/dist/interface/MediaImpl.d.ts +10 -0
  76. package/dist/interface/MediaImpl.js +1 -0
  77. package/dist/interface/MovieClipActionObjectImpl.d.ts +5 -0
  78. package/dist/interface/MovieClipActionObjectImpl.js +1 -0
  79. package/dist/interface/MovieClipCharacterImpl.d.ts +18 -0
  80. package/dist/interface/MovieClipCharacterImpl.js +1 -0
  81. package/dist/interface/MovieClipLabelObjectImpl.d.ts +4 -0
  82. package/dist/interface/MovieClipLabelObjectImpl.js +1 -0
  83. package/dist/interface/MovieClipSoundObjectImpl.d.ts +5 -0
  84. package/dist/interface/MovieClipSoundObjectImpl.js +1 -0
  85. package/dist/interface/NetImpl.d.ts +6 -0
  86. package/dist/interface/NetImpl.js +1 -0
  87. package/dist/interface/NoCodeDataImpl.d.ts +7 -0
  88. package/dist/interface/NoCodeDataImpl.js +1 -0
  89. package/dist/interface/NoCodeDataZlibImpl.d.ts +4 -0
  90. package/dist/interface/NoCodeDataZlibImpl.js +1 -0
  91. package/dist/interface/ParentImpl.d.ts +2 -0
  92. package/dist/interface/ParentImpl.js +1 -0
  93. package/dist/interface/PlaceObjectImpl.d.ts +12 -0
  94. package/dist/interface/PlaceObjectImpl.js +1 -0
  95. package/dist/interface/PlayerHitObjectImpl.d.ts +7 -0
  96. package/dist/interface/PlayerHitObjectImpl.js +1 -0
  97. package/dist/interface/PlayerModeImpl.d.ts +1 -0
  98. package/dist/interface/PlayerModeImpl.js +1 -0
  99. package/dist/interface/PlayerOptionsImpl.d.ts +8 -0
  100. package/dist/interface/PlayerOptionsImpl.js +1 -0
  101. package/dist/interface/PointImpl.d.ts +4 -0
  102. package/dist/interface/PointImpl.js +1 -0
  103. package/dist/interface/PreObjectImpl.d.ts +23 -0
  104. package/dist/interface/PreObjectImpl.js +1 -0
  105. package/dist/interface/PropertyContainerMessageImpl.d.ts +6 -0
  106. package/dist/interface/PropertyContainerMessageImpl.js +1 -0
  107. package/dist/interface/PropertyMessageImpl.d.ts +41 -0
  108. package/dist/interface/PropertyMessageImpl.js +1 -0
  109. package/dist/interface/PropertyMessageMapImpl.d.ts +2 -0
  110. package/dist/interface/PropertyMessageMapImpl.js +1 -0
  111. package/dist/interface/PropertyShapeMessageImpl.d.ts +6 -0
  112. package/dist/interface/PropertyShapeMessageImpl.js +1 -0
  113. package/dist/interface/PropertyTextMessageImpl.d.ts +25 -0
  114. package/dist/interface/PropertyTextMessageImpl.js +1 -0
  115. package/dist/interface/PropertyVideoMessageImpl.d.ts +5 -0
  116. package/dist/interface/PropertyVideoMessageImpl.js +1 -0
  117. package/dist/interface/RGBAImpl.d.ts +6 -0
  118. package/dist/interface/RGBAImpl.js +1 -0
  119. package/dist/interface/RenderDisplayObjectImpl.d.ts +2 -0
  120. package/dist/interface/RenderDisplayObjectImpl.js +1 -0
  121. package/dist/interface/ShapeCharacterImpl.d.ts +14 -0
  122. package/dist/interface/ShapeCharacterImpl.js +1 -0
  123. package/dist/interface/SoundCharacterImpl.d.ts +5 -0
  124. package/dist/interface/SoundCharacterImpl.js +1 -0
  125. package/dist/interface/SoundTagImpl.d.ts +6 -0
  126. package/dist/interface/SoundTagImpl.js +1 -0
  127. package/dist/interface/SpriteImpl.d.ts +2 -0
  128. package/dist/interface/SpriteImpl.js +1 -0
  129. package/dist/interface/StageDataImpl.d.ts +6 -0
  130. package/dist/interface/StageDataImpl.js +1 -0
  131. package/dist/interface/StageQualityImpl.d.ts +1 -0
  132. package/dist/interface/StageQualityImpl.js +1 -0
  133. package/dist/interface/StrokeMethImpl.d.ts +4 -0
  134. package/dist/interface/StrokeMethImpl.js +1 -0
  135. package/dist/interface/StrokeTypeImpl.d.ts +2 -0
  136. package/dist/interface/StrokeTypeImpl.js +1 -0
  137. package/dist/interface/SurfaceFilterImpl.d.ts +6 -0
  138. package/dist/interface/SurfaceFilterImpl.js +1 -0
  139. package/dist/interface/TextBreakObjectImpl.d.ts +9 -0
  140. package/dist/interface/TextBreakObjectImpl.js +1 -0
  141. package/dist/interface/TextCharacterImpl.d.ts +27 -0
  142. package/dist/interface/TextCharacterImpl.js +1 -0
  143. package/dist/interface/TextDataImpl.d.ts +2 -0
  144. package/dist/interface/TextDataImpl.js +1 -0
  145. package/dist/interface/TextFieldAutoSizeImpl.d.ts +1 -0
  146. package/dist/interface/TextFieldAutoSizeImpl.js +1 -0
  147. package/dist/interface/TextFieldTypeImpl.d.ts +1 -0
  148. package/dist/interface/TextFieldTypeImpl.js +1 -0
  149. package/dist/interface/TextFormatAlignImpl.d.ts +1 -0
  150. package/dist/interface/TextFormatAlignImpl.js +1 -0
  151. package/dist/interface/TextFormatImpl.d.ts +16 -0
  152. package/dist/interface/TextFormatImpl.js +1 -0
  153. package/dist/interface/TextFormatVerticalAlignImpl.d.ts +1 -0
  154. package/dist/interface/TextFormatVerticalAlignImpl.js +1 -0
  155. package/dist/interface/TextImageObjectImpl.d.ts +11 -0
  156. package/dist/interface/TextImageObjectImpl.js +1 -0
  157. package/dist/interface/TextImpl.d.ts +6 -0
  158. package/dist/interface/TextImpl.js +1 -0
  159. package/dist/interface/TextModeImpl.d.ts +1 -0
  160. package/dist/interface/TextModeImpl.js +1 -0
  161. package/dist/interface/TextObjectImpl.d.ts +7 -0
  162. package/dist/interface/TextObjectImpl.js +1 -0
  163. package/dist/interface/TextObjectModeImpl.d.ts +1 -0
  164. package/dist/interface/TextObjectModeImpl.js +1 -0
  165. package/dist/interface/TextStringObjectImpl.d.ts +7 -0
  166. package/dist/interface/TextStringObjectImpl.js +1 -0
  167. package/dist/interface/UIImpl.d.ts +8 -0
  168. package/dist/interface/UIImpl.js +1 -0
  169. package/dist/interface/URLLoaderDataFormatImpl.d.ts +1 -0
  170. package/dist/interface/URLLoaderDataFormatImpl.js +1 -0
  171. package/dist/interface/URLRequestMethodImpl.d.ts +1 -0
  172. package/dist/interface/URLRequestMethodImpl.js +1 -0
  173. package/dist/interface/UniformDataImpl.d.ts +5 -0
  174. package/dist/interface/UniformDataImpl.js +1 -0
  175. package/dist/interface/UnzipQueueImpl.d.ts +6 -0
  176. package/dist/interface/UnzipQueueImpl.js +1 -0
  177. package/dist/interface/VerticesImpl.d.ts +1 -0
  178. package/dist/interface/VerticesImpl.js +1 -0
  179. package/dist/interface/VideoCharacterImpl.d.ts +12 -0
  180. package/dist/interface/VideoCharacterImpl.js +1 -0
  181. package/dist/player/index.d.ts +1 -0
  182. package/dist/player/index.js +40 -0
  183. package/dist/player/next2d/display/BitmapData.d.ts +143 -0
  184. package/dist/player/next2d/display/BitmapData.js +390 -0
  185. package/dist/player/next2d/display/BlendMode.d.ts +204 -0
  186. package/dist/player/next2d/display/BlendMode.js +240 -0
  187. package/dist/player/next2d/display/DisplayObject.d.ts +571 -0
  188. package/dist/player/next2d/display/DisplayObject.js +1733 -0
  189. package/dist/player/next2d/display/DisplayObjectContainer.d.ts +351 -0
  190. package/dist/player/next2d/display/DisplayObjectContainer.js +1765 -0
  191. package/dist/player/next2d/display/FrameLabel.d.ts +98 -0
  192. package/dist/player/next2d/display/FrameLabel.js +122 -0
  193. package/dist/player/next2d/display/Graphics.d.ts +577 -0
  194. package/dist/player/next2d/display/Graphics.js +2193 -0
  195. package/dist/player/next2d/display/GraphicsBitmapFill.d.ts +49 -0
  196. package/dist/player/next2d/display/GraphicsBitmapFill.js +90 -0
  197. package/dist/player/next2d/display/GraphicsGradientFill.d.ts +66 -0
  198. package/dist/player/next2d/display/GraphicsGradientFill.js +162 -0
  199. package/dist/player/next2d/display/InteractiveObject.d.ts +32 -0
  200. package/dist/player/next2d/display/InteractiveObject.js +44 -0
  201. package/dist/player/next2d/display/Loader.d.ts +131 -0
  202. package/dist/player/next2d/display/Loader.js +324 -0
  203. package/dist/player/next2d/display/LoaderInfo.d.ts +122 -0
  204. package/dist/player/next2d/display/LoaderInfo.js +191 -0
  205. package/dist/player/next2d/display/LoopConfig.d.ts +108 -0
  206. package/dist/player/next2d/display/LoopConfig.js +160 -0
  207. package/dist/player/next2d/display/LoopType.d.ts +104 -0
  208. package/dist/player/next2d/display/LoopType.js +122 -0
  209. package/dist/player/next2d/display/MovieClip.d.ts +312 -0
  210. package/dist/player/next2d/display/MovieClip.js +959 -0
  211. package/dist/player/next2d/display/Shape.d.ts +167 -0
  212. package/dist/player/next2d/display/Shape.js +514 -0
  213. package/dist/player/next2d/display/Sprite.d.ts +174 -0
  214. package/dist/player/next2d/display/Sprite.js +288 -0
  215. package/dist/player/next2d/display/Stage.d.ts +164 -0
  216. package/dist/player/next2d/display/Stage.js +255 -0
  217. package/dist/player/next2d/events/Event.d.ts +424 -0
  218. package/dist/player/next2d/events/Event.js +569 -0
  219. package/dist/player/next2d/events/EventDispatcher.d.ts +138 -0
  220. package/dist/player/next2d/events/EventDispatcher.js +624 -0
  221. package/dist/player/next2d/events/EventPhase.d.ts +80 -0
  222. package/dist/player/next2d/events/EventPhase.js +94 -0
  223. package/dist/player/next2d/events/FocusEvent.d.ts +89 -0
  224. package/dist/player/next2d/events/FocusEvent.js +103 -0
  225. package/dist/player/next2d/events/HTTPStatusEvent.d.ts +107 -0
  226. package/dist/player/next2d/events/HTTPStatusEvent.js +142 -0
  227. package/dist/player/next2d/events/IOErrorEvent.d.ts +82 -0
  228. package/dist/player/next2d/events/IOErrorEvent.js +102 -0
  229. package/dist/player/next2d/events/MouseEvent.d.ts +163 -0
  230. package/dist/player/next2d/events/MouseEvent.js +207 -0
  231. package/dist/player/next2d/events/ProgressEvent.d.ts +97 -0
  232. package/dist/player/next2d/events/ProgressEvent.js +125 -0
  233. package/dist/player/next2d/events/VideoEvent.d.ts +145 -0
  234. package/dist/player/next2d/events/VideoEvent.js +183 -0
  235. package/dist/player/next2d/filters/BevelFilter.d.ts +254 -0
  236. package/dist/player/next2d/filters/BevelFilter.js +501 -0
  237. package/dist/player/next2d/filters/BitmapFilter.d.ts +75 -0
  238. package/dist/player/next2d/filters/BitmapFilter.js +96 -0
  239. package/dist/player/next2d/filters/BlurFilter.d.ts +150 -0
  240. package/dist/player/next2d/filters/BlurFilter.js +373 -0
  241. package/dist/player/next2d/filters/ColorMatrixFilter.d.ts +116 -0
  242. package/dist/player/next2d/filters/ColorMatrixFilter.js +180 -0
  243. package/dist/player/next2d/filters/ConvolutionFilter.d.ts +210 -0
  244. package/dist/player/next2d/filters/ConvolutionFilter.js +375 -0
  245. package/dist/player/next2d/filters/DisplacementMapFilter.d.ts +212 -0
  246. package/dist/player/next2d/filters/DisplacementMapFilter.js +381 -0
  247. package/dist/player/next2d/filters/DropShadowFilter.d.ts +240 -0
  248. package/dist/player/next2d/filters/DropShadowFilter.js +470 -0
  249. package/dist/player/next2d/filters/GlowFilter.d.ts +204 -0
  250. package/dist/player/next2d/filters/GlowFilter.js +362 -0
  251. package/dist/player/next2d/filters/GradientBevelFilter.d.ts +243 -0
  252. package/dist/player/next2d/filters/GradientBevelFilter.js +483 -0
  253. package/dist/player/next2d/filters/GradientGlowFilter.d.ts +243 -0
  254. package/dist/player/next2d/filters/GradientGlowFilter.js +473 -0
  255. package/dist/player/next2d/geom/ColorTransform.d.ts +201 -0
  256. package/dist/player/next2d/geom/ColorTransform.js +279 -0
  257. package/dist/player/next2d/geom/Matrix.d.ts +299 -0
  258. package/dist/player/next2d/geom/Matrix.js +455 -0
  259. package/dist/player/next2d/geom/Point.d.ts +213 -0
  260. package/dist/player/next2d/geom/Point.js +276 -0
  261. package/dist/player/next2d/geom/Rectangle.d.ts +364 -0
  262. package/dist/player/next2d/geom/Rectangle.js +517 -0
  263. package/dist/player/next2d/geom/Transform.d.ts +213 -0
  264. package/dist/player/next2d/geom/Transform.js +497 -0
  265. package/dist/player/next2d/media/Sound.d.ts +208 -0
  266. package/dist/player/next2d/media/Sound.js +515 -0
  267. package/dist/player/next2d/media/SoundMixer.d.ts +68 -0
  268. package/dist/player/next2d/media/SoundMixer.js +115 -0
  269. package/dist/player/next2d/media/SoundTransform.d.ts +80 -0
  270. package/dist/player/next2d/media/SoundTransform.js +113 -0
  271. package/dist/player/next2d/media/Video.d.ts +329 -0
  272. package/dist/player/next2d/media/Video.js +871 -0
  273. package/dist/player/next2d/net/URLRequest.d.ts +143 -0
  274. package/dist/player/next2d/net/URLRequest.js +239 -0
  275. package/dist/player/next2d/net/URLRequestHeader.d.ts +82 -0
  276. package/dist/player/next2d/net/URLRequestHeader.js +107 -0
  277. package/dist/player/next2d/text/TextField.d.ts +642 -0
  278. package/dist/player/next2d/text/TextField.js +2707 -0
  279. package/dist/player/next2d/text/TextFormat.d.ts +250 -0
  280. package/dist/player/next2d/text/TextFormat.js +473 -0
  281. package/dist/player/next2d/ui/Easing.d.ts +359 -0
  282. package/dist/player/next2d/ui/Easing.js +481 -0
  283. package/dist/player/next2d/ui/Job.d.ts +155 -0
  284. package/dist/player/next2d/ui/Job.js +344 -0
  285. package/dist/player/next2d/ui/Tween.d.ts +62 -0
  286. package/dist/player/next2d/ui/Tween.js +72 -0
  287. package/dist/player/packages/Display.d.ts +3 -0
  288. package/dist/player/packages/Display.js +36 -0
  289. package/dist/player/packages/Events.d.ts +3 -0
  290. package/dist/player/packages/Events.js +28 -0
  291. package/dist/player/packages/Filters.d.ts +3 -0
  292. package/dist/player/packages/Filters.js +28 -0
  293. package/dist/player/packages/Geom.d.ts +3 -0
  294. package/dist/player/packages/Geom.js +20 -0
  295. package/dist/player/packages/Media.d.ts +3 -0
  296. package/dist/player/packages/Media.js +18 -0
  297. package/dist/player/packages/Net.d.ts +3 -0
  298. package/dist/player/packages/Net.js +14 -0
  299. package/dist/player/packages/Text.d.ts +3 -0
  300. package/dist/player/packages/Text.js +14 -0
  301. package/dist/player/packages/UI.d.ts +3 -0
  302. package/dist/player/packages/UI.js +16 -0
  303. package/dist/player/player/Next2D.d.ts +71 -0
  304. package/dist/player/player/Next2D.js +206 -0
  305. package/dist/player/player/Player.d.ts +334 -0
  306. package/dist/player/player/Player.js +1912 -0
  307. package/dist/player/util/CacheStore.d.ts +115 -0
  308. package/dist/player/util/CacheStore.js +280 -0
  309. package/dist/player/util/Global.d.ts +23 -0
  310. package/dist/player/util/Global.js +67 -0
  311. package/dist/player/util/RenderUtil.d.ts +472 -0
  312. package/dist/player/util/RenderUtil.js +686 -0
  313. package/dist/player/util/Shortcut.d.ts +28 -0
  314. package/dist/player/util/Shortcut.js +28 -0
  315. package/dist/player/util/Util.d.ts +337 -0
  316. package/dist/player/util/Util.js +841 -0
  317. package/dist/renderer/RenderDisplayObject.d.ts +129 -0
  318. package/dist/renderer/RenderDisplayObject.js +567 -0
  319. package/dist/renderer/RenderDisplayObjectContainer.d.ts +70 -0
  320. package/dist/renderer/RenderDisplayObjectContainer.js +670 -0
  321. package/dist/renderer/RenderGlobal.d.ts +76 -0
  322. package/dist/renderer/RenderGlobal.js +88 -0
  323. package/dist/renderer/RenderGraphics.d.ts +90 -0
  324. package/dist/renderer/RenderGraphics.js +597 -0
  325. package/dist/renderer/RenderPlayer.d.ts +164 -0
  326. package/dist/renderer/RenderPlayer.js +421 -0
  327. package/dist/renderer/RenderShape.d.ts +32 -0
  328. package/dist/renderer/RenderShape.js +104 -0
  329. package/dist/renderer/RenderTextField.d.ts +119 -0
  330. package/dist/renderer/RenderTextField.js +709 -0
  331. package/dist/renderer/RenderVideo.d.ts +59 -0
  332. package/dist/renderer/RenderVideo.js +272 -0
  333. package/dist/webgl/BezierConverter.d.ts +59 -0
  334. package/dist/webgl/BezierConverter.js +107 -0
  335. package/dist/webgl/CanvasGradientToWebGL.d.ts +94 -0
  336. package/dist/webgl/CanvasGradientToWebGL.js +187 -0
  337. package/dist/webgl/CanvasPatternToWebGL.d.ts +39 -0
  338. package/dist/webgl/CanvasPatternToWebGL.js +70 -0
  339. package/dist/webgl/CanvasToWebGLContext.d.ts +596 -0
  340. package/dist/webgl/CanvasToWebGLContext.js +1453 -0
  341. package/dist/webgl/CanvasToWebGLContextBlend.d.ts +97 -0
  342. package/dist/webgl/CanvasToWebGLContextBlend.js +303 -0
  343. package/dist/webgl/CanvasToWebGLContextGrid.d.ts +74 -0
  344. package/dist/webgl/CanvasToWebGLContextGrid.js +314 -0
  345. package/dist/webgl/CanvasToWebGLContextMask.d.ts +113 -0
  346. package/dist/webgl/CanvasToWebGLContextMask.js +443 -0
  347. package/dist/webgl/CanvasToWebGLContextPath.d.ts +111 -0
  348. package/dist/webgl/CanvasToWebGLContextPath.js +213 -0
  349. package/dist/webgl/CanvasToWebGLContextStyle.d.ts +77 -0
  350. package/dist/webgl/CanvasToWebGLContextStyle.js +145 -0
  351. package/dist/webgl/ColorBufferPool.d.ts +58 -0
  352. package/dist/webgl/ColorBufferPool.js +137 -0
  353. package/dist/webgl/FrameBufferManager.d.ts +135 -0
  354. package/dist/webgl/FrameBufferManager.js +367 -0
  355. package/dist/webgl/StencilBufferPool.d.ts +56 -0
  356. package/dist/webgl/StencilBufferPool.js +147 -0
  357. package/dist/webgl/TextureManager.d.ts +130 -0
  358. package/dist/webgl/TextureManager.js +303 -0
  359. package/dist/webgl/VertexArrayObjectManager.d.ts +95 -0
  360. package/dist/webgl/VertexArrayObjectManager.js +289 -0
  361. package/dist/webgl/WebGLFillMeshGenerator.d.ts +31 -0
  362. package/dist/webgl/WebGLFillMeshGenerator.js +104 -0
  363. package/dist/webgl/WebGLStrokeMeshGenerator.d.ts +182 -0
  364. package/dist/webgl/WebGLStrokeMeshGenerator.js +510 -0
  365. package/dist/webgl/shader/CanvasToWebGLShader.d.ts +85 -0
  366. package/dist/webgl/shader/CanvasToWebGLShader.js +196 -0
  367. package/dist/webgl/shader/CanvasToWebGLShaderList.d.ts +70 -0
  368. package/dist/webgl/shader/CanvasToWebGLShaderList.js +115 -0
  369. package/dist/webgl/shader/GradientLUTGenerator.d.ts +36 -0
  370. package/dist/webgl/shader/GradientLUTGenerator.js +129 -0
  371. package/dist/webgl/shader/WebGLShaderUniform.d.ts +52 -0
  372. package/dist/webgl/shader/WebGLShaderUniform.js +168 -0
  373. package/dist/webgl/shader/fragment/FragmentShaderLibrary.d.ts +18 -0
  374. package/dist/webgl/shader/fragment/FragmentShaderLibrary.js +35 -0
  375. package/dist/webgl/shader/fragment/FragmentShaderSource.d.ts +29 -0
  376. package/dist/webgl/shader/fragment/FragmentShaderSource.js +99 -0
  377. package/dist/webgl/shader/fragment/FragmentShaderSourceBlend.d.ts +67 -0
  378. package/dist/webgl/shader/fragment/FragmentShaderSourceBlend.js +319 -0
  379. package/dist/webgl/shader/fragment/FragmentShaderSourceGradient.d.ts +44 -0
  380. package/dist/webgl/shader/fragment/FragmentShaderSourceGradient.js +114 -0
  381. package/dist/webgl/shader/fragment/FragmentShaderSourceGradientLUT.d.ts +14 -0
  382. package/dist/webgl/shader/fragment/FragmentShaderSourceGradientLUT.js +58 -0
  383. package/dist/webgl/shader/fragment/FragmentShaderSourceTexture.d.ts +12 -0
  384. package/dist/webgl/shader/fragment/FragmentShaderSourceTexture.js +36 -0
  385. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceBlurFilter.d.ts +12 -0
  386. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceBlurFilter.js +42 -0
  387. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceColorMatrixFilter.d.ts +11 -0
  388. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceColorMatrixFilter.js +35 -0
  389. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceConvolutionFilter.d.ts +16 -0
  390. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceConvolutionFilter.js +80 -0
  391. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceDisplacementMapFilter.d.ts +15 -0
  392. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceDisplacementMapFilter.js +106 -0
  393. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceFilter.d.ts +112 -0
  394. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceFilter.js +275 -0
  395. package/dist/webgl/shader/variants/BlendShaderVariantCollection.d.ts +99 -0
  396. package/dist/webgl/shader/variants/BlendShaderVariantCollection.js +242 -0
  397. package/dist/webgl/shader/variants/FilterShaderVariantCollection.d.ts +150 -0
  398. package/dist/webgl/shader/variants/FilterShaderVariantCollection.js +398 -0
  399. package/dist/webgl/shader/variants/GradientLUTShaderVariantCollection.d.ts +49 -0
  400. package/dist/webgl/shader/variants/GradientLUTShaderVariantCollection.js +110 -0
  401. package/dist/webgl/shader/variants/GradientShapeShaderVariantCollection.d.ts +61 -0
  402. package/dist/webgl/shader/variants/GradientShapeShaderVariantCollection.js +199 -0
  403. package/dist/webgl/shader/variants/ShapeShaderVariantCollection.d.ts +117 -0
  404. package/dist/webgl/shader/variants/ShapeShaderVariantCollection.js +430 -0
  405. package/dist/webgl/shader/vertex/VertexShaderLibrary.d.ts +18 -0
  406. package/dist/webgl/shader/vertex/VertexShaderLibrary.js +75 -0
  407. package/dist/webgl/shader/vertex/VertexShaderSource.d.ts +23 -0
  408. package/dist/webgl/shader/vertex/VertexShaderSource.js +92 -0
  409. package/dist/webgl/shader/vertex/VertexShaderSourceFill.d.ts +45 -0
  410. package/dist/webgl/shader/vertex/VertexShaderSourceFill.js +112 -0
  411. package/dist/webgl/shader/vertex/VertexShaderSourceStroke.d.ts +27 -0
  412. package/dist/webgl/shader/vertex/VertexShaderSourceStroke.js +149 -0
  413. package/package.json +31 -25
  414. package/SECURITY.md +0 -3
  415. package/next2d.js +0 -7
@@ -0,0 +1,670 @@
1
+ import { RenderGraphics } from "./RenderGraphics";
2
+ import { Rectangle } from "../player/next2d/geom/Rectangle";
3
+ import { $containers, $renderPlayer } from "./RenderGlobal";
4
+ import { $boundsMatrix, $clamp, $getArray, $getBoundsObject, $getFloat32Array6, $getFloat32Array8, $getPreObject, $Math, $MATRIX_ARRAY_IDENTITY, $multiplicationColor, $multiplicationMatrix, $Number, $poolArray, $poolBoundsObject, $poolFloat32Array6, $poolFloat32Array8, $poolPreObject } from "../player/util/RenderUtil";
5
+ /**
6
+ * @class
7
+ */
8
+ export class RenderDisplayObjectContainer extends RenderGraphics {
9
+ _$children;
10
+ /**
11
+ * @constructor
12
+ * @public
13
+ */
14
+ constructor() {
15
+ super();
16
+ /**
17
+ * @type {array}
18
+ * @private
19
+ */
20
+ this._$children = $getArray();
21
+ }
22
+ /**
23
+ * @param {CanvasToWebGLContext} context
24
+ * @param {Float32Array} matrix
25
+ * @return {void}
26
+ * @method
27
+ * @private
28
+ */
29
+ _$clip(context, matrix) {
30
+ let multiMatrix = matrix;
31
+ const rawMatrix = this._$matrix;
32
+ if (rawMatrix[0] !== 1 || rawMatrix[1] !== 0
33
+ || rawMatrix[2] !== 0 || rawMatrix[3] !== 1
34
+ || rawMatrix[4] !== 0 || rawMatrix[5] !== 0) {
35
+ multiMatrix = $multiplicationMatrix(matrix, rawMatrix);
36
+ }
37
+ if (this._$recodes && this._$canDraw) {
38
+ super._$clip(context, multiMatrix);
39
+ }
40
+ const instances = $renderPlayer.instances;
41
+ const children = this._$children;
42
+ for (let idx = 0; idx < this._$children.length; ++idx) {
43
+ const id = children[idx];
44
+ if (!instances.has(id)) {
45
+ continue;
46
+ }
47
+ const instance = instances.get(id);
48
+ // mask instance
49
+ if (!instance || instance._$isMask) {
50
+ continue;
51
+ }
52
+ instance._$clip(context, multiMatrix);
53
+ instance._$updated = false;
54
+ }
55
+ if (multiMatrix !== matrix) {
56
+ $poolFloat32Array6(multiMatrix);
57
+ }
58
+ }
59
+ /**
60
+ * @param {CanvasToWebGLContext} context
61
+ * @param {Float32Array} matrix
62
+ * @param {Float32Array} color_transform
63
+ * @return {void}
64
+ * @method
65
+ * @private
66
+ */
67
+ _$draw(context, matrix, color_transform) {
68
+ // not draw
69
+ if (!this._$visible) {
70
+ return;
71
+ }
72
+ let multiColor = color_transform;
73
+ const rawColor = this._$colorTransform;
74
+ if (rawColor[0] !== 1 || rawColor[1] !== 1
75
+ || rawColor[2] !== 1 || rawColor[3] !== 1
76
+ || rawColor[4] !== 0 || rawColor[5] !== 0
77
+ || rawColor[6] !== 0 || rawColor[7] !== 0) {
78
+ multiColor = $multiplicationColor(color_transform, rawColor);
79
+ }
80
+ // not draw
81
+ const alpha = $clamp(multiColor[3] + multiColor[7] / 255, 0, 1, 0);
82
+ if (!alpha) {
83
+ return;
84
+ }
85
+ // not draw
86
+ const children = this._$children;
87
+ const length = children.length;
88
+ if (!length && (!this._$recodes || !this._$canDraw)) {
89
+ return;
90
+ }
91
+ // pre data
92
+ const preObject = this._$preDraw(context, matrix);
93
+ if (!preObject) {
94
+ return;
95
+ }
96
+ // use cache
97
+ if (preObject.isFilter && !preObject.isUpdated) {
98
+ this._$postDraw(context, matrix, multiColor, preObject);
99
+ return;
100
+ }
101
+ let preMatrix = preObject.matrix;
102
+ const preColorTransform = preObject.isFilter && preObject.color
103
+ ? preObject.color
104
+ : multiColor;
105
+ // if graphics draw
106
+ if (this._$recodes && this._$canDraw && this._$maxAlpha > 0) {
107
+ super._$draw(context, preMatrix, preColorTransform);
108
+ }
109
+ // init clip params
110
+ let shouldClip = true;
111
+ let clipDepth = 0;
112
+ const clipMatrix = $getArray();
113
+ const instanceMatrix = $getArray();
114
+ const clipStack = $getArray();
115
+ const shouldClips = $getArray();
116
+ // draw children
117
+ const instances = $renderPlayer.instances;
118
+ const isLayer = context.isLayer;
119
+ for (let idx = 0; idx < length; ++idx) {
120
+ const id = children[idx];
121
+ if (!instances.has(id)) {
122
+ continue;
123
+ }
124
+ const instance = instances.get(id);
125
+ // mask instance
126
+ if (instance._$isMask) {
127
+ continue;
128
+ }
129
+ // not layer mode
130
+ const blendMode = instance._$blendMode;
131
+ if ((blendMode === "alpha" || blendMode === "erase")
132
+ && !isLayer) {
133
+ continue;
134
+ }
135
+ // mask end
136
+ if (clipDepth
137
+ && (instance._$placeId > clipDepth || instance._$clipDepth > 0)) {
138
+ context.restore();
139
+ if (shouldClip) {
140
+ context._$leaveClip();
141
+ if (clipMatrix.length) {
142
+ const matrix = clipMatrix.pop();
143
+ if (matrix) {
144
+ $poolFloat32Array6(preMatrix);
145
+ preMatrix = matrix;
146
+ }
147
+ }
148
+ }
149
+ // clear
150
+ clipDepth = clipStack.length ? clipStack.pop() || 0 : 0;
151
+ shouldClip = !!shouldClips.pop();
152
+ }
153
+ // mask size 0
154
+ if (!shouldClip) {
155
+ continue;
156
+ }
157
+ // mask start
158
+ if (instance._$clipDepth > 0) {
159
+ context.save();
160
+ if (clipDepth) {
161
+ clipStack.push(clipDepth);
162
+ }
163
+ shouldClips.push(shouldClip);
164
+ clipDepth = instance._$clipDepth;
165
+ shouldClip = instance._$shouldClip(preMatrix);
166
+ if (shouldClip) {
167
+ const adjMatrix = instance._$startClip(context, preMatrix);
168
+ if (adjMatrix === false) { // fixed
169
+ shouldClip = false;
170
+ continue;
171
+ }
172
+ if (adjMatrix instanceof Float32Array) {
173
+ clipMatrix.push(preMatrix);
174
+ preMatrix = adjMatrix;
175
+ }
176
+ }
177
+ continue;
178
+ }
179
+ // mask start
180
+ const maskInstance = instance._$maskId > -1 && instances.has(instance._$maskId)
181
+ ? instances.get(instance._$maskId)
182
+ : null;
183
+ if (maskInstance) {
184
+ maskInstance._$updated = false;
185
+ let maskMatrix;
186
+ if (this._$instanceId === maskInstance._$parentId) {
187
+ maskMatrix = preMatrix;
188
+ }
189
+ else {
190
+ maskMatrix = $MATRIX_ARRAY_IDENTITY;
191
+ let parent = instances.get(maskInstance._$parentId);
192
+ while (parent || parent._$instanceId !== parent._$parentId) {
193
+ maskMatrix = $multiplicationMatrix(parent._$matrix, maskMatrix);
194
+ parent = instances.get(parent._$parentId);
195
+ }
196
+ const mScale = $renderPlayer.scaleX;
197
+ const playerMatrix = $getFloat32Array6(mScale, 0, 0, mScale, 0, 0);
198
+ maskMatrix = $multiplicationMatrix(playerMatrix, maskMatrix);
199
+ $poolFloat32Array6(playerMatrix);
200
+ if (context.isLayer) {
201
+ const currentPosition = context.getCurrentPosition();
202
+ maskMatrix[4] -= currentPosition.xMin;
203
+ maskMatrix[5] -= currentPosition.yMin;
204
+ }
205
+ if (context.cacheBounds) {
206
+ maskMatrix[4] -= context.cacheBounds.xMin;
207
+ maskMatrix[5] -= context.cacheBounds.yMin;
208
+ }
209
+ }
210
+ if (!maskInstance._$shouldClip(maskMatrix)) {
211
+ continue;
212
+ }
213
+ const adjMatrix = maskInstance._$startClip(context, maskMatrix);
214
+ context.save();
215
+ if (adjMatrix === false) { // fixed
216
+ context.restore();
217
+ continue;
218
+ }
219
+ if (adjMatrix instanceof Float32Array) {
220
+ instanceMatrix.push(preMatrix);
221
+ if (this !== maskInstance._$parent) {
222
+ const rawMatrix = this._$matrix;
223
+ adjMatrix[0] = $Math.abs(preMatrix[0]) * $Math.sign(rawMatrix[0]);
224
+ adjMatrix[1] = $Math.abs(preMatrix[1]) * $Math.sign(rawMatrix[1]);
225
+ adjMatrix[2] = $Math.abs(preMatrix[2]) * $Math.sign(rawMatrix[2]);
226
+ adjMatrix[3] = $Math.abs(preMatrix[3]) * $Math.sign(rawMatrix[3]);
227
+ adjMatrix[4] = preMatrix[4] - context.cacheBounds.xMin;
228
+ adjMatrix[5] = preMatrix[5] - context.cacheBounds.yMin;
229
+ }
230
+ preMatrix = adjMatrix;
231
+ }
232
+ }
233
+ instance._$draw(context, preMatrix, preColorTransform);
234
+ instance._$updated = false;
235
+ // mask end
236
+ if (maskInstance) {
237
+ context.restore();
238
+ context._$leaveClip();
239
+ if (instanceMatrix.length) {
240
+ const matrix = instanceMatrix.pop();
241
+ if (matrix) {
242
+ $poolFloat32Array6(preMatrix);
243
+ preMatrix = matrix;
244
+ }
245
+ }
246
+ }
247
+ }
248
+ // end mask
249
+ if (clipDepth) {
250
+ context.restore();
251
+ if (shouldClips.pop()) {
252
+ context._$leaveClip();
253
+ }
254
+ }
255
+ // object pool
256
+ $poolArray(clipMatrix);
257
+ $poolArray(instanceMatrix);
258
+ $poolArray(clipStack);
259
+ $poolArray(shouldClips);
260
+ // filter and blend
261
+ if (preObject.isFilter) {
262
+ return this._$postDraw(context, matrix, multiColor, preObject);
263
+ }
264
+ if (preObject.matrix !== matrix) {
265
+ $poolFloat32Array6(preObject.matrix);
266
+ }
267
+ if (multiColor !== color_transform) {
268
+ $poolFloat32Array8(multiColor);
269
+ }
270
+ $poolPreObject(preObject);
271
+ }
272
+ /**
273
+ * @param {array} [matrix=null]
274
+ * @return {object}
275
+ * @private
276
+ */
277
+ _$getLayerBounds(matrix = null) {
278
+ let multiMatrix = $MATRIX_ARRAY_IDENTITY;
279
+ if (matrix) {
280
+ multiMatrix = matrix;
281
+ const rawMatrix = this._$matrix;
282
+ if (rawMatrix !== $MATRIX_ARRAY_IDENTITY) {
283
+ multiMatrix = $multiplicationMatrix(matrix, rawMatrix);
284
+ }
285
+ }
286
+ const isGraphics = !!this._$recodes;
287
+ const children = this._$children;
288
+ const length = children.length;
289
+ // size zero
290
+ if (!length && !isGraphics) {
291
+ const bounds = $getBoundsObject(multiMatrix[4], -multiMatrix[4], multiMatrix[5], -multiMatrix[5]);
292
+ if (matrix && multiMatrix !== matrix) {
293
+ $poolFloat32Array6(multiMatrix);
294
+ }
295
+ return bounds;
296
+ }
297
+ // data init
298
+ const no = $Number.MAX_VALUE;
299
+ let xMin = no;
300
+ let xMax = -no;
301
+ let yMin = no;
302
+ let yMax = -no;
303
+ if (isGraphics) {
304
+ const baseBounds = $getBoundsObject(this._$xMin, this._$xMax, this._$yMin, this._$yMax);
305
+ const bounds = $boundsMatrix(baseBounds, multiMatrix);
306
+ $poolBoundsObject(baseBounds);
307
+ xMin = +bounds.xMin;
308
+ xMax = +bounds.xMax;
309
+ yMin = +bounds.yMin;
310
+ yMax = +bounds.yMax;
311
+ $poolBoundsObject(bounds);
312
+ }
313
+ const instances = $renderPlayer.instances;
314
+ for (let idx = 0; idx < children.length; ++idx) {
315
+ const id = children[idx];
316
+ if (!instances.has(id)) {
317
+ continue;
318
+ }
319
+ const bounds = instances
320
+ .get(id)
321
+ ._$getLayerBounds(multiMatrix);
322
+ xMin = $Math.min(xMin, bounds.xMin);
323
+ xMax = $Math.max(xMax, bounds.xMax);
324
+ yMin = $Math.min(yMin, bounds.yMin);
325
+ yMax = $Math.max(yMax, bounds.yMax);
326
+ $poolBoundsObject(bounds);
327
+ }
328
+ if (matrix && multiMatrix !== matrix) {
329
+ $poolFloat32Array6(multiMatrix);
330
+ }
331
+ // end
332
+ if (!matrix) {
333
+ return $getBoundsObject(xMin, xMax, yMin, yMax);
334
+ }
335
+ if (!this._$filters) {
336
+ return $getBoundsObject(xMin, xMax, yMin, yMax);
337
+ }
338
+ let rect = new Rectangle(xMin, yMin, xMax - xMin, yMax - yMin);
339
+ for (let idx = 0; idx < this._$filters.length; ++idx) {
340
+ rect = this._$filters[idx]
341
+ ._$generateFilterRect(rect, 0, 0);
342
+ }
343
+ xMin = rect.x;
344
+ xMax = rect.x + rect.width;
345
+ yMin = rect.y;
346
+ yMax = rect.y + rect.height;
347
+ return $getBoundsObject(xMin, xMax, yMin, yMax);
348
+ }
349
+ /**
350
+ * @param {Float32Array} [matrix=null]
351
+ * @returns {object}
352
+ * @method
353
+ * @private
354
+ */
355
+ _$getBounds(matrix = null) {
356
+ let multiMatrix = $MATRIX_ARRAY_IDENTITY;
357
+ if (matrix) {
358
+ multiMatrix = matrix;
359
+ const rawMatrix = this._$matrix;
360
+ if (rawMatrix[0] !== 1 || rawMatrix[1] !== 0
361
+ || rawMatrix[2] !== 0 || rawMatrix[3] !== 1
362
+ || rawMatrix[4] !== 0 || rawMatrix[5] !== 0) {
363
+ multiMatrix = $multiplicationMatrix(matrix, rawMatrix);
364
+ }
365
+ }
366
+ const isGraphics = !!this._$recodes;
367
+ const children = this._$children;
368
+ const length = children.length;
369
+ // size zero
370
+ if (!length && !isGraphics) {
371
+ const bounds = $getBoundsObject(multiMatrix[4], -multiMatrix[4], multiMatrix[5], -multiMatrix[5]);
372
+ if (matrix && multiMatrix !== matrix) {
373
+ $poolFloat32Array6(multiMatrix);
374
+ }
375
+ return bounds;
376
+ }
377
+ // data init
378
+ const no = $Number.MAX_VALUE;
379
+ let xMin = no;
380
+ let xMax = -no;
381
+ let yMin = no;
382
+ let yMax = -no;
383
+ if (isGraphics) {
384
+ const baseBounds = $getBoundsObject(this._$xMin, this._$xMax, this._$yMin, this._$yMax);
385
+ $poolBoundsObject(baseBounds);
386
+ const bounds = $boundsMatrix(baseBounds, multiMatrix);
387
+ xMin = bounds.xMin;
388
+ xMax = bounds.xMax;
389
+ yMin = bounds.yMin;
390
+ yMax = bounds.yMax;
391
+ $poolBoundsObject(bounds);
392
+ }
393
+ const instances = $renderPlayer.instances;
394
+ for (let idx = 0; idx < children.length; ++idx) {
395
+ const id = children[idx];
396
+ if (!instances.has(id)) {
397
+ continue;
398
+ }
399
+ const bounds = instances
400
+ .get(id)
401
+ ._$getBounds(multiMatrix);
402
+ xMin = $Math.min(xMin, bounds.xMin);
403
+ xMax = $Math.max(xMax, bounds.xMax);
404
+ yMin = $Math.min(yMin, bounds.yMin);
405
+ yMax = $Math.max(yMax, bounds.yMax);
406
+ $poolBoundsObject(bounds);
407
+ }
408
+ if (matrix && multiMatrix !== matrix) {
409
+ $poolFloat32Array6(multiMatrix);
410
+ }
411
+ // end
412
+ return $getBoundsObject(xMin, xMax, yMin, yMax);
413
+ }
414
+ /**
415
+ * @param {CanvasToWebGLContext} context
416
+ * @param {Float32Array} matrix
417
+ * @return {object}
418
+ * @private
419
+ */
420
+ _$preDraw(context, matrix) {
421
+ let multiMatrix = matrix;
422
+ const rawMatrix = this._$matrix;
423
+ if (rawMatrix[0] !== 1 || rawMatrix[1] !== 0
424
+ || rawMatrix[2] !== 0 || rawMatrix[3] !== 1
425
+ || rawMatrix[4] !== 0 || rawMatrix[5] !== 0) {
426
+ multiMatrix = $multiplicationMatrix(matrix, rawMatrix);
427
+ }
428
+ // size zero
429
+ if (!multiMatrix[0] && !multiMatrix[1]
430
+ || !multiMatrix[2] && !multiMatrix[3]) {
431
+ return null;
432
+ }
433
+ // return object
434
+ const object = $getPreObject();
435
+ // setup
436
+ object.matrix = multiMatrix;
437
+ // check
438
+ const blendMode = this._$blendMode;
439
+ if (blendMode !== "normal"
440
+ || this._$filters && this._$filters.length > 0) {
441
+ // check size
442
+ const baseBounds = this._$getBounds(null);
443
+ const bounds = $boundsMatrix(baseBounds, multiMatrix);
444
+ $poolBoundsObject(baseBounds);
445
+ const xMax = +bounds.xMax;
446
+ const xMin = +bounds.xMin;
447
+ const yMax = +bounds.yMax;
448
+ const yMin = +bounds.yMin;
449
+ $poolBoundsObject(bounds);
450
+ const width = $Math.abs(xMax - xMin);
451
+ const height = $Math.abs(yMax - yMin);
452
+ if (0 >= width || 0 >= height) {
453
+ $poolPreObject(object);
454
+ return null;
455
+ }
456
+ if (0 > xMin + width || 0 > yMin + height) {
457
+ $poolPreObject(object);
458
+ return null;
459
+ }
460
+ const currentAttachment = context
461
+ .frameBuffer
462
+ .currentAttachment;
463
+ if (!currentAttachment
464
+ || !currentAttachment.texture
465
+ || xMin > currentAttachment.width
466
+ || yMin > currentAttachment.height) {
467
+ $poolPreObject(object);
468
+ return null;
469
+ }
470
+ // set origin position
471
+ object.basePosition.x = rawMatrix[4];
472
+ object.basePosition.y = rawMatrix[5];
473
+ // check after size
474
+ const baseLayerBounds = this._$getLayerBounds(null);
475
+ const layerBounds = $boundsMatrix(baseLayerBounds, multiMatrix);
476
+ // filter size
477
+ let layerWidth = $Math.abs(layerBounds.xMax - layerBounds.xMin);
478
+ let layerHeight = $Math.abs(layerBounds.yMax - layerBounds.yMin);
479
+ $poolBoundsObject(layerBounds);
480
+ // move size
481
+ let tx = multiMatrix[4] - $Math.floor(xMin);
482
+ let ty = multiMatrix[5] - $Math.floor(yMin);
483
+ let dx = $Math.floor(xMin);
484
+ let dy = $Math.floor(yMin);
485
+ let originX = xMin;
486
+ let originY = yMin;
487
+ if (layerWidth !== width || layerHeight !== height) {
488
+ const layerMatrix = $getFloat32Array6(multiMatrix[0], multiMatrix[1], multiMatrix[2], multiMatrix[3], 0, 0);
489
+ const moveBounds = $boundsMatrix(baseLayerBounds, layerMatrix);
490
+ // pool
491
+ $poolFloat32Array6(layerMatrix);
492
+ tx += -$Math.floor(moveBounds.xMin) - tx;
493
+ ty += -$Math.floor(moveBounds.yMin) - ty;
494
+ dx -= -$Math.floor(moveBounds.xMin) - (multiMatrix[4] - dx);
495
+ dy -= -$Math.floor(moveBounds.yMin) - (multiMatrix[5] - dy);
496
+ originX -= -moveBounds.xMin - (multiMatrix[4] - originX);
497
+ originY -= -moveBounds.yMin - (multiMatrix[5] - originY);
498
+ $poolBoundsObject(moveBounds);
499
+ }
500
+ $poolBoundsObject(baseLayerBounds);
501
+ // set position
502
+ object.position.dx = dx > 0 ? dx : 0;
503
+ object.position.dy = dy > 0 ? dy : 0;
504
+ // resize
505
+ if (layerWidth + originX > currentAttachment.texture.width) {
506
+ layerWidth -= layerWidth - currentAttachment.texture.width + originX;
507
+ }
508
+ if (layerHeight + originY > currentAttachment.texture.height) {
509
+ layerHeight -= layerHeight - currentAttachment.texture.height + originY;
510
+ }
511
+ if (0 > dx) {
512
+ tx += dx;
513
+ layerWidth += originX;
514
+ }
515
+ if (0 > dy) {
516
+ ty += dy;
517
+ layerHeight += originY;
518
+ }
519
+ if (0 >= layerWidth || 0 >= layerHeight // size (-)
520
+ || !layerWidth || !layerHeight // NaN or Infinity
521
+ ) {
522
+ $poolPreObject(object);
523
+ return null;
524
+ }
525
+ // start layer
526
+ context._$startLayer($getBoundsObject(originX, 0, originY, 0));
527
+ // check cache
528
+ object.canApply = this._$canApply(this._$filters);
529
+ const updated = this._$isFilterUpdated(layerWidth, layerHeight, multiMatrix, this._$filters, object.canApply, object.basePosition.x, object.basePosition.y);
530
+ // current mask cache
531
+ context._$saveCurrentMask();
532
+ if (updated) {
533
+ context._$saveAttachment($Math.ceil(layerWidth), $Math.ceil(layerHeight), false);
534
+ }
535
+ // setup
536
+ object.isFilter = true;
537
+ object.isUpdated = updated;
538
+ object.color = $getFloat32Array8();
539
+ object.baseMatrix = multiMatrix;
540
+ object.filters = this._$filters;
541
+ object.blendMode = blendMode;
542
+ object.layerWidth = layerWidth;
543
+ object.layerHeight = layerHeight;
544
+ object.matrix = $getFloat32Array6(multiMatrix[0], multiMatrix[1], multiMatrix[2], multiMatrix[3], tx, ty);
545
+ }
546
+ return object;
547
+ }
548
+ /**
549
+ * @param {CanvasToWebGLContext} context
550
+ * @param {Float32Array} matrix
551
+ * @param {Float32Array} color_transform
552
+ * @param {object} object
553
+ * @return {void}
554
+ * @method
555
+ * @private
556
+ */
557
+ _$postDraw(context, matrix, color_transform, object) {
558
+ // cache
559
+ const cacheKeys = $getArray(this._$instanceId, "f");
560
+ const cacheStore = $renderPlayer.cacheStore;
561
+ const manager = context.frameBuffer;
562
+ // cache or new texture
563
+ let texture;
564
+ if (object.isUpdated) {
565
+ texture = manager.getTextureFromCurrentAttachment();
566
+ const cacheTexture = cacheStore.get(cacheKeys);
567
+ if (cacheTexture) {
568
+ cacheStore.set(cacheKeys, null);
569
+ manager.releaseTexture(cacheTexture);
570
+ }
571
+ }
572
+ else {
573
+ texture = cacheStore.get(cacheKeys);
574
+ if (!texture) {
575
+ throw new Error("the texture is null.");
576
+ }
577
+ }
578
+ // blend only
579
+ if (!object.canApply) {
580
+ texture._$offsetX = 0;
581
+ texture._$offsetY = 0;
582
+ }
583
+ // set cache offset
584
+ let offsetX = texture._$offsetX;
585
+ let offsetY = texture._$offsetY;
586
+ // execute filter
587
+ if (object.isUpdated && object.canApply) {
588
+ // cache clear
589
+ const cache = cacheStore.get(cacheKeys);
590
+ if (cache) {
591
+ // reset cache params
592
+ cacheStore.set(cacheKeys, null);
593
+ cache.layerWidth = 0;
594
+ cache.layerHeight = 0;
595
+ cache._$offsetX = 0;
596
+ cache._$offsetY = 0;
597
+ cache.matrix = null;
598
+ cache.colorTransform = null;
599
+ manager.releaseTexture(cache);
600
+ }
601
+ // apply filter
602
+ const filters = object.filters;
603
+ if (filters && filters.length) {
604
+ // init
605
+ context._$offsetX = 0;
606
+ context._$offsetY = 0;
607
+ for (let idx = 0; idx < filters.length; ++idx) {
608
+ texture = filters[idx]
609
+ ._$applyFilter(context, matrix);
610
+ }
611
+ offsetX = context._$offsetX;
612
+ offsetY = context._$offsetY;
613
+ // reset
614
+ context._$offsetX = 0;
615
+ context._$offsetY = 0;
616
+ // set offset
617
+ texture._$offsetX = offsetX;
618
+ texture._$offsetY = offsetY;
619
+ }
620
+ }
621
+ // update cache params
622
+ if (object.isUpdated) {
623
+ texture.filterState = object.canApply;
624
+ // cache texture
625
+ const matrix = object.baseMatrix;
626
+ if (matrix) {
627
+ texture.matrix = `${matrix[0]}_${matrix[1]}_${matrix[2]}_${matrix[3]}`;
628
+ }
629
+ texture.layerWidth = object.layerWidth;
630
+ texture.layerHeight = object.layerHeight;
631
+ }
632
+ // cache texture
633
+ cacheStore.set(cacheKeys, texture);
634
+ $poolArray(cacheKeys);
635
+ // set current buffer
636
+ if (object.isUpdated) {
637
+ context._$restoreAttachment();
638
+ }
639
+ // set
640
+ context.reset();
641
+ context.globalAlpha = $clamp(color_transform[3] + color_transform[7] / 255, 0, 1);
642
+ context.globalCompositeOperation = object.blendMode;
643
+ context.setTransform(1, 0, 0, 1, 0, 0);
644
+ context.drawImage(texture, -offsetX + object.position.dx, -offsetY + object.position.dy, texture.width, texture.height, color_transform);
645
+ // end blend
646
+ context._$endLayer();
647
+ // reset
648
+ context._$restoreCurrentMask();
649
+ // object pool
650
+ if (object.baseMatrix !== matrix) {
651
+ $poolFloat32Array6(object.baseMatrix);
652
+ }
653
+ $poolFloat32Array6(object.matrix);
654
+ $poolPreObject(object);
655
+ }
656
+ /**
657
+ * @description Playerから登録を削除
658
+ *
659
+ * @return {void}
660
+ * @method
661
+ * @private
662
+ */
663
+ _$remove() {
664
+ // reset
665
+ this._$children.length = 0;
666
+ this._$recodes = null;
667
+ super._$remove();
668
+ $containers.push(this);
669
+ }
670
+ }