rngine 0.8.0 → 0.8.2

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 (585) hide show
  1. package/README.md +50 -25
  2. package/android/CMakeLists.txt +45 -2
  3. package/android/build.gradle +1 -3
  4. package/android/kls_database.db +0 -0
  5. package/android/src/main/cpp/game-view.cpp +29 -0
  6. package/android/src/main/java/com/margelo/nitro/rngine/GameEngine.kt +1 -28
  7. package/android/src/main/java/com/margelo/nitro/rngine/GameView.kt +22 -166
  8. package/android/src/main/java/com/margelo/nitro/rngine/SvgLoaderHelper.kt +24 -0
  9. package/lib/module/GameMethods.js +44 -0
  10. package/lib/module/GameMethods.js.map +1 -1
  11. package/lib/module/GameMethods.nitro.js.map +1 -1
  12. package/lib/module/index.js +0 -1
  13. package/lib/module/index.js.map +1 -1
  14. package/lib/typescript/src/GameMethods.d.ts +1 -0
  15. package/lib/typescript/src/GameMethods.d.ts.map +1 -1
  16. package/lib/typescript/src/GameMethods.nitro.d.ts +3 -0
  17. package/lib/typescript/src/GameMethods.nitro.d.ts.map +1 -1
  18. package/lib/typescript/src/index.d.ts +0 -1
  19. package/lib/typescript/src/index.d.ts.map +1 -1
  20. package/lib/typescript/src/nativeTypes.d.ts +6 -0
  21. package/lib/typescript/src/nativeTypes.d.ts.map +1 -1
  22. package/nitro.json +0 -10
  23. package/nitrogen/generated/android/rngine+autolinking.cmake +0 -2
  24. package/nitrogen/generated/android/rngineOnLoad.cpp +0 -16
  25. package/nitrogen/generated/ios/Rngine-Swift-Cxx-Bridge.cpp +0 -33
  26. package/nitrogen/generated/ios/Rngine-Swift-Cxx-Bridge.hpp +0 -96
  27. package/nitrogen/generated/ios/Rngine-Swift-Cxx-Umbrella.hpp +0 -9
  28. package/nitrogen/generated/ios/RngineAutolinking.mm +0 -8
  29. package/nitrogen/generated/ios/RngineAutolinking.swift +0 -12
  30. package/nitrogen/generated/shared/c++/Entity.hpp +13 -1
  31. package/nitrogen/generated/shared/c++/EntityUpdate.hpp +13 -1
  32. package/nitrogen/generated/shared/c++/HybridGameMethodsSpec.cpp +3 -0
  33. package/nitrogen/generated/shared/c++/HybridGameMethodsSpec.hpp +4 -0
  34. package/nitrogen/generated/shared/c++/Screen.hpp +14 -2
  35. package/package.json +4 -1
  36. package/shared/CollisionUtils.hpp +1 -6
  37. package/{android/src/main/cpp/ColorUtils.hpp → shared/ColorUtils.cpp} +8 -12
  38. package/shared/ColorUtils.hpp +7 -0
  39. package/shared/GameLoop.cpp +45 -27
  40. package/shared/GameLoop.hpp +1 -11
  41. package/shared/GameMethods.cpp +103 -6
  42. package/shared/GameMethods.hpp +17 -0
  43. package/shared/GameRenderer.cpp +431 -0
  44. package/shared/GameRenderer.hpp +65 -0
  45. package/shared/GameStats.hpp +3 -3
  46. package/shared/Overlap.hpp +9 -0
  47. package/shared/skia/include/android/AHardwareBufferUtils.h +26 -0
  48. package/shared/skia/include/android/GrAHardwareBufferUtils.h +97 -0
  49. package/shared/skia/include/android/SkAndroidFrameworkUtils.h +83 -0
  50. package/shared/skia/include/android/SkAnimatedImage.h +193 -0
  51. package/shared/skia/include/android/SkCanvasAndroid.h +20 -0
  52. package/shared/skia/include/android/SkImageAndroid.h +100 -0
  53. package/shared/skia/include/android/SkSurfaceAndroid.h +50 -0
  54. package/shared/skia/include/android/graphite/SurfaceAndroid.h +59 -0
  55. package/shared/skia/include/android/vk/AndroidVulkanMemoryAllocator.h +31 -0
  56. package/shared/skia/include/codec/SkAndroidCodec.h +302 -0
  57. package/shared/skia/include/codec/SkAvifDecoder.h +80 -0
  58. package/shared/skia/include/codec/SkBmpDecoder.h +44 -0
  59. package/shared/skia/include/codec/SkBmpRustDecoder.h +42 -0
  60. package/shared/skia/include/codec/SkCodec.h +1178 -0
  61. package/shared/skia/include/codec/SkCodecAnimation.h +61 -0
  62. package/shared/skia/include/codec/SkEncodedImageFormat.h +33 -0
  63. package/shared/skia/include/codec/SkEncodedOrigin.h +71 -0
  64. package/shared/skia/include/codec/SkGifDecoder.h +44 -0
  65. package/shared/skia/include/codec/SkIcoDecoder.h +44 -0
  66. package/shared/skia/include/codec/SkJpegDecoder.h +51 -0
  67. package/shared/skia/include/codec/SkJpegxlDecoder.h +44 -0
  68. package/shared/skia/include/codec/SkPixmapUtils.h +31 -0
  69. package/shared/skia/include/codec/SkPngChunkReader.h +45 -0
  70. package/shared/skia/include/codec/SkPngDecoder.h +51 -0
  71. package/shared/skia/include/codec/SkPngRustDecoder.h +30 -0
  72. package/shared/skia/include/codec/SkRawDecoder.h +50 -0
  73. package/shared/skia/include/codec/SkWbmpDecoder.h +44 -0
  74. package/shared/skia/include/codec/SkWebpDecoder.h +51 -0
  75. package/shared/skia/include/config/SkUserConfig.h +141 -0
  76. package/shared/skia/include/core/SkAlphaType.h +45 -0
  77. package/shared/skia/include/core/SkAnnotation.h +52 -0
  78. package/shared/skia/include/core/SkArc.h +69 -0
  79. package/shared/skia/include/core/SkBBHFactory.h +67 -0
  80. package/shared/skia/include/core/SkBitmap.h +1264 -0
  81. package/shared/skia/include/core/SkBlendMode.h +112 -0
  82. package/shared/skia/include/core/SkBlender.h +30 -0
  83. package/shared/skia/include/core/SkBlurTypes.h +20 -0
  84. package/shared/skia/include/core/SkCPUContext.h +31 -0
  85. package/shared/skia/include/core/SkCPURecorder.h +76 -0
  86. package/shared/skia/include/core/SkCanvas.h +2770 -0
  87. package/shared/skia/include/core/SkCanvasVirtualEnforcer.h +61 -0
  88. package/shared/skia/include/core/SkCapabilities.h +35 -0
  89. package/shared/skia/include/core/SkClipOp.h +19 -0
  90. package/shared/skia/include/core/SkColor.h +469 -0
  91. package/shared/skia/include/core/SkColorFilter.h +150 -0
  92. package/shared/skia/include/core/SkColorSpace.h +432 -0
  93. package/shared/skia/include/core/SkColorTable.h +62 -0
  94. package/shared/skia/include/core/SkColorType.h +159 -0
  95. package/shared/skia/include/core/SkContourMeasure.h +215 -0
  96. package/shared/skia/include/core/SkCoverageMode.h +28 -0
  97. package/shared/skia/include/core/SkCubicMap.h +47 -0
  98. package/shared/skia/include/core/SkData.h +225 -0
  99. package/shared/skia/include/core/SkDataTable.h +122 -0
  100. package/shared/skia/include/core/SkDocument.h +93 -0
  101. package/shared/skia/include/core/SkDrawable.h +178 -0
  102. package/shared/skia/include/core/SkExecutor.h +59 -0
  103. package/shared/skia/include/core/SkFlattenable.h +115 -0
  104. package/shared/skia/include/core/SkFont.h +536 -0
  105. package/shared/skia/include/core/SkFontArguments.h +116 -0
  106. package/shared/skia/include/core/SkFontMetrics.h +139 -0
  107. package/shared/skia/include/core/SkFontMgr.h +178 -0
  108. package/shared/skia/include/core/SkFontParameters.h +43 -0
  109. package/shared/skia/include/core/SkFontScanner.h +45 -0
  110. package/shared/skia/include/core/SkFontStyle.h +84 -0
  111. package/shared/skia/include/core/SkFontTypes.h +25 -0
  112. package/shared/skia/include/core/SkFourByteTag.h +19 -0
  113. package/shared/skia/include/core/SkGraphics.h +169 -0
  114. package/shared/skia/include/core/SkImage.h +918 -0
  115. package/shared/skia/include/core/SkImageFilter.h +119 -0
  116. package/shared/skia/include/core/SkImageGenerator.h +140 -0
  117. package/shared/skia/include/core/SkImageInfo.h +634 -0
  118. package/shared/skia/include/core/SkM44.h +442 -0
  119. package/shared/skia/include/core/SkMallocPixelRef.h +45 -0
  120. package/shared/skia/include/core/SkMaskFilter.h +45 -0
  121. package/shared/skia/include/core/SkMatrix.h +1887 -0
  122. package/shared/skia/include/core/SkMesh.h +429 -0
  123. package/shared/skia/include/core/SkMilestone.h +9 -0
  124. package/shared/skia/include/core/SkOpenTypeSVGDecoder.h +30 -0
  125. package/shared/skia/include/core/SkOverdrawCanvas.h +94 -0
  126. package/shared/skia/include/core/SkPaint.h +698 -0
  127. package/shared/skia/include/core/SkPath.h +1145 -0
  128. package/shared/skia/include/core/SkPathBuilder.h +1052 -0
  129. package/shared/skia/include/core/SkPathEffect.h +88 -0
  130. package/shared/skia/include/core/SkPathIter.h +90 -0
  131. package/shared/skia/include/core/SkPathMeasure.h +96 -0
  132. package/shared/skia/include/core/SkPathTypes.h +71 -0
  133. package/shared/skia/include/core/SkPathUtils.h +39 -0
  134. package/shared/skia/include/core/SkPicture.h +291 -0
  135. package/shared/skia/include/core/SkPictureRecorder.h +115 -0
  136. package/shared/skia/include/core/SkPixelRef.h +120 -0
  137. package/shared/skia/include/core/SkPixmap.h +736 -0
  138. package/shared/skia/include/core/SkPoint.h +560 -0
  139. package/shared/skia/include/core/SkPoint3.h +149 -0
  140. package/shared/skia/include/core/SkRRect.h +548 -0
  141. package/shared/skia/include/core/SkRSXform.h +71 -0
  142. package/shared/skia/include/core/SkRasterHandleAllocator.h +94 -0
  143. package/shared/skia/include/core/SkRecorder.h +49 -0
  144. package/shared/skia/include/core/SkRect.h +1419 -0
  145. package/shared/skia/include/core/SkRefCnt.h +391 -0
  146. package/shared/skia/include/core/SkRegion.h +701 -0
  147. package/shared/skia/include/core/SkSamplingOptions.h +107 -0
  148. package/shared/skia/include/core/SkScalar.h +148 -0
  149. package/shared/skia/include/core/SkSerialProcs.h +127 -0
  150. package/shared/skia/include/core/SkShader.h +123 -0
  151. package/shared/skia/include/core/SkSize.h +93 -0
  152. package/shared/skia/include/core/SkSpan.h +174 -0
  153. package/shared/skia/include/core/SkStream.h +524 -0
  154. package/shared/skia/include/core/SkStrikeRef.h +96 -0
  155. package/shared/skia/include/core/SkString.h +297 -0
  156. package/shared/skia/include/core/SkStrokeRec.h +160 -0
  157. package/shared/skia/include/core/SkSurface.h +689 -0
  158. package/shared/skia/include/core/SkSurfaceProps.h +122 -0
  159. package/shared/skia/include/core/SkSwizzle.h +21 -0
  160. package/shared/skia/include/core/SkTextBlob.h +541 -0
  161. package/shared/skia/include/core/SkTextureCompressionType.h +30 -0
  162. package/shared/skia/include/core/SkTileMode.h +41 -0
  163. package/shared/skia/include/core/SkTiledImageUtils.h +125 -0
  164. package/shared/skia/include/core/SkTraceMemoryDump.h +121 -0
  165. package/shared/skia/include/core/SkTypeface.h +468 -0
  166. package/shared/skia/include/core/SkTypes.h +193 -0
  167. package/shared/skia/include/core/SkUnPreMultiply.h +55 -0
  168. package/shared/skia/include/core/SkVertices.h +136 -0
  169. package/shared/skia/include/core/SkYUVAInfo.h +311 -0
  170. package/shared/skia/include/core/SkYUVAPixmaps.h +335 -0
  171. package/shared/skia/include/docs/SkMultiPictureDocument.h +53 -0
  172. package/shared/skia/include/docs/SkPDFDocument.h +277 -0
  173. package/shared/skia/include/docs/SkPDFJpegHelpers.h +41 -0
  174. package/shared/skia/include/docs/SkXPSDocument.h +43 -0
  175. package/shared/skia/include/effects/Sk1DPathEffect.h +40 -0
  176. package/shared/skia/include/effects/Sk2DPathEffect.h +33 -0
  177. package/shared/skia/include/effects/SkBlenders.h +27 -0
  178. package/shared/skia/include/effects/SkBlurMaskFilter.h +35 -0
  179. package/shared/skia/include/effects/SkColorMatrix.h +57 -0
  180. package/shared/skia/include/effects/SkColorMatrixFilter.h +22 -0
  181. package/shared/skia/include/effects/SkCornerPathEffect.h +32 -0
  182. package/shared/skia/include/effects/SkDashPathEffect.h +43 -0
  183. package/shared/skia/include/effects/SkDiscretePathEffect.h +37 -0
  184. package/shared/skia/include/effects/SkGradient.h +206 -0
  185. package/shared/skia/include/effects/SkHighContrastFilter.h +84 -0
  186. package/shared/skia/include/effects/SkImageFilters.h +641 -0
  187. package/shared/skia/include/effects/SkLumaColorFilter.h +37 -0
  188. package/shared/skia/include/effects/SkOverdrawColorFilter.h +33 -0
  189. package/shared/skia/include/effects/SkPerlinNoiseShader.h +53 -0
  190. package/shared/skia/include/effects/SkRuntimeEffect.h +503 -0
  191. package/shared/skia/include/effects/SkShaderMaskFilter.h +28 -0
  192. package/shared/skia/include/effects/SkTableMaskFilter.h +47 -0
  193. package/shared/skia/include/effects/SkTrimPathEffect.h +45 -0
  194. package/shared/skia/include/encode/SkEncoder.h +63 -0
  195. package/shared/skia/include/encode/SkICC.h +36 -0
  196. package/shared/skia/include/encode/SkJpegEncoder.h +127 -0
  197. package/shared/skia/include/encode/SkPngEncoder.h +132 -0
  198. package/shared/skia/include/encode/SkPngRustEncoder.h +121 -0
  199. package/shared/skia/include/encode/SkWebpEncoder.h +87 -0
  200. package/shared/skia/include/gpu/GpuTypes.h +98 -0
  201. package/shared/skia/include/gpu/MutableTextureState.h +68 -0
  202. package/shared/skia/include/gpu/ShaderErrorHandler.h +46 -0
  203. package/shared/skia/include/gpu/ganesh/GrBackendSemaphore.h +50 -0
  204. package/shared/skia/include/gpu/ganesh/GrBackendSurface.h +257 -0
  205. package/shared/skia/include/gpu/ganesh/GrContextOptions.h +384 -0
  206. package/shared/skia/include/gpu/ganesh/GrContextThreadSafeProxy.h +175 -0
  207. package/shared/skia/include/gpu/ganesh/GrDirectContext.h +1027 -0
  208. package/shared/skia/include/gpu/ganesh/GrDriverBugWorkarounds.h +53 -0
  209. package/shared/skia/include/gpu/ganesh/GrDriverBugWorkaroundsAutogen.h +49 -0
  210. package/shared/skia/include/gpu/ganesh/GrExternalTextureGenerator.h +54 -0
  211. package/shared/skia/include/gpu/ganesh/GrRecordingContext.h +300 -0
  212. package/shared/skia/include/gpu/ganesh/GrTypes.h +193 -0
  213. package/shared/skia/include/gpu/ganesh/GrYUVABackendTextures.h +130 -0
  214. package/shared/skia/include/gpu/ganesh/SkImageGanesh.h +361 -0
  215. package/shared/skia/include/gpu/ganesh/SkMeshGanesh.h +57 -0
  216. package/shared/skia/include/gpu/ganesh/SkSurfaceGanesh.h +218 -0
  217. package/shared/skia/include/gpu/ganesh/d3d/GrD3DBackendContext.h +35 -0
  218. package/shared/skia/include/gpu/ganesh/d3d/GrD3DBackendSemaphore.h +20 -0
  219. package/shared/skia/include/gpu/ganesh/d3d/GrD3DBackendSurface.h +59 -0
  220. package/shared/skia/include/gpu/ganesh/d3d/GrD3DDirectContext.h +28 -0
  221. package/shared/skia/include/gpu/ganesh/d3d/GrD3DTypes.h +248 -0
  222. package/shared/skia/include/gpu/ganesh/gl/GrGLAssembleHelpers.h +17 -0
  223. package/shared/skia/include/gpu/ganesh/gl/GrGLAssembleInterface.h +45 -0
  224. package/shared/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h +64 -0
  225. package/shared/skia/include/gpu/ganesh/gl/GrGLConfig.h +69 -0
  226. package/shared/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +30 -0
  227. package/shared/skia/include/gpu/ganesh/gl/GrGLExtensions.h +79 -0
  228. package/shared/skia/include/gpu/ganesh/gl/GrGLFunctions.h +313 -0
  229. package/shared/skia/include/gpu/ganesh/gl/GrGLInterface.h +337 -0
  230. package/shared/skia/include/gpu/ganesh/gl/GrGLMakeWebGLInterface.h +19 -0
  231. package/shared/skia/include/gpu/ganesh/gl/GrGLTypes.h +219 -0
  232. package/shared/skia/include/gpu/ganesh/gl/egl/GrGLMakeEGLInterface.h +23 -0
  233. package/shared/skia/include/gpu/ganesh/gl/epoxy/GrGLMakeEpoxyEGLInterface.h +20 -0
  234. package/shared/skia/include/gpu/ganesh/gl/glx/GrGLMakeGLXInterface.h +23 -0
  235. package/shared/skia/include/gpu/ganesh/gl/ios/GrGLMakeIOSInterface.h +20 -0
  236. package/shared/skia/include/gpu/ganesh/gl/mac/GrGLMakeMacInterface.h +20 -0
  237. package/shared/skia/include/gpu/ganesh/gl/win/GrGLMakeWinInterface.h +20 -0
  238. package/shared/skia/include/gpu/ganesh/mock/GrMockBackendSurface.h +59 -0
  239. package/shared/skia/include/gpu/ganesh/mock/GrMockTypes.h +166 -0
  240. package/shared/skia/include/gpu/ganesh/mtl/GrMtlBackendContext.h +21 -0
  241. package/shared/skia/include/gpu/ganesh/mtl/GrMtlBackendSemaphore.h +23 -0
  242. package/shared/skia/include/gpu/ganesh/mtl/GrMtlBackendSurface.h +44 -0
  243. package/shared/skia/include/gpu/ganesh/mtl/GrMtlDirectContext.h +30 -0
  244. package/shared/skia/include/gpu/ganesh/mtl/GrMtlTypes.h +61 -0
  245. package/shared/skia/include/gpu/ganesh/mtl/SkSurfaceMetal.h +73 -0
  246. package/shared/skia/include/gpu/ganesh/vk/GrBackendDrawableInfo.h +44 -0
  247. package/shared/skia/include/gpu/ganesh/vk/GrVkBackendSemaphore.h +20 -0
  248. package/shared/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h +71 -0
  249. package/shared/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +33 -0
  250. package/shared/skia/include/gpu/ganesh/vk/GrVkTypes.h +101 -0
  251. package/shared/skia/include/gpu/graphite/BackendSemaphore.h +60 -0
  252. package/shared/skia/include/gpu/graphite/BackendTexture.h +65 -0
  253. package/shared/skia/include/gpu/graphite/Context.h +440 -0
  254. package/shared/skia/include/gpu/graphite/ContextOptions.h +239 -0
  255. package/shared/skia/include/gpu/graphite/GraphiteTypes.h +315 -0
  256. package/shared/skia/include/gpu/graphite/Image.h +428 -0
  257. package/shared/skia/include/gpu/graphite/ImageProvider.h +68 -0
  258. package/shared/skia/include/gpu/graphite/PersistentPipelineStorage.h +45 -0
  259. package/shared/skia/include/gpu/graphite/PrecompileContext.h +109 -0
  260. package/shared/skia/include/gpu/graphite/Recorder.h +355 -0
  261. package/shared/skia/include/gpu/graphite/Recording.h +100 -0
  262. package/shared/skia/include/gpu/graphite/Surface.h +121 -0
  263. package/shared/skia/include/gpu/graphite/TextureInfo.h +133 -0
  264. package/shared/skia/include/gpu/graphite/YUVABackendTextures.h +148 -0
  265. package/shared/skia/include/gpu/graphite/dawn/DawnBackendContext.h +77 -0
  266. package/shared/skia/include/gpu/graphite/dawn/DawnGraphiteTypes.h +163 -0
  267. package/shared/skia/include/gpu/graphite/dawn/DawnTypes.h +9 -0
  268. package/shared/skia/include/gpu/graphite/dawn/DawnUtils.h +9 -0
  269. package/shared/skia/include/gpu/graphite/mtl/MtlBackendContext.h +34 -0
  270. package/shared/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +73 -0
  271. package/shared/skia/include/gpu/graphite/mtl/MtlGraphiteTypesUtils.h +10 -0
  272. package/shared/skia/include/gpu/graphite/mtl/MtlGraphiteTypes_cpp.h +50 -0
  273. package/shared/skia/include/gpu/graphite/mtl/MtlGraphiteUtils.h +9 -0
  274. package/shared/skia/include/gpu/graphite/precompile/PaintOptions.h +211 -0
  275. package/shared/skia/include/gpu/graphite/precompile/Precompile.h +59 -0
  276. package/shared/skia/include/gpu/graphite/precompile/PrecompileBase.h +76 -0
  277. package/shared/skia/include/gpu/graphite/precompile/PrecompileBlender.h +56 -0
  278. package/shared/skia/include/gpu/graphite/precompile/PrecompileColorFilter.h +95 -0
  279. package/shared/skia/include/gpu/graphite/precompile/PrecompileImageFilter.h +116 -0
  280. package/shared/skia/include/gpu/graphite/precompile/PrecompileMaskFilter.h +49 -0
  281. package/shared/skia/include/gpu/graphite/precompile/PrecompileRuntimeEffect.h +47 -0
  282. package/shared/skia/include/gpu/graphite/precompile/PrecompileShader.h +268 -0
  283. package/shared/skia/include/gpu/graphite/vk/VulkanGraphiteContext.h +31 -0
  284. package/shared/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +104 -0
  285. package/shared/skia/include/gpu/graphite/vk/precompile/VulkanPrecompileShader.h +39 -0
  286. package/shared/skia/include/gpu/mtl/MtlMemoryAllocator.h +41 -0
  287. package/shared/skia/include/gpu/vk/VulkanBackendContext.h +57 -0
  288. package/shared/skia/include/gpu/vk/VulkanExtensions.h +73 -0
  289. package/shared/skia/include/gpu/vk/VulkanMemoryAllocator.h +117 -0
  290. package/shared/skia/include/gpu/vk/VulkanMutableTextureState.h +26 -0
  291. package/shared/skia/include/gpu/vk/VulkanPreferredFeatures.h +225 -0
  292. package/shared/skia/include/gpu/vk/VulkanTypes.h +245 -0
  293. package/shared/skia/include/pathops/SkPathOps.h +150 -0
  294. package/shared/skia/include/ports/SkCFObject.h +180 -0
  295. package/shared/skia/include/ports/SkFontConfigInterface.h +112 -0
  296. package/shared/skia/include/ports/SkFontMgr_FontConfigInterface.h +24 -0
  297. package/shared/skia/include/ports/SkFontMgr_Fontations.h +20 -0
  298. package/shared/skia/include/ports/SkFontMgr_android.h +48 -0
  299. package/shared/skia/include/ports/SkFontMgr_android_ndk.h +27 -0
  300. package/shared/skia/include/ports/SkFontMgr_data.h +22 -0
  301. package/shared/skia/include/ports/SkFontMgr_directory.h +21 -0
  302. package/shared/skia/include/ports/SkFontMgr_empty.h +21 -0
  303. package/shared/skia/include/ports/SkFontMgr_fontconfig.h +24 -0
  304. package/shared/skia/include/ports/SkFontMgr_fuchsia.h +21 -0
  305. package/shared/skia/include/ports/SkFontMgr_mac_ct.h +27 -0
  306. package/shared/skia/include/ports/SkFontScanner_Fontations.h +15 -0
  307. package/shared/skia/include/ports/SkFontScanner_FreeType.h +15 -0
  308. package/shared/skia/include/ports/SkImageGeneratorCG.h +28 -0
  309. package/shared/skia/include/ports/SkImageGeneratorNDK.h +40 -0
  310. package/shared/skia/include/ports/SkImageGeneratorWIC.h +41 -0
  311. package/shared/skia/include/ports/SkTypeface_fontations.h +24 -0
  312. package/shared/skia/include/ports/SkTypeface_mac.h +44 -0
  313. package/shared/skia/include/ports/SkTypeface_win.h +63 -0
  314. package/shared/skia/include/private/SingleOwner.h +75 -0
  315. package/shared/skia/include/private/SkAPI.h +52 -0
  316. package/shared/skia/include/private/SkASAN.h +56 -0
  317. package/shared/skia/include/private/SkAlign.h +51 -0
  318. package/shared/skia/include/private/SkAlignedStorage.h +32 -0
  319. package/shared/skia/include/private/SkAnySubclass.h +79 -0
  320. package/shared/skia/include/private/SkAssert.h +203 -0
  321. package/shared/skia/include/private/SkAttributes.h +96 -0
  322. package/shared/skia/include/private/SkCPUTypes.h +25 -0
  323. package/shared/skia/include/private/SkContainers.h +54 -0
  324. package/shared/skia/include/private/SkDebug.h +27 -0
  325. package/shared/skia/include/private/SkDeque.h +138 -0
  326. package/shared/skia/include/private/SkEncodedInfo.h +249 -0
  327. package/shared/skia/include/private/SkEnumBitMask.h +92 -0
  328. package/shared/skia/include/private/SkExif.h +69 -0
  329. package/shared/skia/include/private/SkFeatures.h +173 -0
  330. package/shared/skia/include/private/SkFixed.h +143 -0
  331. package/shared/skia/include/private/SkFloatingPoint.h +183 -0
  332. package/shared/skia/include/private/SkGainmapInfo.h +140 -0
  333. package/shared/skia/include/private/SkGainmapShader.h +60 -0
  334. package/shared/skia/include/private/SkHdrMetadata.h +357 -0
  335. package/shared/skia/include/private/SkIDChangeListener.h +76 -0
  336. package/shared/skia/include/private/SkJpegGainmapEncoder.h +48 -0
  337. package/shared/skia/include/private/SkJpegMetadataDecoder.h +103 -0
  338. package/shared/skia/include/private/SkLoadUserConfig.h +64 -0
  339. package/shared/skia/include/private/SkLog.h +62 -0
  340. package/shared/skia/include/private/SkLogPriority.h +34 -0
  341. package/shared/skia/include/private/SkMacros.h +170 -0
  342. package/shared/skia/include/private/SkMalloc.h +152 -0
  343. package/shared/skia/include/private/SkMath.h +77 -0
  344. package/shared/skia/include/private/SkMutex.h +72 -0
  345. package/shared/skia/include/private/SkNoncopyable.h +30 -0
  346. package/shared/skia/include/private/SkOnce.h +55 -0
  347. package/shared/skia/include/private/SkPathRef.h +90 -0
  348. package/shared/skia/include/private/SkPixelStorage.h +52 -0
  349. package/shared/skia/include/private/SkSLSampleUsage.h +85 -0
  350. package/shared/skia/include/private/SkSafe32.h +49 -0
  351. package/shared/skia/include/private/SkSemaphore.h +84 -0
  352. package/shared/skia/include/private/SkTArray.h +823 -0
  353. package/shared/skia/include/private/SkTDArray.h +247 -0
  354. package/shared/skia/include/private/SkTFitsIn.h +92 -0
  355. package/shared/skia/include/private/SkTLogic.h +56 -0
  356. package/shared/skia/include/private/SkTPin.h +23 -0
  357. package/shared/skia/include/private/SkTemplates.h +500 -0
  358. package/shared/skia/include/private/SkThreadAnnotations.h +104 -0
  359. package/shared/skia/include/private/SkThreadID.h +23 -0
  360. package/shared/skia/include/private/SkTo.h +39 -0
  361. package/shared/skia/include/private/SkTypeTraits.h +53 -0
  362. package/shared/skia/include/private/SkWeakRefCnt.h +173 -0
  363. package/shared/skia/include/private/SkXmp.h +62 -0
  364. package/shared/skia/include/private/chromium/GrDeferredDisplayList.h +120 -0
  365. package/shared/skia/include/private/chromium/GrDeferredDisplayListRecorder.h +62 -0
  366. package/shared/skia/include/private/chromium/GrPromiseImageTexture.h +43 -0
  367. package/shared/skia/include/private/chromium/GrSurfaceCharacterization.h +211 -0
  368. package/shared/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +131 -0
  369. package/shared/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +150 -0
  370. package/shared/skia/include/private/chromium/SkCodecsICCProfileChromium.h +52 -0
  371. package/shared/skia/include/private/chromium/SkDiscardableMemory.h +70 -0
  372. package/shared/skia/include/private/chromium/SkExifChromium.h +26 -0
  373. package/shared/skia/include/private/chromium/SkImageChromium.h +117 -0
  374. package/shared/skia/include/private/chromium/SkPMColor.h +38 -0
  375. package/shared/skia/include/private/chromium/Slug.h +72 -0
  376. package/shared/skia/include/private/gpu/ganesh/GrContext_Base.h +104 -0
  377. package/shared/skia/include/private/gpu/ganesh/GrD3DTypesMinimal.h +60 -0
  378. package/shared/skia/include/private/gpu/ganesh/GrImageContext.h +56 -0
  379. package/shared/skia/include/private/gpu/ganesh/GrTextureGenerator.h +66 -0
  380. package/shared/skia/include/private/gpu/ganesh/GrTypesPriv.h +959 -0
  381. package/shared/skia/include/private/gpu/vk/SkiaVulkan.h +36 -0
  382. package/shared/skia/include/sksl/SkSLDebugTrace.h +25 -0
  383. package/shared/skia/include/sksl/SkSLVersion.h +27 -0
  384. package/shared/skia/include/svg/SkSVGCanvas.h +62 -0
  385. package/shared/skia/include/third_party/vulkan/vulkan/vk_icd.h +245 -0
  386. package/shared/skia/include/third_party/vulkan/vulkan/vk_layer.h +192 -0
  387. package/shared/skia/include/third_party/vulkan/vulkan/vk_platform.h +84 -0
  388. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_av1std.h +394 -0
  389. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_av1std_decode.h +109 -0
  390. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_av1std_encode.h +143 -0
  391. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std.h +312 -0
  392. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_decode.h +77 -0
  393. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_encode.h +147 -0
  394. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std.h +446 -0
  395. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_decode.h +67 -0
  396. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_encode.h +157 -0
  397. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_vp9std.h +151 -0
  398. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_vp9std_decode.h +68 -0
  399. package/shared/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codecs_common.h +36 -0
  400. package/shared/skia/include/third_party/vulkan/vulkan/vulkan.h +103 -0
  401. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_android.h +159 -0
  402. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_beta.h +375 -0
  403. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_core.h +25896 -0
  404. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_directfb.h +59 -0
  405. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_fuchsia.h +282 -0
  406. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_ggp.h +62 -0
  407. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_ios.h +50 -0
  408. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_macos.h +50 -0
  409. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_metal.h +244 -0
  410. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_ohos.h +120 -0
  411. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_screen.h +114 -0
  412. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_vi.h +50 -0
  413. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_wayland.h +59 -0
  414. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_win32.h +372 -0
  415. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_xcb.h +60 -0
  416. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_xlib.h +60 -0
  417. package/shared/skia/include/third_party/vulkan/vulkan/vulkan_xlib_xrandr.h +50 -0
  418. package/shared/skia/include/utils/SkCamera.h +109 -0
  419. package/shared/skia/include/utils/SkCanvasStateUtils.h +81 -0
  420. package/shared/skia/include/utils/SkCustomTypeface.h +70 -0
  421. package/shared/skia/include/utils/SkEventTracer.h +93 -0
  422. package/shared/skia/include/utils/SkNWayCanvas.h +123 -0
  423. package/shared/skia/include/utils/SkNoDrawCanvas.h +78 -0
  424. package/shared/skia/include/utils/SkNullCanvas.h +22 -0
  425. package/shared/skia/include/utils/SkOrderedFontMgr.h +66 -0
  426. package/shared/skia/include/utils/SkPaintFilterCanvas.h +140 -0
  427. package/shared/skia/include/utils/SkParse.h +36 -0
  428. package/shared/skia/include/utils/SkParsePath.h +33 -0
  429. package/shared/skia/include/utils/SkShadowUtils.h +102 -0
  430. package/shared/skia/include/utils/SkTextUtils.h +43 -0
  431. package/shared/skia/include/utils/SkTraceEventPhase.h +19 -0
  432. package/shared/skia/include/utils/mac/SkCGUtils.h +90 -0
  433. package/shared/skia/modules/jsonreader/SkJSONReader.cpp +996 -0
  434. package/shared/skia/modules/jsonreader/SkJSONReader.h +389 -0
  435. package/shared/skia/modules/skcms/skcms.h +10 -0
  436. package/shared/skia/modules/skcms/src/Transform_inl.h +1600 -0
  437. package/shared/skia/modules/skcms/src/skcms_Transform.h +167 -0
  438. package/shared/skia/modules/skcms/src/skcms_internals.h +157 -0
  439. package/shared/skia/modules/skcms/src/skcms_public.h +496 -0
  440. package/shared/skia/modules/skottie/include/ExternalLayer.h +56 -0
  441. package/shared/skia/modules/skottie/include/Skottie.h +324 -0
  442. package/shared/skia/modules/skottie/include/SkottieProperty.h +190 -0
  443. package/shared/skia/modules/skottie/include/SlotManager.h +113 -0
  444. package/shared/skia/modules/skottie/include/TextShaper.h +197 -0
  445. package/shared/skia/modules/skottie/src/SkottieValue.h +56 -0
  446. package/shared/skia/modules/skottie/src/animator/Animator.h +89 -0
  447. package/shared/skia/modules/skottie/src/text/Font.h +82 -0
  448. package/shared/skia/modules/skottie/src/text/TextAdapter.h +155 -0
  449. package/shared/skia/modules/skottie/src/text/TextAnimator.h +122 -0
  450. package/shared/skia/modules/skottie/src/text/TextValue.h +28 -0
  451. package/shared/skia/modules/skparagraph/include/DartTypes.h +153 -0
  452. package/shared/skia/modules/skparagraph/include/FontArguments.h +46 -0
  453. package/shared/skia/modules/skparagraph/include/FontCollection.h +76 -0
  454. package/shared/skia/modules/skparagraph/include/Metrics.h +98 -0
  455. package/shared/skia/modules/skparagraph/include/Paragraph.h +289 -0
  456. package/shared/skia/modules/skparagraph/include/ParagraphBuilder.h +94 -0
  457. package/shared/skia/modules/skparagraph/include/ParagraphCache.h +52 -0
  458. package/shared/skia/modules/skparagraph/include/ParagraphPainter.h +63 -0
  459. package/shared/skia/modules/skparagraph/include/ParagraphStyle.h +160 -0
  460. package/shared/skia/modules/skparagraph/include/TextShadow.h +30 -0
  461. package/shared/skia/modules/skparagraph/include/TextStyle.h +392 -0
  462. package/shared/skia/modules/skparagraph/include/TypefaceFontProvider.h +78 -0
  463. package/shared/skia/modules/skresources/include/SkResources.h +291 -0
  464. package/shared/skia/modules/sksg/include/SkSGClipEffect.h +61 -0
  465. package/shared/skia/modules/sksg/include/SkSGColorFilter.h +135 -0
  466. package/shared/skia/modules/sksg/include/SkSGDraw.h +57 -0
  467. package/shared/skia/modules/sksg/include/SkSGEffectNode.h +50 -0
  468. package/shared/skia/modules/sksg/include/SkSGGeometryEffect.h +207 -0
  469. package/shared/skia/modules/sksg/include/SkSGGeometryNode.h +54 -0
  470. package/shared/skia/modules/sksg/include/SkSGGradient.h +108 -0
  471. package/shared/skia/modules/sksg/include/SkSGGroup.h +65 -0
  472. package/shared/skia/modules/sksg/include/SkSGImage.h +59 -0
  473. package/shared/skia/modules/sksg/include/SkSGInvalidationController.h +46 -0
  474. package/shared/skia/modules/sksg/include/SkSGMaskEffect.h +65 -0
  475. package/shared/skia/modules/sksg/include/SkSGMerge.h +74 -0
  476. package/shared/skia/modules/sksg/include/SkSGNode.h +128 -0
  477. package/shared/skia/modules/sksg/include/SkSGOpacityEffect.h +54 -0
  478. package/shared/skia/modules/sksg/include/SkSGPaint.h +112 -0
  479. package/shared/skia/modules/sksg/include/SkSGPath.h +68 -0
  480. package/shared/skia/modules/sksg/include/SkSGPlane.h +47 -0
  481. package/shared/skia/modules/sksg/include/SkSGRect.h +122 -0
  482. package/shared/skia/modules/sksg/include/SkSGRenderEffect.h +283 -0
  483. package/shared/skia/modules/sksg/include/SkSGRenderNode.h +157 -0
  484. package/shared/skia/modules/sksg/include/SkSGScene.h +47 -0
  485. package/shared/skia/modules/sksg/include/SkSGText.h +82 -0
  486. package/shared/skia/modules/sksg/include/SkSGTransform.h +127 -0
  487. package/shared/skia/modules/skshaper/include/SkShaper.h +318 -0
  488. package/shared/skia/modules/skshaper/include/SkShaper_coretext.h +26 -0
  489. package/shared/skia/modules/skshaper/include/SkShaper_factory.h +41 -0
  490. package/shared/skia/modules/skshaper/include/SkShaper_harfbuzz.h +39 -0
  491. package/shared/skia/modules/skshaper/include/SkShaper_skunicode.h +28 -0
  492. package/shared/skia/modules/skunicode/include/SkUnicode.h +321 -0
  493. package/shared/skia/modules/skunicode/include/SkUnicode_icu.h +18 -0
  494. package/shared/skia/modules/skunicode/include/SkUnicode_libgrapheme.h +19 -0
  495. package/shared/skia/modules/svg/include/SkSVGAttribute.h +110 -0
  496. package/shared/skia/modules/svg/include/SkSVGAttributeParser.h +170 -0
  497. package/shared/skia/modules/svg/include/SkSVGCircle.h +56 -0
  498. package/shared/skia/modules/svg/include/SkSVGClipPath.h +41 -0
  499. package/shared/skia/modules/svg/include/SkSVGContainer.h +52 -0
  500. package/shared/skia/modules/svg/include/SkSVGDOM.h +111 -0
  501. package/shared/skia/modules/svg/include/SkSVGDefs.h +23 -0
  502. package/shared/skia/modules/svg/include/SkSVGEllipse.h +51 -0
  503. package/shared/skia/modules/svg/include/SkSVGFe.h +93 -0
  504. package/shared/skia/modules/svg/include/SkSVGFeBlend.h +54 -0
  505. package/shared/skia/modules/svg/include/SkSVGFeColorMatrix.h +55 -0
  506. package/shared/skia/modules/svg/include/SkSVGFeComponentTransfer.h +82 -0
  507. package/shared/skia/modules/svg/include/SkSVGFeComposite.h +55 -0
  508. package/shared/skia/modules/svg/include/SkSVGFeDisplacementMap.h +56 -0
  509. package/shared/skia/modules/svg/include/SkSVGFeFlood.h +42 -0
  510. package/shared/skia/modules/svg/include/SkSVGFeGaussianBlur.h +50 -0
  511. package/shared/skia/modules/svg/include/SkSVGFeImage.h +44 -0
  512. package/shared/skia/modules/svg/include/SkSVGFeLightSource.h +93 -0
  513. package/shared/skia/modules/svg/include/SkSVGFeLighting.h +131 -0
  514. package/shared/skia/modules/svg/include/SkSVGFeMerge.h +63 -0
  515. package/shared/skia/modules/svg/include/SkSVGFeMorphology.h +55 -0
  516. package/shared/skia/modules/svg/include/SkSVGFeOffset.h +44 -0
  517. package/shared/skia/modules/svg/include/SkSVGFeTurbulence.h +49 -0
  518. package/shared/skia/modules/svg/include/SkSVGFilter.h +48 -0
  519. package/shared/skia/modules/svg/include/SkSVGFilterContext.h +69 -0
  520. package/shared/skia/modules/svg/include/SkSVGG.h +23 -0
  521. package/shared/skia/modules/svg/include/SkSVGGradient.h +56 -0
  522. package/shared/skia/modules/svg/include/SkSVGHiddenContainer.h +23 -0
  523. package/shared/skia/modules/svg/include/SkSVGIDMapper.h +19 -0
  524. package/shared/skia/modules/svg/include/SkSVGImage.h +67 -0
  525. package/shared/skia/modules/svg/include/SkSVGLine.h +53 -0
  526. package/shared/skia/modules/svg/include/SkSVGLinearGradient.h +47 -0
  527. package/shared/skia/modules/svg/include/SkSVGMask.h +49 -0
  528. package/shared/skia/modules/svg/include/SkSVGNode.h +235 -0
  529. package/shared/skia/modules/svg/include/SkSVGOpenTypeSVGDecoder.h +37 -0
  530. package/shared/skia/modules/svg/include/SkSVGPath.h +46 -0
  531. package/shared/skia/modules/svg/include/SkSVGPattern.h +61 -0
  532. package/shared/skia/modules/svg/include/SkSVGPoly.h +56 -0
  533. package/shared/skia/modules/svg/include/SkSVGRadialGradient.h +48 -0
  534. package/shared/skia/modules/svg/include/SkSVGRect.h +56 -0
  535. package/shared/skia/modules/svg/include/SkSVGRenderContext.h +229 -0
  536. package/shared/skia/modules/svg/include/SkSVGSVG.h +60 -0
  537. package/shared/skia/modules/svg/include/SkSVGShape.h +40 -0
  538. package/shared/skia/modules/svg/include/SkSVGStop.h +36 -0
  539. package/shared/skia/modules/svg/include/SkSVGText.h +128 -0
  540. package/shared/skia/modules/svg/include/SkSVGTransformableNode.h +48 -0
  541. package/shared/skia/modules/svg/include/SkSVGTypes.h +740 -0
  542. package/shared/skia/modules/svg/include/SkSVGUse.h +49 -0
  543. package/shared/skia/modules/svg/include/SkSVGValue.h +85 -0
  544. package/shared/skia/src/core/SkArenaAlloc.h +371 -0
  545. package/shared/skia/src/core/SkAutoLocaleSetter.h +94 -0
  546. package/shared/skia/src/core/SkChecksum.h +118 -0
  547. package/shared/skia/src/core/SkLRUCache.h +143 -0
  548. package/shared/skia/src/core/SkMathPriv.h +225 -0
  549. package/shared/skia/src/core/SkTHash.h +714 -0
  550. package/shared/skia/src/core/SkTInternalLList.h +304 -0
  551. package/shared/skia/src/core/SkTLazy.h +216 -0
  552. package/shared/skia/src/core/SkUTF.h +102 -0
  553. package/shared/skia/src/gpu/ganesh/gl/GrGLDefines.h +1162 -0
  554. package/src/GameMethods.nitro.ts +4 -0
  555. package/src/GameMethods.ts +55 -0
  556. package/src/index.tsx +0 -1
  557. package/src/nativeTypes.ts +6 -0
  558. package/android/src/main/cpp/GameLoopJNI.cpp +0 -132
  559. package/android/src/main/java/com/margelo/nitro/rngine/Asset.kt +0 -9
  560. package/android/src/main/java/com/margelo/nitro/rngine/GameAssets.kt +0 -61
  561. package/android/src/main/java/com/margelo/nitro/rngine/Screen.kt +0 -9
  562. package/android/src/main/java/com/margelo/nitro/rngine/Shape.kt +0 -26
  563. package/android/src/main/java/com/margelo/nitro/rngine/Snapshot.kt +0 -3
  564. package/android/src/main/java/com/margelo/nitro/rngine/SnapshotSerializer.kt +0 -53
  565. package/lib/module/GameAssets.js +0 -41
  566. package/lib/module/GameAssets.js.map +0 -1
  567. package/lib/module/GameAssets.nitro.js +0 -5
  568. package/lib/module/GameAssets.nitro.js.map +0 -1
  569. package/lib/typescript/src/GameAssets.d.ts +0 -2
  570. package/lib/typescript/src/GameAssets.d.ts.map +0 -1
  571. package/lib/typescript/src/GameAssets.nitro.d.ts +0 -12
  572. package/lib/typescript/src/GameAssets.nitro.d.ts.map +0 -1
  573. package/nitrogen/generated/android/c++/JHybridGameAssetsSpec.cpp +0 -86
  574. package/nitrogen/generated/android/c++/JHybridGameAssetsSpec.hpp +0 -65
  575. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngine/HybridGameAssetsSpec.kt +0 -63
  576. package/nitrogen/generated/ios/c++/HybridGameAssetsSpecSwift.cpp +0 -11
  577. package/nitrogen/generated/ios/c++/HybridGameAssetsSpecSwift.hpp +0 -99
  578. package/nitrogen/generated/ios/swift/Func_void.swift +0 -46
  579. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +0 -46
  580. package/nitrogen/generated/ios/swift/HybridGameAssetsSpec.swift +0 -57
  581. package/nitrogen/generated/ios/swift/HybridGameAssetsSpec_cxx.swift +0 -176
  582. package/nitrogen/generated/shared/c++/HybridGameAssetsSpec.cpp +0 -23
  583. package/nitrogen/generated/shared/c++/HybridGameAssetsSpec.hpp +0 -65
  584. package/src/GameAssets.nitro.ts +0 -14
  585. package/src/GameAssets.ts +0 -47
@@ -0,0 +1,634 @@
1
+ /*
2
+ * Copyright 2013 Google Inc.
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+
8
+ #ifndef SkImageInfo_DEFINED
9
+ #define SkImageInfo_DEFINED
10
+
11
+ #include "include/core/SkAlphaType.h"
12
+ #include "include/core/SkColorType.h"
13
+ #include "include/core/SkRect.h"
14
+ #include "include/core/SkRefCnt.h"
15
+ #include "include/core/SkSize.h"
16
+ #include "include/private/SkAPI.h"
17
+ #include "include/private/SkDebug.h"
18
+ #include "include/private/SkMath.h"
19
+ #include "include/private/SkTFitsIn.h"
20
+
21
+ #include <cstddef>
22
+ #include <cstdint>
23
+ #include <utility>
24
+
25
+ class SkColorSpace;
26
+
27
+ /** Returns the number of bytes required to store a pixel, including unused padding.
28
+ Returns zero if ct is kUnknown_SkColorType or invalid.
29
+
30
+ @return bytes per pixel
31
+ */
32
+ SK_API int SkColorTypeBytesPerPixel(SkColorType ct);
33
+
34
+ /** Returns true if SkColorType always decodes alpha to 1.0, making the pixel
35
+ fully opaque. If true, SkColorType does not reserve bits to encode alpha.
36
+
37
+ @return true if alpha is always set to 1.0
38
+ */
39
+ SK_API bool SkColorTypeIsAlwaysOpaque(SkColorType ct);
40
+
41
+ /** Returns true if canonical can be set to a valid SkAlphaType for colorType. If
42
+ there is more than one valid canonical SkAlphaType, set to alphaType, if valid.
43
+ If true is returned and canonical is not nullptr, store valid SkAlphaType.
44
+
45
+ Returns false only if alphaType is kUnknown_SkAlphaType, color type is not
46
+ kUnknown_SkColorType, and SkColorType is not always opaque. If false is returned,
47
+ canonical is ignored.
48
+
49
+ @param canonical storage for SkAlphaType
50
+ @return true if valid SkAlphaType can be associated with colorType
51
+ */
52
+ SK_API bool SkColorTypeValidateAlphaType(SkColorType colorType, SkAlphaType alphaType,
53
+ SkAlphaType* canonical = nullptr);
54
+
55
+ /** \enum SkImageInfo::SkYUVColorSpace
56
+ Describes color range of YUV pixels. The color mapping from YUV to RGB varies
57
+ depending on the source. YUV pixels may be generated by JPEG images, standard
58
+ video streams, or high definition video streams. Each has its own mapping from
59
+ YUV to RGB.
60
+
61
+ JPEG YUV values encode the full range of 0 to 255 for all three components.
62
+ Video YUV values often range from 16 to 235 for Y and from 16 to 240 for U and V (limited).
63
+ Details of encoding and conversion to RGB are described in YCbCr color space.
64
+
65
+ The identity colorspace exists to provide a utility mapping from Y to R, U to G and V to B.
66
+ It can be used to visualize the YUV planes or to explicitly post process the YUV channels.
67
+ */
68
+ enum SkYUVColorSpace : int {
69
+ kJPEG_Full_SkYUVColorSpace, //!< describes full range
70
+ kRec601_Limited_SkYUVColorSpace, //!< describes SDTV range
71
+ kRec709_Full_SkYUVColorSpace, //!< describes HDTV range
72
+ kRec709_Limited_SkYUVColorSpace,
73
+ kBT2020_8bit_Full_SkYUVColorSpace, //!< describes UHDTV range, non-constant-luminance
74
+ kBT2020_8bit_Limited_SkYUVColorSpace,
75
+ kBT2020_10bit_Full_SkYUVColorSpace,
76
+ kBT2020_10bit_Limited_SkYUVColorSpace,
77
+ kBT2020_12bit_Full_SkYUVColorSpace,
78
+ kBT2020_12bit_Limited_SkYUVColorSpace,
79
+ kBT2020_16bit_Full_SkYUVColorSpace,
80
+ kBT2020_16bit_Limited_SkYUVColorSpace,
81
+ kFCC_Full_SkYUVColorSpace, //!< describes FCC range
82
+ kFCC_Limited_SkYUVColorSpace,
83
+ kSMPTE240_Full_SkYUVColorSpace, //!< describes SMPTE240M range
84
+ kSMPTE240_Limited_SkYUVColorSpace,
85
+ kYDZDX_Full_SkYUVColorSpace, //!< describes YDZDX range
86
+ kYDZDX_Limited_SkYUVColorSpace,
87
+ kGBR_Full_SkYUVColorSpace, //!< describes GBR range
88
+ kGBR_Limited_SkYUVColorSpace,
89
+ kYCgCo_8bit_Full_SkYUVColorSpace, //!< describes YCgCo matrix
90
+ kYCgCo_8bit_Limited_SkYUVColorSpace,
91
+ kYCgCo_10bit_Full_SkYUVColorSpace,
92
+ kYCgCo_10bit_Limited_SkYUVColorSpace,
93
+ kYCgCo_12bit_Full_SkYUVColorSpace,
94
+ kYCgCo_12bit_Limited_SkYUVColorSpace,
95
+ kYCgCo_16bit_Full_SkYUVColorSpace,
96
+ kYCgCo_16bit_Limited_SkYUVColorSpace,
97
+ kIdentity_SkYUVColorSpace, //!< maps Y->R, U->G, V->B
98
+
99
+ kLastEnum_SkYUVColorSpace = kIdentity_SkYUVColorSpace, //!< last valid value
100
+
101
+ // Legacy (deprecated) names:
102
+ kJPEG_SkYUVColorSpace = kJPEG_Full_SkYUVColorSpace,
103
+ kRec601_SkYUVColorSpace = kRec601_Limited_SkYUVColorSpace,
104
+ kRec709_SkYUVColorSpace = kRec709_Limited_SkYUVColorSpace,
105
+ kBT2020_SkYUVColorSpace = kBT2020_8bit_Limited_SkYUVColorSpace,
106
+ };
107
+
108
+ SK_API bool SkYUVColorSpaceIsLimitedRange(SkYUVColorSpace cs);
109
+
110
+ /** \struct SkColorInfo
111
+ Describes pixel and encoding. SkImageInfo can be created from SkColorInfo by
112
+ providing dimensions.
113
+
114
+ It encodes how pixel bits describe alpha, transparency; color components red, blue,
115
+ and green; and SkColorSpace, the range and linearity of colors.
116
+ */
117
+ class SK_API SkColorInfo {
118
+ public:
119
+ /** Creates an SkColorInfo with kUnknown_SkColorType, kUnknown_SkAlphaType,
120
+ and no SkColorSpace.
121
+
122
+ @return empty SkImageInfo
123
+ */
124
+ SkColorInfo();
125
+ ~SkColorInfo();
126
+
127
+ /** Creates SkColorInfo from SkColorType ct, SkAlphaType at, and optionally SkColorSpace cs.
128
+
129
+ If SkColorSpace cs is nullptr and SkColorInfo is part of drawing source: SkColorSpace
130
+ defaults to sRGB, mapping into SkSurface SkColorSpace.
131
+
132
+ Parameters are not validated to see if their values are legal, or that the
133
+ combination is supported.
134
+ @return created SkColorInfo
135
+ */
136
+ SkColorInfo(SkColorType ct, SkAlphaType at, sk_sp<SkColorSpace> cs);
137
+
138
+ SkColorInfo(const SkColorInfo&);
139
+ SkColorInfo(SkColorInfo&&);
140
+
141
+ SkColorInfo& operator=(const SkColorInfo&);
142
+ SkColorInfo& operator=(SkColorInfo&&);
143
+
144
+ SkColorSpace* colorSpace() const;
145
+ sk_sp<SkColorSpace> refColorSpace() const;
146
+ SkColorType colorType() const { return fColorType; }
147
+ SkAlphaType alphaType() const { return fAlphaType; }
148
+
149
+ bool isOpaque() const {
150
+ return SkAlphaTypeIsOpaque(fAlphaType)
151
+ || SkColorTypeIsAlwaysOpaque(fColorType);
152
+ }
153
+
154
+ bool gammaCloseToSRGB() const;
155
+
156
+ /** Does other represent the same color type, alpha type, and color space? */
157
+ bool operator==(const SkColorInfo& other) const;
158
+
159
+ /** Does other represent a different color type, alpha type, or color space? */
160
+ bool operator!=(const SkColorInfo& other) const;
161
+
162
+ /** Creates SkColorInfo with same SkColorType, SkColorSpace, with SkAlphaType set
163
+ to newAlphaType.
164
+
165
+ Created SkColorInfo contains newAlphaType even if it is incompatible with
166
+ SkColorType, in which case SkAlphaType in SkColorInfo is ignored.
167
+ */
168
+ SkColorInfo makeAlphaType(SkAlphaType newAlphaType) const;
169
+
170
+ /** Creates new SkColorInfo with same SkAlphaType, SkColorSpace, with SkColorType
171
+ set to newColorType.
172
+ */
173
+ SkColorInfo makeColorType(SkColorType newColorType) const;
174
+
175
+ /** Creates SkColorInfo with same SkAlphaType, SkColorType, with SkColorSpace
176
+ set to cs. cs may be nullptr.
177
+ */
178
+ SkColorInfo makeColorSpace(sk_sp<SkColorSpace> cs) const;
179
+
180
+ /** Returns number of bytes per pixel required by SkColorType.
181
+ Returns zero if colorType() is kUnknown_SkColorType.
182
+
183
+ @return bytes in pixel
184
+
185
+ example: https://fiddle.skia.org/c/@ImageInfo_bytesPerPixel
186
+ */
187
+ int bytesPerPixel() const;
188
+
189
+ /** Returns bit shift converting row bytes to row pixels.
190
+ Returns zero for kUnknown_SkColorType.
191
+
192
+ @return one of: 0, 1, 2, 3, 4; left shift to convert pixels to bytes
193
+
194
+ example: https://fiddle.skia.org/c/@ImageInfo_shiftPerPixel
195
+ */
196
+ int shiftPerPixel() const;
197
+
198
+ private:
199
+ sk_sp<SkColorSpace> fColorSpace;
200
+ SkColorType fColorType = kUnknown_SkColorType;
201
+ SkAlphaType fAlphaType = kUnknown_SkAlphaType;
202
+ };
203
+
204
+ /** \struct SkImageInfo
205
+ Describes pixel dimensions and encoding. SkBitmap, SkImage, PixMap, and SkSurface
206
+ can be created from SkImageInfo. SkImageInfo can be retrieved from SkBitmap and
207
+ SkPixmap, but not from SkImage and SkSurface. For example, SkImage and SkSurface
208
+ implementations may defer pixel depth, so may not completely specify SkImageInfo.
209
+
210
+ SkImageInfo contains dimensions, the pixel integral width and height. It encodes
211
+ how pixel bits describe alpha, transparency; color components red, blue,
212
+ and green; and SkColorSpace, the range and linearity of colors.
213
+ */
214
+ struct SK_API SkImageInfo {
215
+ public:
216
+
217
+ /** Creates an empty SkImageInfo with kUnknown_SkColorType, kUnknown_SkAlphaType,
218
+ a width and height of zero, and no SkColorSpace.
219
+
220
+ @return empty SkImageInfo
221
+ */
222
+ SkImageInfo() = default;
223
+
224
+ /** Creates SkImageInfo from integral dimensions width and height, SkColorType ct,
225
+ SkAlphaType at, and optionally SkColorSpace cs.
226
+
227
+ If SkColorSpace cs is nullptr and SkImageInfo is part of drawing source: SkColorSpace
228
+ defaults to sRGB, mapping into SkSurface SkColorSpace.
229
+
230
+ Parameters are not validated to see if their values are legal, or that the
231
+ combination is supported.
232
+
233
+ @param width pixel column count; must be zero or greater
234
+ @param height pixel row count; must be zero or greater
235
+ @param cs range of colors; may be nullptr
236
+ @return created SkImageInfo
237
+ */
238
+ static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at);
239
+ static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at,
240
+ sk_sp<SkColorSpace> cs);
241
+ static SkImageInfo Make(SkISize dimensions, SkColorType ct, SkAlphaType at);
242
+ static SkImageInfo Make(SkISize dimensions, SkColorType ct, SkAlphaType at,
243
+ sk_sp<SkColorSpace> cs);
244
+
245
+ /** Creates SkImageInfo from integral dimensions and SkColorInfo colorInfo,
246
+
247
+ Parameters are not validated to see if their values are legal, or that the
248
+ combination is supported.
249
+
250
+ @param dimensions pixel column and row count; must be zeros or greater
251
+ @param SkColorInfo the pixel encoding consisting of SkColorType, SkAlphaType, and
252
+ SkColorSpace (which may be nullptr)
253
+ @return created SkImageInfo
254
+ */
255
+ static SkImageInfo Make(SkISize dimensions, const SkColorInfo& colorInfo) {
256
+ return SkImageInfo(dimensions, colorInfo);
257
+ }
258
+ static SkImageInfo Make(SkISize dimensions, SkColorInfo&& colorInfo) {
259
+ return SkImageInfo(dimensions, std::move(colorInfo));
260
+ }
261
+
262
+ /** Creates SkImageInfo from integral dimensions width and height, kN32_SkColorType,
263
+ SkAlphaType at, and optionally SkColorSpace cs. kN32_SkColorType will equal either
264
+ kBGRA_8888_SkColorType or kRGBA_8888_SkColorType, whichever is optimal.
265
+
266
+ If SkColorSpace cs is nullptr and SkImageInfo is part of drawing source: SkColorSpace
267
+ defaults to sRGB, mapping into SkSurface SkColorSpace.
268
+
269
+ Parameters are not validated to see if their values are legal, or that the
270
+ combination is supported.
271
+
272
+ @param width pixel column count; must be zero or greater
273
+ @param height pixel row count; must be zero or greater
274
+ @param cs range of colors; may be nullptr
275
+ @return created SkImageInfo
276
+ */
277
+ static SkImageInfo MakeN32(int width, int height, SkAlphaType at);
278
+ static SkImageInfo MakeN32(int width, int height, SkAlphaType at, sk_sp<SkColorSpace> cs);
279
+
280
+ /** Creates SkImageInfo from integral dimensions width and height, kN32_SkColorType,
281
+ SkAlphaType at, with sRGB SkColorSpace.
282
+
283
+ Parameters are not validated to see if their values are legal, or that the
284
+ combination is supported.
285
+
286
+ @param width pixel column count; must be zero or greater
287
+ @param height pixel row count; must be zero or greater
288
+ @return created SkImageInfo
289
+
290
+ example: https://fiddle.skia.org/c/@ImageInfo_MakeS32
291
+ */
292
+ static SkImageInfo MakeS32(int width, int height, SkAlphaType at);
293
+
294
+ /** Creates SkImageInfo from integral dimensions width and height, kN32_SkColorType,
295
+ kPremul_SkAlphaType, with optional SkColorSpace.
296
+
297
+ If SkColorSpace cs is nullptr and SkImageInfo is part of drawing source: SkColorSpace
298
+ defaults to sRGB, mapping into SkSurface SkColorSpace.
299
+
300
+ Parameters are not validated to see if their values are legal, or that the
301
+ combination is supported.
302
+
303
+ @param width pixel column count; must be zero or greater
304
+ @param height pixel row count; must be zero or greater
305
+ @param cs range of colors; may be nullptr
306
+ @return created SkImageInfo
307
+ */
308
+ static SkImageInfo MakeN32Premul(int width, int height);
309
+ static SkImageInfo MakeN32Premul(int width, int height, sk_sp<SkColorSpace> cs);
310
+
311
+ /** Creates SkImageInfo from integral dimensions width and height, kN32_SkColorType,
312
+ kPremul_SkAlphaType, with SkColorSpace set to nullptr.
313
+
314
+ If SkImageInfo is part of drawing source: SkColorSpace defaults to sRGB, mapping
315
+ into SkSurface SkColorSpace.
316
+
317
+ Parameters are not validated to see if their values are legal, or that the
318
+ combination is supported.
319
+
320
+ @param dimensions width and height, each must be zero or greater
321
+ @param cs range of colors; may be nullptr
322
+ @return created SkImageInfo
323
+ */
324
+ static SkImageInfo MakeN32Premul(SkISize dimensions);
325
+ static SkImageInfo MakeN32Premul(SkISize dimensions, sk_sp<SkColorSpace> cs);
326
+
327
+ /** Creates SkImageInfo from integral dimensions width and height, kAlpha_8_SkColorType,
328
+ kPremul_SkAlphaType, with SkColorSpace set to nullptr.
329
+
330
+ @param width pixel column count; must be zero or greater
331
+ @param height pixel row count; must be zero or greater
332
+ @return created SkImageInfo
333
+ */
334
+ static SkImageInfo MakeA8(int width, int height);
335
+ /** Creates SkImageInfo from integral dimensions, kAlpha_8_SkColorType,
336
+ kPremul_SkAlphaType, with SkColorSpace set to nullptr.
337
+
338
+ @param dimensions pixel row and column count; must be zero or greater
339
+ @return created SkImageInfo
340
+ */
341
+ static SkImageInfo MakeA8(SkISize dimensions);
342
+
343
+ /** Creates SkImageInfo from integral dimensions width and height, kUnknown_SkColorType,
344
+ kUnknown_SkAlphaType, with SkColorSpace set to nullptr.
345
+
346
+ Returned SkImageInfo as part of source does not draw, and as part of destination
347
+ can not be drawn to.
348
+
349
+ @param width pixel column count; must be zero or greater
350
+ @param height pixel row count; must be zero or greater
351
+ @return created SkImageInfo
352
+ */
353
+ static SkImageInfo MakeUnknown(int width, int height);
354
+
355
+ /** Creates SkImageInfo from integral dimensions width and height set to zero,
356
+ kUnknown_SkColorType, kUnknown_SkAlphaType, with SkColorSpace set to nullptr.
357
+
358
+ Returned SkImageInfo as part of source does not draw, and as part of destination
359
+ can not be drawn to.
360
+
361
+ @return created SkImageInfo
362
+ */
363
+ static SkImageInfo MakeUnknown() {
364
+ return MakeUnknown(0, 0);
365
+ }
366
+
367
+ /** Returns pixel count in each row.
368
+
369
+ @return pixel width
370
+ */
371
+ int width() const { return fDimensions.width(); }
372
+
373
+ /** Returns pixel row count.
374
+
375
+ @return pixel height
376
+ */
377
+ int height() const { return fDimensions.height(); }
378
+
379
+ SkColorType colorType() const { return fColorInfo.colorType(); }
380
+
381
+ SkAlphaType alphaType() const { return fColorInfo.alphaType(); }
382
+
383
+ /** Returns SkColorSpace, the range of colors. The reference count of
384
+ SkColorSpace is unchanged. The returned SkColorSpace is immutable.
385
+
386
+ @return SkColorSpace, or nullptr
387
+ */
388
+ SkColorSpace* colorSpace() const;
389
+
390
+ /** Returns smart pointer to SkColorSpace, the range of colors. The smart pointer
391
+ tracks the number of objects sharing this SkColorSpace reference so the memory
392
+ is released when the owners destruct.
393
+
394
+ The returned SkColorSpace is immutable.
395
+
396
+ @return SkColorSpace wrapped in a smart pointer
397
+ */
398
+ sk_sp<SkColorSpace> refColorSpace() const;
399
+
400
+ /** Returns if SkImageInfo describes an empty area of pixels by checking if either
401
+ width or height is zero or smaller.
402
+
403
+ @return true if either dimension is zero or smaller
404
+ */
405
+ bool isEmpty() const { return fDimensions.isEmpty(); }
406
+
407
+ /** Returns the dimensionless SkColorInfo that represents the same color type,
408
+ alpha type, and color space as this SkImageInfo.
409
+ */
410
+ const SkColorInfo& colorInfo() const { return fColorInfo; }
411
+
412
+ /** Returns true if SkAlphaType is set to hint that all pixels are opaque; their
413
+ alpha value is implicitly or explicitly 1.0. If true, and all pixels are
414
+ not opaque, Skia may draw incorrectly.
415
+
416
+ Does not check if SkColorType allows alpha, or if any pixel value has
417
+ transparency.
418
+
419
+ @return true if SkAlphaType is kOpaque_SkAlphaType
420
+ */
421
+ bool isOpaque() const { return fColorInfo.isOpaque(); }
422
+
423
+ /** Returns SkISize { width(), height() }.
424
+
425
+ @return integral size of width() and height()
426
+ */
427
+ SkISize dimensions() const { return fDimensions; }
428
+
429
+ /** Returns SkIRect { 0, 0, width(), height() }.
430
+
431
+ @return integral rectangle from origin to width() and height()
432
+ */
433
+ SkIRect bounds() const { return SkIRect::MakeSize(fDimensions); }
434
+
435
+ /** Returns true if associated SkColorSpace is not nullptr, and SkColorSpace gamma
436
+ is approximately the same as sRGB.
437
+ This includes the
438
+
439
+ @return true if SkColorSpace gamma is approximately the same as sRGB
440
+ */
441
+ bool gammaCloseToSRGB() const { return fColorInfo.gammaCloseToSRGB(); }
442
+
443
+ /** Creates SkImageInfo with the same SkColorType, SkColorSpace, and SkAlphaType,
444
+ with dimensions set to width and height.
445
+
446
+ @param newWidth pixel column count; must be zero or greater
447
+ @param newHeight pixel row count; must be zero or greater
448
+ @return created SkImageInfo
449
+ */
450
+ SkImageInfo makeWH(int newWidth, int newHeight) const {
451
+ return Make({newWidth, newHeight}, fColorInfo);
452
+ }
453
+
454
+ /** Creates SkImageInfo with the same SkColorType, SkColorSpace, and SkAlphaType,
455
+ with dimensions set to newDimensions.
456
+
457
+ @param newSize pixel column and row count; must be zero or greater
458
+ @return created SkImageInfo
459
+ */
460
+ SkImageInfo makeDimensions(SkISize newSize) const {
461
+ return Make(newSize, fColorInfo);
462
+ }
463
+
464
+ /** Creates SkImageInfo with same SkColorType, SkColorSpace, width, and height,
465
+ with SkAlphaType set to newAlphaType.
466
+
467
+ Created SkImageInfo contains newAlphaType even if it is incompatible with
468
+ SkColorType, in which case SkAlphaType in SkImageInfo is ignored.
469
+
470
+ @return created SkImageInfo
471
+ */
472
+ SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const {
473
+ return Make(fDimensions, fColorInfo.makeAlphaType(newAlphaType));
474
+ }
475
+
476
+ /** Creates SkImageInfo with same SkAlphaType, SkColorSpace, width, and height,
477
+ with SkColorType set to newColorType.
478
+
479
+ @return created SkImageInfo
480
+ */
481
+ SkImageInfo makeColorType(SkColorType newColorType) const {
482
+ return Make(fDimensions, fColorInfo.makeColorType(newColorType));
483
+ }
484
+
485
+ /** Creates SkImageInfo with same SkAlphaType, SkColorType, width, and height,
486
+ with SkColorSpace set to cs.
487
+
488
+ @param cs range of colors; may be nullptr
489
+ @return created SkImageInfo
490
+ */
491
+ SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const;
492
+
493
+ /** Returns number of bytes per pixel required by SkColorType.
494
+ Returns zero if colorType( is kUnknown_SkColorType.
495
+
496
+ @return bytes in pixel
497
+ */
498
+ int bytesPerPixel() const { return fColorInfo.bytesPerPixel(); }
499
+
500
+ /** Returns bit shift converting row bytes to row pixels.
501
+ Returns zero for kUnknown_SkColorType.
502
+
503
+ @return one of: 0, 1, 2, 3; left shift to convert pixels to bytes
504
+ */
505
+ int shiftPerPixel() const { return fColorInfo.shiftPerPixel(); }
506
+
507
+ /** Returns minimum bytes per row, computed from pixel width() and SkColorType, which
508
+ specifies bytesPerPixel(). SkBitmap maximum value for row bytes must fit
509
+ in 31 bits.
510
+
511
+ @return width() times bytesPerPixel() as unsigned 64-bit integer
512
+ */
513
+ uint64_t minRowBytes64() const {
514
+ return (uint64_t)sk_64_mul(this->width(), this->bytesPerPixel());
515
+ }
516
+
517
+ /** Returns minimum bytes per row, computed from pixel width() and SkColorType, which
518
+ specifies bytesPerPixel(). SkBitmap maximum value for row bytes must fit
519
+ in 31 bits.
520
+
521
+ @return width() times bytesPerPixel() as size_t
522
+ */
523
+ size_t minRowBytes() const {
524
+ uint64_t minRowBytes = this->minRowBytes64();
525
+ if (!SkTFitsIn<int32_t>(minRowBytes)) {
526
+ return 0;
527
+ }
528
+ return (size_t)minRowBytes;
529
+ }
530
+
531
+ /** Returns byte offset of pixel from pixel base address.
532
+
533
+ Asserts in debug build if x or y is outside of bounds. Does not assert if
534
+ rowBytes is smaller than minRowBytes(), even though result may be incorrect.
535
+
536
+ @param x column index, zero or greater, and less than width()
537
+ @param y row index, zero or greater, and less than height()
538
+ @param rowBytes size of pixel row or larger
539
+ @return offset within pixel array
540
+
541
+ example: https://fiddle.skia.org/c/@ImageInfo_computeOffset
542
+ */
543
+ size_t computeOffset(int x, int y, size_t rowBytes) const;
544
+
545
+ /** Compares SkImageInfo with other, and returns true if width, height, SkColorType,
546
+ SkAlphaType, and SkColorSpace are equivalent.
547
+
548
+ @param other SkImageInfo to compare
549
+ @return true if SkImageInfo equals other
550
+ */
551
+ bool operator==(const SkImageInfo& other) const {
552
+ return fDimensions == other.fDimensions && fColorInfo == other.fColorInfo;
553
+ }
554
+
555
+ /** Compares SkImageInfo with other, and returns true if width, height, SkColorType,
556
+ SkAlphaType, and SkColorSpace are not equivalent.
557
+
558
+ @param other SkImageInfo to compare
559
+ @return true if SkImageInfo is not equal to other
560
+ */
561
+ bool operator!=(const SkImageInfo& other) const {
562
+ return !(*this == other);
563
+ }
564
+
565
+ /** Returns storage required by pixel array, given SkImageInfo dimensions, SkColorType,
566
+ and rowBytes. rowBytes is assumed to be at least as large as minRowBytes().
567
+
568
+ Returns zero if height is zero.
569
+ Returns SIZE_MAX if answer exceeds the range of size_t.
570
+
571
+ @param rowBytes size of pixel row or larger
572
+ @return memory required by pixel buffer
573
+ */
574
+ size_t computeByteSize(size_t rowBytes) const;
575
+
576
+ /** Returns storage required by pixel array, given SkImageInfo dimensions, and
577
+ SkColorType. Uses minRowBytes() to compute bytes for pixel row.
578
+
579
+ Returns zero if height is zero.
580
+ Returns SIZE_MAX if answer exceeds the range of size_t.
581
+
582
+ @return least memory required by pixel buffer
583
+ */
584
+ size_t computeMinByteSize() const {
585
+ return this->computeByteSize(this->minRowBytes());
586
+ }
587
+
588
+ /** Returns true if byteSize equals SIZE_MAX. computeByteSize() and
589
+ computeMinByteSize() return SIZE_MAX if size_t can not hold buffer size.
590
+
591
+ @param byteSize result of computeByteSize() or computeMinByteSize()
592
+ @return true if computeByteSize() or computeMinByteSize() result exceeds size_t
593
+ */
594
+ static bool ByteSizeOverflowed(size_t byteSize) {
595
+ return SIZE_MAX == byteSize;
596
+ }
597
+
598
+ /** Returns true if rowBytes is valid for this SkImageInfo.
599
+
600
+ @param rowBytes size of pixel row including padding
601
+ @return true if rowBytes is large enough to contain pixel row and is properly
602
+ aligned
603
+ */
604
+ bool validRowBytes(size_t rowBytes) const {
605
+ if (rowBytes < this->minRowBytes64()) {
606
+ return false;
607
+ }
608
+ int shift = this->shiftPerPixel();
609
+ size_t alignedRowBytes = rowBytes >> shift << shift;
610
+ return alignedRowBytes == rowBytes;
611
+ }
612
+
613
+ /** Creates an empty SkImageInfo with kUnknown_SkColorType, kUnknown_SkAlphaType,
614
+ a width and height of zero, and no SkColorSpace.
615
+ */
616
+ void reset() { *this = {}; }
617
+
618
+ /** Asserts if internal values are illegal or inconsistent. Only available if
619
+ SK_DEBUG is defined at compile time.
620
+ */
621
+ SkDEBUGCODE(void validate() const;)
622
+
623
+ private:
624
+ SkColorInfo fColorInfo;
625
+ SkISize fDimensions = {0, 0};
626
+
627
+ SkImageInfo(SkISize dimensions, const SkColorInfo& colorInfo)
628
+ : fColorInfo(colorInfo), fDimensions(dimensions) {}
629
+
630
+ SkImageInfo(SkISize dimensions, SkColorInfo&& colorInfo)
631
+ : fColorInfo(std::move(colorInfo)), fDimensions(dimensions) {}
632
+ };
633
+
634
+ #endif