react-native-tgfx 0.0.0 → 0.0.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE +141 -0
- package/NitroTgfx.podspec +69 -0
- package/README.md +147 -2
- package/android/CMakeLists.txt +122 -0
- package/android/build.gradle +172 -0
- package/android/consumer-rules.pro +7 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/TgfxAndroid.cpp +347 -0
- package/android/src/main/cpp/cpp-adapter.cpp +11 -0
- package/android/src/main/java/com/margelo/nitro/tgfx/HybridTgfxView.kt +139 -0
- package/android/src/main/java/com/margelo/nitro/tgfx/NitroTgfxPackage.kt +24 -0
- package/android/src/main/java/com/margelo/nitro/tgfx/TgfxNative.kt +49 -0
- package/android/src/main/java/com/margelo/nitro/tgfx/TgfxRenderTarget.kt +158 -0
- package/android/src/main/java/com/margelo/nitro/tgfx/TgfxSurfaceView.kt +43 -0
- package/android/src/main/java/com/margelo/nitro/tgfx/TgfxTextureView.kt +37 -0
- package/cpp/Base64.hpp +49 -0
- package/cpp/FontRegistry.cpp +379 -0
- package/cpp/FontRegistry.hpp +80 -0
- package/cpp/HybridTgfxFonts.cpp +135 -0
- package/cpp/HybridTgfxFonts.hpp +29 -0
- package/cpp/HybridTgfxImage.hpp +54 -0
- package/cpp/HybridTgfxImageFactory.cpp +126 -0
- package/cpp/HybridTgfxImageFactory.hpp +27 -0
- package/cpp/HybridTgfxSlotsFactory.hpp +37 -0
- package/cpp/IdleGate.hpp +46 -0
- package/cpp/ImageRegistry.cpp +306 -0
- package/cpp/ImageRegistry.hpp +120 -0
- package/cpp/Log.hpp +18 -0
- package/cpp/SceneHash.hpp +55 -0
- package/cpp/SceneStrings.hpp +45 -0
- package/cpp/Snapshot.hpp +110 -0
- package/cpp/SvgPath.cpp +315 -0
- package/cpp/SvgPath.hpp +13 -0
- package/cpp/TextLayout.cpp +568 -0
- package/cpp/TextLayout.hpp +102 -0
- package/cpp/TgfxFrameSink.cpp +46 -0
- package/cpp/TgfxFrameSink.hpp +29 -0
- package/cpp/TgfxRenderer.cpp +439 -0
- package/cpp/TgfxRenderer.hpp +125 -0
- package/cpp/TgfxScene.cpp +1119 -0
- package/cpp/TgfxScene.hpp +207 -0
- package/cpp/Trace.hpp +26 -0
- package/cpp/third_party/tgfx/CMakeLists.txt +909 -0
- package/cpp/third_party/tgfx/DEPS +123 -0
- package/cpp/third_party/tgfx/LICENSE.txt +825 -0
- package/cpp/third_party/tgfx/README.md +488 -0
- package/cpp/third_party/tgfx/android/.idea/fileTemplates/includes/TGFX File Header.h +17 -0
- package/cpp/third_party/tgfx/android/.idea/misc.xml +14 -0
- package/cpp/third_party/tgfx/android/app/CMakeLists.txt +25 -0
- package/cpp/third_party/tgfx/android/app/build.gradle.kts +84 -0
- package/cpp/third_party/tgfx/android/app/proguard-rules.pro +21 -0
- package/cpp/third_party/tgfx/android/app/src/androidTest/java/org/tgfx/hello/ExampleInstrumentedTest.kt +24 -0
- package/cpp/third_party/tgfx/android/app/src/main/AndroidManifest.xml +24 -0
- package/cpp/third_party/tgfx/android/app/src/main/cpp/JNIHelper.cpp +29 -0
- package/cpp/third_party/tgfx/android/app/src/main/cpp/JTGFXView.cpp +251 -0
- package/cpp/third_party/tgfx/android/app/src/main/cpp/JTGFXView.h +66 -0
- package/cpp/third_party/tgfx/android/app/src/main/ic_launcher-playstore.png +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/java/org/tgfx/hello2d/MainActivity.kt +100 -0
- package/cpp/third_party/tgfx/android/app/src/main/java/org/tgfx/hello2d/TGFXView.kt +176 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/drawable/ic_launcher_background.xml +74 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/layout/activity_main.xml +12 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/values/colors.xml +10 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/values/strings.xml +3 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/values/themes.xml +5 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/xml/backup_rules.xml +13 -0
- package/cpp/third_party/tgfx/android/app/src/main/res/xml/data_extraction_rules.xml +19 -0
- package/cpp/third_party/tgfx/android/app/src/test/java/io/pag/tgfxdemo/ExampleUnitTest.kt +17 -0
- package/cpp/third_party/tgfx/android/build.gradle.kts +5 -0
- package/cpp/third_party/tgfx/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/cpp/third_party/tgfx/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/cpp/third_party/tgfx/android/gradle.properties +24 -0
- package/cpp/third_party/tgfx/android/gradlew +252 -0
- package/cpp/third_party/tgfx/android/gradlew.bat +94 -0
- package/cpp/third_party/tgfx/android/settings.gradle.kts +17 -0
- package/cpp/third_party/tgfx/include/tgfx/core/AlphaType.h +43 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Bitmap.h +249 -0
- package/cpp/third_party/tgfx/include/tgfx/core/BlendMode.h +148 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Brush.h +92 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Buffer.h +144 -0
- package/cpp/third_party/tgfx/include/tgfx/core/BytesKey.h +117 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Canvas.h +557 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Clock.h +72 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Color.h +232 -0
- package/cpp/third_party/tgfx/include/tgfx/core/ColorFilter.h +137 -0
- package/cpp/third_party/tgfx/include/tgfx/core/ColorSpace.h +491 -0
- package/cpp/third_party/tgfx/include/tgfx/core/ColorType.h +72 -0
- package/cpp/third_party/tgfx/include/tgfx/core/CustomTypeface.h +174 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Data.h +118 -0
- package/cpp/third_party/tgfx/include/tgfx/core/DataView.h +260 -0
- package/cpp/third_party/tgfx/include/tgfx/core/EncodedFormat.h +28 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Font.h +176 -0
- package/cpp/third_party/tgfx/include/tgfx/core/FontMetrics.h +69 -0
- package/cpp/third_party/tgfx/include/tgfx/core/FontStyle.h +125 -0
- package/cpp/third_party/tgfx/include/tgfx/core/GlyphRun.h +91 -0
- package/cpp/third_party/tgfx/include/tgfx/core/GradientType.h +52 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Image.h +387 -0
- package/cpp/third_party/tgfx/include/tgfx/core/ImageBuffer.h +129 -0
- package/cpp/third_party/tgfx/include/tgfx/core/ImageCodec.h +136 -0
- package/cpp/third_party/tgfx/include/tgfx/core/ImageFilter.h +196 -0
- package/cpp/third_party/tgfx/include/tgfx/core/ImageGenerator.h +100 -0
- package/cpp/third_party/tgfx/include/tgfx/core/ImageInfo.h +215 -0
- package/cpp/third_party/tgfx/include/tgfx/core/MapDirection.h +39 -0
- package/cpp/third_party/tgfx/include/tgfx/core/MaskFilter.h +67 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Matrix.h +1025 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Matrix3D.h +395 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Mesh.h +93 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Orientation.h +74 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Paint.h +266 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Path.h +500 -0
- package/cpp/third_party/tgfx/include/tgfx/core/PathEffect.h +79 -0
- package/cpp/third_party/tgfx/include/tgfx/core/PathMeasure.h +70 -0
- package/cpp/third_party/tgfx/include/tgfx/core/PathProvider.h +57 -0
- package/cpp/third_party/tgfx/include/tgfx/core/PathTypes.h +124 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Picture.h +115 -0
- package/cpp/third_party/tgfx/include/tgfx/core/PictureRecorder.h +59 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Pixmap.h +226 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Point.h +199 -0
- package/cpp/third_party/tgfx/include/tgfx/core/RRect.h +182 -0
- package/cpp/third_party/tgfx/include/tgfx/core/RSXform.h +118 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Rect.h +504 -0
- package/cpp/third_party/tgfx/include/tgfx/core/RenderFlags.h +41 -0
- package/cpp/third_party/tgfx/include/tgfx/core/SamplingOptions.h +50 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Shader.h +272 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Shape.h +210 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Size.h +204 -0
- package/cpp/third_party/tgfx/include/tgfx/core/SrcRectConstraint.h +37 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Stream.h +109 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Stroke.h +118 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Surface.h +227 -0
- package/cpp/third_party/tgfx/include/tgfx/core/SurfaceReadback.h +93 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Task.h +152 -0
- package/cpp/third_party/tgfx/include/tgfx/core/TextBlob.h +162 -0
- package/cpp/third_party/tgfx/include/tgfx/core/TextBlobBuilder.h +141 -0
- package/cpp/third_party/tgfx/include/tgfx/core/TileMode.h +47 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Typeface.h +203 -0
- package/cpp/third_party/tgfx/include/tgfx/core/UTF.h +52 -0
- package/cpp/third_party/tgfx/include/tgfx/core/Vec.h +525 -0
- package/cpp/third_party/tgfx/include/tgfx/core/WriteStream.h +146 -0
- package/cpp/third_party/tgfx/include/tgfx/core/YUVColorSpace.h +62 -0
- package/cpp/third_party/tgfx/include/tgfx/core/YUVData.h +92 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/Attribute.h +90 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/Backend.h +352 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/BlendFactor.h +101 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/BlendOperation.h +57 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/ColorWriteMask.h +54 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/CommandBuffer.h +31 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/CommandEncoder.h +100 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/CommandQueue.h +105 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/CompareFunction.h +67 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/Context.h +222 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/Device.h +79 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/FilterMode.h +36 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/GPU.h +162 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/GPUBuffer.h +122 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/GPUFeatures.h +51 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/GPUInfo.h +56 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/GPULimits.h +55 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/ImageOrigin.h +41 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/MipmapMode.h +39 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/PixelFormat.h +61 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/Recording.h +44 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/RenderPass.h +363 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/RenderPipeline.h +440 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/RuntimeEffect.h +74 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/Sampler.h +108 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/Semaphore.h +37 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/ShaderModule.h +50 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/ShaderStage.h +36 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/ShaderVisibility.h +46 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/StencilOperation.h +74 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/Texture.h +183 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/Window.h +75 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/metal/MetalDevice.h +56 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/metal/MetalTypes.h +53 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/metal/MetalWindow.h +66 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/GLDevice.h +78 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/GLTypes.h +64 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/cgl/CGLDevice.h +57 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/cgl/CGLWindow.h +45 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/eagl/EAGLDevice.h +63 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/eagl/EAGLWindow.h +47 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/egl/EGLDevice.h +89 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/egl/EGLGlobals.h +53 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/egl/EGLWindow.h +59 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/qt/QGLDevice.h +88 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/qt/QGLWindow.h +92 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/webgl/WebGLDevice.h +54 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/webgl/WebGLWindow.h +42 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/wgl/WGLDevice.h +62 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/opengl/wgl/WGLWindow.h +43 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/vulkan/VulkanDevice.h +62 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/vulkan/VulkanTypes.h +69 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/vulkan/VulkanWindow.h +103 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/webgpu/WebGPUDevice.h +60 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/webgpu/WebGPUTypes.h +55 -0
- package/cpp/third_party/tgfx/include/tgfx/gpu/webgpu/WebGPUWindow.h +55 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/DisplayList.h +407 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/ImageLayer.h +74 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/Layer.h +789 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/LayerMaskType.h +39 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/LayerPaint.h +119 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/LayerProperty.h +66 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/LayerRecorder.h +143 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/LayerType.h +55 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/MeshLayer.h +95 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/ShapeLayer.h +265 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/ShapeStyle.h +92 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/SolidLayer.h +114 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/StrokeAlign.h +39 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/TextAlign.h +47 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/TextLayer.h +166 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/VectorLayer.h +72 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/filters/BlendFilter.h +76 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/filters/BlurFilter.h +90 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/filters/ColorMatrixFilter.h +79 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/filters/DropShadowFilter.h +132 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/filters/InnerShadowFilter.h +133 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/filters/LayerFilter.h +101 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/filters/LayerImageFilter.h +55 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/filters/NoiseFilter.h +285 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/layerstyles/BackgroundBlurStyle.h +106 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/layerstyles/DropShadowStyle.h +165 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/layerstyles/GlassStyle.h +168 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/layerstyles/InnerShadowStyle.h +149 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/layerstyles/LayerStyle.h +166 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/layerstyles/LayerStyleInput.h +139 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/layerstyles/NoiseStyle.h +241 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/layerstyles/StyledShape.h +84 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/ColorSource.h +64 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/Ellipse.h +91 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/FillStyle.h +135 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/Gradient.h +418 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/ImagePattern.h +160 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/MergePath.h +87 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/Polystar.h +182 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/Rectangle.h +118 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/Repeater.h +184 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/RoundCorner.h +65 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/ScaleMode.h +54 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/ShapePath.h +91 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/SolidColor.h +71 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/StrokeStyle.h +216 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/Text.h +97 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/TextModifier.h +215 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/TextPath.h +165 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/TextSelector.h +289 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/TrimPath.h +117 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/VectorElement.h +81 -0
- package/cpp/third_party/tgfx/include/tgfx/layers/vectors/VectorGroup.h +171 -0
- package/cpp/third_party/tgfx/include/tgfx/pdf/PDFDocument.h +75 -0
- package/cpp/third_party/tgfx/include/tgfx/pdf/PDFMetadata.h +252 -0
- package/cpp/third_party/tgfx/include/tgfx/platform/HardwareBuffer.h +158 -0
- package/cpp/third_party/tgfx/include/tgfx/platform/ImageReader.h +92 -0
- package/cpp/third_party/tgfx/include/tgfx/platform/NativeImage.h +53 -0
- package/cpp/third_party/tgfx/include/tgfx/platform/Print.h +31 -0
- package/cpp/third_party/tgfx/include/tgfx/platform/android/AndroidBitmap.h +56 -0
- package/cpp/third_party/tgfx/include/tgfx/platform/android/Global.h +82 -0
- package/cpp/third_party/tgfx/include/tgfx/platform/android/HardwareBufferJNI.h +37 -0
- package/cpp/third_party/tgfx/include/tgfx/platform/android/JNIEnvironment.h +67 -0
- package/cpp/third_party/tgfx/include/tgfx/platform/android/SurfaceTextureReader.h +58 -0
- package/cpp/third_party/tgfx/include/tgfx/platform/apple/CTTypeface.h +43 -0
- package/cpp/third_party/tgfx/include/tgfx/platform/ohos/OHOSPixelMap.h +42 -0
- package/cpp/third_party/tgfx/include/tgfx/platform/web/VideoElementReader.h +40 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/SVGAttribute.h +122 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/SVGCustomParser.h +42 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/SVGCustomWriter.h +59 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/SVGDOM.h +108 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/SVGExporter.h +150 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/SVGLengthContext.h +109 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/SVGPathParser.h +55 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/SVGTypes.h +939 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/SVGValue.h +95 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/TextShaper.h +53 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGCircle.h +65 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGClipPath.h +51 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGContainer.h +61 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGDefs.h +39 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGEllipse.h +63 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFe.h +104 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeBlend.h +64 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeColorMatrix.h +67 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeComponentTransfer.h +95 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeComposite.h +61 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeDisplacementMap.h +70 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeFlood.h +56 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeGaussianBlur.h +62 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeImage.h +58 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeLightSource.h +105 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeLighting.h +100 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeMerge.h +71 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeMorphology.h +65 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeOffset.h +58 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFeTurbulence.h +59 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGFilter.h +64 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGGradient.h +61 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGGroup.h +37 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGHiddenContainer.h +37 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGImage.h +75 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGLine.h +63 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGLinearGradient.h +53 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGMask.h +60 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGNode.h +302 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGPath.h +56 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGPattern.h +68 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGPoly.h +64 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGRadialGradient.h +55 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGRect.h +67 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGRoot.h +69 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGShape.h +54 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGStop.h +47 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGText.h +158 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGTransformableNode.h +58 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/node/SVGUse.h +61 -0
- package/cpp/third_party/tgfx/include/tgfx/svg/xml/XMLDOM.h +115 -0
- package/cpp/third_party/tgfx/ios/gen_ios +18 -0
- package/cpp/third_party/tgfx/ios/gen_simulator +18 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/AppDelegate.h +23 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/AppDelegate.m +52 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/Assets.xcassets/AppIcon.appiconset/tgfx.png +0 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/Assets.xcassets/Contents.json +6 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/Base.lproj/LaunchScreen.storyboard +25 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/Base.lproj/Main.storyboard +48 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/Info.plist +25 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/SceneDelegate.h +25 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/SceneDelegate.m +66 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/TGFXView.h +31 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/TGFXView.mm +187 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/ViewController.h +23 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/ViewController.mm +165 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D/main.m +29 -0
- package/cpp/third_party/tgfx/ios/metal/Hello2D.xcodeproj/project.pbxproj +441 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/AppDelegate.h +23 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/AppDelegate.m +52 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/Assets.xcassets/AppIcon.appiconset/tgfx.png +0 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/Assets.xcassets/Contents.json +6 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/Base.lproj/LaunchScreen.storyboard +25 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/Base.lproj/Main.storyboard +48 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/Info.plist +25 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/SceneDelegate.h +25 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/SceneDelegate.m +66 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/TGFXView.h +31 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/TGFXView.mm +181 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/ViewController.h +23 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/ViewController.mm +165 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D/main.m +29 -0
- package/cpp/third_party/tgfx/ios/opengl/Hello2D.xcodeproj/project.pbxproj +442 -0
- package/cpp/third_party/tgfx/mac/gen_mac +18 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/AppDelegate.h +23 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/AppDelegate.m +35 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/Assets.xcassets/AppIcon.appiconset/1024.png +0 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/Assets.xcassets/AppIcon.appiconset/128.png +0 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/Assets.xcassets/AppIcon.appiconset/16.png +0 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/Assets.xcassets/AppIcon.appiconset/256.png +0 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/Assets.xcassets/AppIcon.appiconset/32.png +0 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/Assets.xcassets/AppIcon.appiconset/512.png +0 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/Assets.xcassets/AppIcon.appiconset/64.png +0 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/Assets.xcassets/Contents.json +6 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/Base.lproj/Main.storyboard +718 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/Hello2D.entitlements +10 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/Info.plist +36 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/TGFXView.h +37 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/TGFXView.mm +251 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/ViewController.h +23 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/ViewController.mm +60 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/WindowController.h +27 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/WindowController.mm +35 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D/main.m +26 -0
- package/cpp/third_party/tgfx/mac/metal/Hello2D.xcodeproj/project.pbxproj +405 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/AppDelegate.h +23 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/AppDelegate.m +35 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/Assets.xcassets/AppIcon.appiconset/1024.png +0 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/Assets.xcassets/AppIcon.appiconset/128.png +0 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/Assets.xcassets/AppIcon.appiconset/16.png +0 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/Assets.xcassets/AppIcon.appiconset/256.png +0 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/Assets.xcassets/AppIcon.appiconset/32.png +0 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/Assets.xcassets/AppIcon.appiconset/512.png +0 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/Assets.xcassets/AppIcon.appiconset/64.png +0 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/Assets.xcassets/Contents.json +6 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/Base.lproj/Main.storyboard +718 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/Hello2D.entitlements +10 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/Info.plist +36 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/TGFXView.h +39 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/TGFXView.mm +316 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/ViewController.h +23 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/ViewController.mm +61 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/WindowController.h +27 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/WindowController.mm +35 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D/main.m +26 -0
- package/cpp/third_party/tgfx/mac/opengl/Hello2D.xcodeproj/project.pbxproj +402 -0
- package/cpp/third_party/tgfx/src/core/AdaptiveDashEffect.cpp +245 -0
- package/cpp/third_party/tgfx/src/core/AdaptiveDashEffect.h +37 -0
- package/cpp/third_party/tgfx/src/core/AdvancedTypefaceInfo.h +86 -0
- package/cpp/third_party/tgfx/src/core/Atlas.cpp +262 -0
- package/cpp/third_party/tgfx/src/core/Atlas.h +95 -0
- package/cpp/third_party/tgfx/src/core/AtlasManager.cpp +99 -0
- package/cpp/third_party/tgfx/src/core/AtlasManager.h +60 -0
- package/cpp/third_party/tgfx/src/core/AtlasStrikeCache.cpp +108 -0
- package/cpp/third_party/tgfx/src/core/AtlasStrikeCache.h +99 -0
- package/cpp/third_party/tgfx/src/core/AtlasTypes.cpp +82 -0
- package/cpp/third_party/tgfx/src/core/AtlasTypes.h +279 -0
- package/cpp/third_party/tgfx/src/core/Bitmap.cpp +131 -0
- package/cpp/third_party/tgfx/src/core/BoxFilterDownsample.cpp +449 -0
- package/cpp/third_party/tgfx/src/core/BoxFilterDownsample.h +49 -0
- package/cpp/third_party/tgfx/src/core/BoxFilterDownsampleSIMD.cpp +416 -0
- package/cpp/third_party/tgfx/src/core/BoxFilterDownsampleSIMD.h +40 -0
- package/cpp/third_party/tgfx/src/core/Brush.cpp +76 -0
- package/cpp/third_party/tgfx/src/core/Canvas.cpp +781 -0
- package/cpp/third_party/tgfx/src/core/CanvasState.cpp +30 -0
- package/cpp/third_party/tgfx/src/core/CanvasState.h +46 -0
- package/cpp/third_party/tgfx/src/core/Checksum.cpp +127 -0
- package/cpp/third_party/tgfx/src/core/Checksum.h +35 -0
- package/cpp/third_party/tgfx/src/core/ClipStack.cpp +720 -0
- package/cpp/third_party/tgfx/src/core/ClipStack.h +252 -0
- package/cpp/third_party/tgfx/src/core/Color.cpp +54 -0
- package/cpp/third_party/tgfx/src/core/ColorSpace.cpp +836 -0
- package/cpp/third_party/tgfx/src/core/ColorSpaceXformSteps.cpp +286 -0
- package/cpp/third_party/tgfx/src/core/ColorSpaceXformSteps.h +91 -0
- package/cpp/third_party/tgfx/src/core/CustomTypeface.cpp +104 -0
- package/cpp/third_party/tgfx/src/core/Data.cpp +95 -0
- package/cpp/third_party/tgfx/src/core/DataSource.h +140 -0
- package/cpp/third_party/tgfx/src/core/DrawContext.h +114 -0
- package/cpp/third_party/tgfx/src/core/Font.cpp +144 -0
- package/cpp/third_party/tgfx/src/core/GeometryShape.cpp +202 -0
- package/cpp/third_party/tgfx/src/core/GeometryShape.h +136 -0
- package/cpp/third_party/tgfx/src/core/GlyphRasterizer.cpp +58 -0
- package/cpp/third_party/tgfx/src/core/GlyphRasterizer.h +63 -0
- package/cpp/third_party/tgfx/src/core/GlyphTransform.cpp +110 -0
- package/cpp/third_party/tgfx/src/core/GlyphTransform.h +57 -0
- package/cpp/third_party/tgfx/src/core/GradientGenerator.cpp +78 -0
- package/cpp/third_party/tgfx/src/core/GradientGenerator.h +42 -0
- package/cpp/third_party/tgfx/src/core/HairlineTriangulator.cpp +569 -0
- package/cpp/third_party/tgfx/src/core/HairlineTriangulator.h +52 -0
- package/cpp/third_party/tgfx/src/core/ImageBuffer.cpp +95 -0
- package/cpp/third_party/tgfx/src/core/ImageCodec.cpp +221 -0
- package/cpp/third_party/tgfx/src/core/ImageFilter.cpp +116 -0
- package/cpp/third_party/tgfx/src/core/ImageInfo.cpp +118 -0
- package/cpp/third_party/tgfx/src/core/ImageSource.cpp +43 -0
- package/cpp/third_party/tgfx/src/core/ImageSource.h +48 -0
- package/cpp/third_party/tgfx/src/core/ImageUserTypeface.cpp +144 -0
- package/cpp/third_party/tgfx/src/core/ImageUserTypeface.h +54 -0
- package/cpp/third_party/tgfx/src/core/LayerUnrollContext.cpp +103 -0
- package/cpp/third_party/tgfx/src/core/LayerUnrollContext.h +80 -0
- package/cpp/third_party/tgfx/src/core/Matrix.cpp +610 -0
- package/cpp/third_party/tgfx/src/core/Matrix3D.cpp +469 -0
- package/cpp/third_party/tgfx/src/core/Matrix3DUtils.cpp +67 -0
- package/cpp/third_party/tgfx/src/core/Matrix3DUtils.h +89 -0
- package/cpp/third_party/tgfx/src/core/MatrixSIMD.cpp +350 -0
- package/cpp/third_party/tgfx/src/core/MatrixUtils.cpp +45 -0
- package/cpp/third_party/tgfx/src/core/MatrixUtils.h +33 -0
- package/cpp/third_party/tgfx/src/core/MeasureContext.cpp +131 -0
- package/cpp/third_party/tgfx/src/core/MeasureContext.h +72 -0
- package/cpp/third_party/tgfx/src/core/Mesh.cpp +44 -0
- package/cpp/third_party/tgfx/src/core/MeshBase.h +66 -0
- package/cpp/third_party/tgfx/src/core/NoConicsPathIterator.cpp +153 -0
- package/cpp/third_party/tgfx/src/core/NoConicsPathIterator.h +91 -0
- package/cpp/third_party/tgfx/src/core/Orientation.cpp +49 -0
- package/cpp/third_party/tgfx/src/core/Paint.cpp +40 -0
- package/cpp/third_party/tgfx/src/core/Path.cpp +716 -0
- package/cpp/third_party/tgfx/src/core/PathEffect.cpp +63 -0
- package/cpp/third_party/tgfx/src/core/PathMeasure.cpp +76 -0
- package/cpp/third_party/tgfx/src/core/PathProvider.cpp +43 -0
- package/cpp/third_party/tgfx/src/core/PathRasterizer.cpp +49 -0
- package/cpp/third_party/tgfx/src/core/PathRasterizer.h +61 -0
- package/cpp/third_party/tgfx/src/core/PathRef.cpp +58 -0
- package/cpp/third_party/tgfx/src/core/PathRef.h +59 -0
- package/cpp/third_party/tgfx/src/core/PathTriangulator.cpp +89 -0
- package/cpp/third_party/tgfx/src/core/PathTriangulator.h +60 -0
- package/cpp/third_party/tgfx/src/core/PathUserTypeface.cpp +217 -0
- package/cpp/third_party/tgfx/src/core/PathUserTypeface.h +53 -0
- package/cpp/third_party/tgfx/src/core/Picture.cpp +260 -0
- package/cpp/third_party/tgfx/src/core/PictureContext.cpp +263 -0
- package/cpp/third_party/tgfx/src/core/PictureContext.h +92 -0
- package/cpp/third_party/tgfx/src/core/PictureRecorder.cpp +51 -0
- package/cpp/third_party/tgfx/src/core/PictureRecords.h +419 -0
- package/cpp/third_party/tgfx/src/core/PixelBuffer.cpp +158 -0
- package/cpp/third_party/tgfx/src/core/PixelBuffer.h +113 -0
- package/cpp/third_party/tgfx/src/core/PixelBufferCodec.cpp +46 -0
- package/cpp/third_party/tgfx/src/core/PixelBufferCodec.h +43 -0
- package/cpp/third_party/tgfx/src/core/PixelRef.cpp +68 -0
- package/cpp/third_party/tgfx/src/core/PixelRef.h +111 -0
- package/cpp/third_party/tgfx/src/core/Pixmap.cpp +186 -0
- package/cpp/third_party/tgfx/src/core/PlaybackContext.cpp +117 -0
- package/cpp/third_party/tgfx/src/core/PlaybackContext.h +78 -0
- package/cpp/third_party/tgfx/src/core/Point.cpp +28 -0
- package/cpp/third_party/tgfx/src/core/RRect.cpp +154 -0
- package/cpp/third_party/tgfx/src/core/RRectUtils.cpp +334 -0
- package/cpp/third_party/tgfx/src/core/RRectUtils.h +79 -0
- package/cpp/third_party/tgfx/src/core/RSXform.cpp +31 -0
- package/cpp/third_party/tgfx/src/core/RawPixelCodec.cpp +89 -0
- package/cpp/third_party/tgfx/src/core/RawPixelCodec.h +49 -0
- package/cpp/third_party/tgfx/src/core/Rect.cpp +68 -0
- package/cpp/third_party/tgfx/src/core/RectPackSkyline.cpp +104 -0
- package/cpp/third_party/tgfx/src/core/RectPackSkyline.h +67 -0
- package/cpp/third_party/tgfx/src/core/RectSIMD.cpp +91 -0
- package/cpp/third_party/tgfx/src/core/RunRecord.cpp +76 -0
- package/cpp/third_party/tgfx/src/core/RunRecord.h +61 -0
- package/cpp/third_party/tgfx/src/core/ScaledImageGenerator.cpp +47 -0
- package/cpp/third_party/tgfx/src/core/ScaledImageGenerator.h +46 -0
- package/cpp/third_party/tgfx/src/core/ScalerContext.cpp +81 -0
- package/cpp/third_party/tgfx/src/core/ScalerContext.h +98 -0
- package/cpp/third_party/tgfx/src/core/Shader.cpp +38 -0
- package/cpp/third_party/tgfx/src/core/ShapeMesh.cpp +48 -0
- package/cpp/third_party/tgfx/src/core/ShapeMesh.h +62 -0
- package/cpp/third_party/tgfx/src/core/ShapeRasterizer.cpp +83 -0
- package/cpp/third_party/tgfx/src/core/ShapeRasterizer.h +71 -0
- package/cpp/third_party/tgfx/src/core/ShapeVertexSource.cpp +57 -0
- package/cpp/third_party/tgfx/src/core/ShapeVertexSource.h +42 -0
- package/cpp/third_party/tgfx/src/core/StencilCoverPathTessellator.cpp +258 -0
- package/cpp/third_party/tgfx/src/core/StencilCoverPathTessellator.h +100 -0
- package/cpp/third_party/tgfx/src/core/Stroke.cpp +65 -0
- package/cpp/third_party/tgfx/src/core/Surface.cpp +292 -0
- package/cpp/third_party/tgfx/src/core/SurfaceReadback.cpp +143 -0
- package/cpp/third_party/tgfx/src/core/TextBlob.cpp +330 -0
- package/cpp/third_party/tgfx/src/core/TextBlobBuilder.cpp +215 -0
- package/cpp/third_party/tgfx/src/core/TrimPathEffect.cpp +188 -0
- package/cpp/third_party/tgfx/src/core/TrimPathEffect.h +35 -0
- package/cpp/third_party/tgfx/src/core/Typeface.cpp +170 -0
- package/cpp/third_party/tgfx/src/core/UserScalerContext.h +66 -0
- package/cpp/third_party/tgfx/src/core/UserTypeface.h +95 -0
- package/cpp/third_party/tgfx/src/core/Vec.cpp +53 -0
- package/cpp/third_party/tgfx/src/core/VecSIMD.cpp +325 -0
- package/cpp/third_party/tgfx/src/core/VertexMesh.cpp +111 -0
- package/cpp/third_party/tgfx/src/core/VertexMesh.h +107 -0
- package/cpp/third_party/tgfx/src/core/YUVColorSpace.cpp +33 -0
- package/cpp/third_party/tgfx/src/core/YUVData.cpp +81 -0
- package/cpp/third_party/tgfx/src/core/YUVHardwareBuffer.cpp +98 -0
- package/cpp/third_party/tgfx/src/core/YUVHardwareBuffer.h +63 -0
- package/cpp/third_party/tgfx/src/core/codecs/jpeg/JpegCodec.cpp +445 -0
- package/cpp/third_party/tgfx/src/core/codecs/jpeg/JpegCodec.h +61 -0
- package/cpp/third_party/tgfx/src/core/codecs/png/PngCodec.cpp +457 -0
- package/cpp/third_party/tgfx/src/core/codecs/png/PngCodec.h +57 -0
- package/cpp/third_party/tgfx/src/core/codecs/webp/WebpCodec.cpp +253 -0
- package/cpp/third_party/tgfx/src/core/codecs/webp/WebpCodec.h +56 -0
- package/cpp/third_party/tgfx/src/core/codecs/webp/WebpUtility.cpp +376 -0
- package/cpp/third_party/tgfx/src/core/codecs/webp/WebpUtility.h +41 -0
- package/cpp/third_party/tgfx/src/core/filters/AlphaThresholdColorFilter.cpp +44 -0
- package/cpp/third_party/tgfx/src/core/filters/AlphaThresholdColorFilter.h +46 -0
- package/cpp/third_party/tgfx/src/core/filters/BlendImageFilter.cpp +72 -0
- package/cpp/third_party/tgfx/src/core/filters/BlendImageFilter.h +45 -0
- package/cpp/third_party/tgfx/src/core/filters/ColorImageFilter.cpp +59 -0
- package/cpp/third_party/tgfx/src/core/filters/ColorImageFilter.h +41 -0
- package/cpp/third_party/tgfx/src/core/filters/ComposeColorFilter.cpp +70 -0
- package/cpp/third_party/tgfx/src/core/filters/ComposeColorFilter.h +47 -0
- package/cpp/third_party/tgfx/src/core/filters/ComposeImageFilter.cpp +98 -0
- package/cpp/third_party/tgfx/src/core/filters/ComposeImageFilter.h +45 -0
- package/cpp/third_party/tgfx/src/core/filters/DropShadowImageFilter.cpp +128 -0
- package/cpp/third_party/tgfx/src/core/filters/DropShadowImageFilter.h +60 -0
- package/cpp/third_party/tgfx/src/core/filters/GaussianBlurImageFilter.cpp +226 -0
- package/cpp/third_party/tgfx/src/core/filters/GaussianBlurImageFilter.h +62 -0
- package/cpp/third_party/tgfx/src/core/filters/InnerShadowImageFilter.cpp +104 -0
- package/cpp/third_party/tgfx/src/core/filters/InnerShadowImageFilter.h +58 -0
- package/cpp/third_party/tgfx/src/core/filters/LumaColorFilter.cpp +33 -0
- package/cpp/third_party/tgfx/src/core/filters/LumaColorFilter.h +42 -0
- package/cpp/third_party/tgfx/src/core/filters/MatrixColorFilter.cpp +60 -0
- package/cpp/third_party/tgfx/src/core/filters/MatrixColorFilter.h +48 -0
- package/cpp/third_party/tgfx/src/core/filters/ModeColorFilter.cpp +101 -0
- package/cpp/third_party/tgfx/src/core/filters/ModeColorFilter.h +50 -0
- package/cpp/third_party/tgfx/src/core/filters/RuntimeImageFilter.cpp +82 -0
- package/cpp/third_party/tgfx/src/core/filters/RuntimeImageFilter.h +48 -0
- package/cpp/third_party/tgfx/src/core/filters/ShaderMaskFilter.cpp +55 -0
- package/cpp/third_party/tgfx/src/core/filters/ShaderMaskFilter.h +56 -0
- package/cpp/third_party/tgfx/src/core/images/BufferImage.cpp +80 -0
- package/cpp/third_party/tgfx/src/core/images/BufferImage.h +62 -0
- package/cpp/third_party/tgfx/src/core/images/CodecImage.cpp +67 -0
- package/cpp/third_party/tgfx/src/core/images/CodecImage.h +65 -0
- package/cpp/third_party/tgfx/src/core/images/DecodedImage.cpp +62 -0
- package/cpp/third_party/tgfx/src/core/images/DecodedImage.h +69 -0
- package/cpp/third_party/tgfx/src/core/images/FilterImage.cpp +158 -0
- package/cpp/third_party/tgfx/src/core/images/FilterImage.h +80 -0
- package/cpp/third_party/tgfx/src/core/images/GeneratorImage.cpp +44 -0
- package/cpp/third_party/tgfx/src/core/images/GeneratorImage.h +64 -0
- package/cpp/third_party/tgfx/src/core/images/Image.cpp +249 -0
- package/cpp/third_party/tgfx/src/core/images/OrientImage.cpp +170 -0
- package/cpp/third_party/tgfx/src/core/images/OrientImage.h +59 -0
- package/cpp/third_party/tgfx/src/core/images/PictureImage.cpp +180 -0
- package/cpp/third_party/tgfx/src/core/images/PictureImage.h +84 -0
- package/cpp/third_party/tgfx/src/core/images/PixelImage.cpp +43 -0
- package/cpp/third_party/tgfx/src/core/images/PixelImage.h +42 -0
- package/cpp/third_party/tgfx/src/core/images/RGBAAAImage.cpp +140 -0
- package/cpp/third_party/tgfx/src/core/images/RGBAAAImage.h +56 -0
- package/cpp/third_party/tgfx/src/core/images/RasterizedImage.cpp +132 -0
- package/cpp/third_party/tgfx/src/core/images/RasterizedImage.h +84 -0
- package/cpp/third_party/tgfx/src/core/images/ScaledImage.cpp +102 -0
- package/cpp/third_party/tgfx/src/core/images/ScaledImage.h +70 -0
- package/cpp/third_party/tgfx/src/core/images/SubsetImage.cpp +131 -0
- package/cpp/third_party/tgfx/src/core/images/SubsetImage.h +65 -0
- package/cpp/third_party/tgfx/src/core/images/TextureImage.cpp +92 -0
- package/cpp/third_party/tgfx/src/core/images/TextureImage.h +96 -0
- package/cpp/third_party/tgfx/src/core/images/TransformImage.cpp +77 -0
- package/cpp/third_party/tgfx/src/core/images/TransformImage.h +64 -0
- package/cpp/third_party/tgfx/src/core/shaders/BlendShader.cpp +74 -0
- package/cpp/third_party/tgfx/src/core/shaders/BlendShader.h +47 -0
- package/cpp/third_party/tgfx/src/core/shaders/ColorFilterShader.cpp +65 -0
- package/cpp/third_party/tgfx/src/core/shaders/ColorFilterShader.h +54 -0
- package/cpp/third_party/tgfx/src/core/shaders/ColorShader.cpp +56 -0
- package/cpp/third_party/tgfx/src/core/shaders/ColorShader.h +50 -0
- package/cpp/third_party/tgfx/src/core/shaders/GradientShader.cpp +411 -0
- package/cpp/third_party/tgfx/src/core/shaders/GradientShader.h +126 -0
- package/cpp/third_party/tgfx/src/core/shaders/ImageShader.cpp +64 -0
- package/cpp/third_party/tgfx/src/core/shaders/ImageShader.h +56 -0
- package/cpp/third_party/tgfx/src/core/shaders/MatrixShader.cpp +73 -0
- package/cpp/third_party/tgfx/src/core/shaders/MatrixShader.h +59 -0
- package/cpp/third_party/tgfx/src/core/shaders/PerlinNoiseShader.cpp +216 -0
- package/cpp/third_party/tgfx/src/core/shaders/PerlinNoiseShader.h +91 -0
- package/cpp/third_party/tgfx/src/core/shaders/RuntimeShader.cpp +51 -0
- package/cpp/third_party/tgfx/src/core/shaders/RuntimeShader.h +31 -0
- package/cpp/third_party/tgfx/src/core/shapes/AppendShape.cpp +83 -0
- package/cpp/third_party/tgfx/src/core/shapes/AppendShape.h +53 -0
- package/cpp/third_party/tgfx/src/core/shapes/EffectShape.cpp +45 -0
- package/cpp/third_party/tgfx/src/core/shapes/EffectShape.h +51 -0
- package/cpp/third_party/tgfx/src/core/shapes/FillTypeShape.cpp +53 -0
- package/cpp/third_party/tgfx/src/core/shapes/FillTypeShape.h +51 -0
- package/cpp/third_party/tgfx/src/core/shapes/GlyphShape.cpp +79 -0
- package/cpp/third_party/tgfx/src/core/shapes/GlyphShape.h +50 -0
- package/cpp/third_party/tgfx/src/core/shapes/Matrix3DShape.cpp +93 -0
- package/cpp/third_party/tgfx/src/core/shapes/Matrix3DShape.h +58 -0
- package/cpp/third_party/tgfx/src/core/shapes/MatrixShape.cpp +94 -0
- package/cpp/third_party/tgfx/src/core/shapes/MatrixShape.h +55 -0
- package/cpp/third_party/tgfx/src/core/shapes/MergeShape.cpp +90 -0
- package/cpp/third_party/tgfx/src/core/shapes/MergeShape.h +49 -0
- package/cpp/third_party/tgfx/src/core/shapes/PathShape.cpp +34 -0
- package/cpp/third_party/tgfx/src/core/shapes/PathShape.h +58 -0
- package/cpp/third_party/tgfx/src/core/shapes/ProviderShape.cpp +36 -0
- package/cpp/third_party/tgfx/src/core/shapes/ProviderShape.h +48 -0
- package/cpp/third_party/tgfx/src/core/shapes/ReverseShape.cpp +47 -0
- package/cpp/third_party/tgfx/src/core/shapes/ReverseShape.h +49 -0
- package/cpp/third_party/tgfx/src/core/shapes/Shape.cpp +51 -0
- package/cpp/third_party/tgfx/src/core/shapes/StrokeShape.cpp +110 -0
- package/cpp/third_party/tgfx/src/core/shapes/StrokeShape.h +58 -0
- package/cpp/third_party/tgfx/src/core/shapes/TextShape.cpp +77 -0
- package/cpp/third_party/tgfx/src/core/shapes/TextShape.h +49 -0
- package/cpp/third_party/tgfx/src/core/shapes/UniqueKeyShape.h +34 -0
- package/cpp/third_party/tgfx/src/core/utils/AddressOf.h +35 -0
- package/cpp/third_party/tgfx/src/core/utils/AtomicCache.h +52 -0
- package/cpp/third_party/tgfx/src/core/utils/BlockAllocator.cpp +167 -0
- package/cpp/third_party/tgfx/src/core/utils/BlockAllocator.h +211 -0
- package/cpp/third_party/tgfx/src/core/utils/Buffer.cpp +121 -0
- package/cpp/third_party/tgfx/src/core/utils/BytesKey.cpp +71 -0
- package/cpp/third_party/tgfx/src/core/utils/ClearPixels.cpp +33 -0
- package/cpp/third_party/tgfx/src/core/utils/ClearPixels.h +28 -0
- package/cpp/third_party/tgfx/src/core/utils/Clock.cpp +80 -0
- package/cpp/third_party/tgfx/src/core/utils/ColorHelper.cpp +65 -0
- package/cpp/third_party/tgfx/src/core/utils/ColorHelper.h +28 -0
- package/cpp/third_party/tgfx/src/core/utils/ColorSpaceHelper.cpp +207 -0
- package/cpp/third_party/tgfx/src/core/utils/ColorSpaceHelper.h +44 -0
- package/cpp/third_party/tgfx/src/core/utils/CopyPixels.cpp +110 -0
- package/cpp/third_party/tgfx/src/core/utils/CopyPixels.h +30 -0
- package/cpp/third_party/tgfx/src/core/utils/DataView.cpp +290 -0
- package/cpp/third_party/tgfx/src/core/utils/DecomposeRects.cpp +89 -0
- package/cpp/third_party/tgfx/src/core/utils/DecomposeRects.h +31 -0
- package/cpp/third_party/tgfx/src/core/utils/EnumHasher.h +32 -0
- package/cpp/third_party/tgfx/src/core/utils/FauxBoldScale.cpp +70 -0
- package/cpp/third_party/tgfx/src/core/utils/FauxBoldScale.h +25 -0
- package/cpp/third_party/tgfx/src/core/utils/FontTableTag.h +34 -0
- package/cpp/third_party/tgfx/src/core/utils/GammaCorrection.cpp +44 -0
- package/cpp/third_party/tgfx/src/core/utils/GammaCorrection.h +29 -0
- package/cpp/third_party/tgfx/src/core/utils/GeometryExtra.h +58 -0
- package/cpp/third_party/tgfx/src/core/utils/GlyphConverter.cpp +51 -0
- package/cpp/third_party/tgfx/src/core/utils/GlyphConverter.h +46 -0
- package/cpp/third_party/tgfx/src/core/utils/HardwareBufferUtil.cpp +63 -0
- package/cpp/third_party/tgfx/src/core/utils/HardwareBufferUtil.h +38 -0
- package/cpp/third_party/tgfx/src/core/utils/HashRange.cpp +29 -0
- package/cpp/third_party/tgfx/src/core/utils/HashRange.h +28 -0
- package/cpp/third_party/tgfx/src/core/utils/Log.h +63 -0
- package/cpp/third_party/tgfx/src/core/utils/MD5.cpp +199 -0
- package/cpp/third_party/tgfx/src/core/utils/MD5.h +33 -0
- package/cpp/third_party/tgfx/src/core/utils/MathExtra.cpp +118 -0
- package/cpp/third_party/tgfx/src/core/utils/MathExtra.h +177 -0
- package/cpp/third_party/tgfx/src/core/utils/NextCacheScaleLevel.cpp +47 -0
- package/cpp/third_party/tgfx/src/core/utils/NextCacheScaleLevel.h +25 -0
- package/cpp/third_party/tgfx/src/core/utils/OrientationHelper.h +100 -0
- package/cpp/third_party/tgfx/src/core/utils/PathUtils.cpp +479 -0
- package/cpp/third_party/tgfx/src/core/utils/PathUtils.h +120 -0
- package/cpp/third_party/tgfx/src/core/utils/PixelFormatUtil.cpp +80 -0
- package/cpp/third_party/tgfx/src/core/utils/PixelFormatUtil.h +35 -0
- package/cpp/third_party/tgfx/src/core/utils/PlacementArray.h +252 -0
- package/cpp/third_party/tgfx/src/core/utils/PlacementPtr.h +183 -0
- package/cpp/third_party/tgfx/src/core/utils/PointUtils.cpp +58 -0
- package/cpp/third_party/tgfx/src/core/utils/PointUtils.h +55 -0
- package/cpp/third_party/tgfx/src/core/utils/RectToRectMatrix.cpp +34 -0
- package/cpp/third_party/tgfx/src/core/utils/RectToRectMatrix.h +30 -0
- package/cpp/third_party/tgfx/src/core/utils/ReturnQueue.cpp +51 -0
- package/cpp/third_party/tgfx/src/core/utils/ReturnQueue.h +77 -0
- package/cpp/third_party/tgfx/src/core/utils/ShapeUtils.cpp +73 -0
- package/cpp/third_party/tgfx/src/core/utils/ShapeUtils.h +61 -0
- package/cpp/third_party/tgfx/src/core/utils/SingleOwner.h +64 -0
- package/cpp/third_party/tgfx/src/core/utils/SlidingWindowTracker.cpp +54 -0
- package/cpp/third_party/tgfx/src/core/utils/SlidingWindowTracker.h +51 -0
- package/cpp/third_party/tgfx/src/core/utils/Stream.cpp +177 -0
- package/cpp/third_party/tgfx/src/core/utils/StrokeUtils.cpp +140 -0
- package/cpp/third_party/tgfx/src/core/utils/StrokeUtils.h +73 -0
- package/cpp/third_party/tgfx/src/core/utils/Task.cpp +114 -0
- package/cpp/third_party/tgfx/src/core/utils/TaskGroup.cpp +187 -0
- package/cpp/third_party/tgfx/src/core/utils/TaskGroup.h +56 -0
- package/cpp/third_party/tgfx/src/core/utils/TileSortCompareFunc.h +38 -0
- package/cpp/third_party/tgfx/src/core/utils/TileSortCompareFuncSIMD.cpp +67 -0
- package/cpp/third_party/tgfx/src/core/utils/Types.h +88 -0
- package/cpp/third_party/tgfx/src/core/utils/USE.h +46 -0
- package/cpp/third_party/tgfx/src/core/utils/UTF.cpp +151 -0
- package/cpp/third_party/tgfx/src/core/utils/UniqueID.cpp +32 -0
- package/cpp/third_party/tgfx/src/core/utils/UniqueID.h +28 -0
- package/cpp/third_party/tgfx/src/core/utils/VecUtils.h +97 -0
- package/cpp/third_party/tgfx/src/core/utils/WeakMap.h +61 -0
- package/cpp/third_party/tgfx/src/core/utils/WriteStream.cpp +160 -0
- package/cpp/third_party/tgfx/src/core/vectors/coregraphics/CGPathRasterizer.cpp +205 -0
- package/cpp/third_party/tgfx/src/core/vectors/coregraphics/CGPathRasterizer.h +35 -0
- package/cpp/third_party/tgfx/src/core/vectors/coregraphics/CGScalerContext.cpp +381 -0
- package/cpp/third_party/tgfx/src/core/vectors/coregraphics/CGScalerContext.h +56 -0
- package/cpp/third_party/tgfx/src/core/vectors/coregraphics/CGTypeface.cpp +448 -0
- package/cpp/third_party/tgfx/src/core/vectors/coregraphics/CGTypeface.h +88 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTFontData.h +36 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTLibrary.cpp +36 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTLibrary.h +45 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTPath.cpp +118 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTPath.h +58 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTPathRasterizer.cpp +135 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTPathRasterizer.h +35 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTRasterTarget.cpp +54 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTRasterTarget.h +33 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTScalerContext.cpp +970 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTScalerContext.h +99 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTTypeface.cpp +310 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTTypeface.h +99 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/FTUtil.h +45 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/SystemFont.cpp +279 -0
- package/cpp/third_party/tgfx/src/core/vectors/freetype/SystemFont.h +31 -0
- package/cpp/third_party/tgfx/src/gpu/AAType.h +30 -0
- package/cpp/third_party/tgfx/src/gpu/AlignTo.cpp +28 -0
- package/cpp/third_party/tgfx/src/gpu/AlignTo.h +24 -0
- package/cpp/third_party/tgfx/src/gpu/Attribute.cpp +59 -0
- package/cpp/third_party/tgfx/src/gpu/Backend.cpp +275 -0
- package/cpp/third_party/tgfx/src/gpu/BackingFit.h +37 -0
- package/cpp/third_party/tgfx/src/gpu/BlendFormula.cpp +162 -0
- package/cpp/third_party/tgfx/src/gpu/BlendFormula.h +121 -0
- package/cpp/third_party/tgfx/src/gpu/ColorSpaceXformHelper.cpp +89 -0
- package/cpp/third_party/tgfx/src/gpu/ColorSpaceXformHelper.h +103 -0
- package/cpp/third_party/tgfx/src/gpu/CommandEncoder.cpp +43 -0
- package/cpp/third_party/tgfx/src/gpu/Context.cpp +204 -0
- package/cpp/third_party/tgfx/src/gpu/CoordTransform.cpp +39 -0
- package/cpp/third_party/tgfx/src/gpu/CoordTransform.h +40 -0
- package/cpp/third_party/tgfx/src/gpu/Device.cpp +70 -0
- package/cpp/third_party/tgfx/src/gpu/DrawingBuffer.cpp +85 -0
- package/cpp/third_party/tgfx/src/gpu/DrawingBuffer.h +89 -0
- package/cpp/third_party/tgfx/src/gpu/DrawingManager.cpp +211 -0
- package/cpp/third_party/tgfx/src/gpu/DrawingManager.h +111 -0
- package/cpp/third_party/tgfx/src/gpu/FragmentShaderBuilder.cpp +61 -0
- package/cpp/third_party/tgfx/src/gpu/FragmentShaderBuilder.h +61 -0
- package/cpp/third_party/tgfx/src/gpu/GlobalCache.cpp +705 -0
- package/cpp/third_party/tgfx/src/gpu/GlobalCache.h +156 -0
- package/cpp/third_party/tgfx/src/gpu/InstanceProvider.cpp +75 -0
- package/cpp/third_party/tgfx/src/gpu/InstanceProvider.h +78 -0
- package/cpp/third_party/tgfx/src/gpu/OpsCompositor.cpp +1198 -0
- package/cpp/third_party/tgfx/src/gpu/OpsCompositor.h +229 -0
- package/cpp/third_party/tgfx/src/gpu/Program.cpp +38 -0
- package/cpp/third_party/tgfx/src/gpu/Program.h +47 -0
- package/cpp/third_party/tgfx/src/gpu/ProgramBuilder.cpp +208 -0
- package/cpp/third_party/tgfx/src/gpu/ProgramBuilder.h +105 -0
- package/cpp/third_party/tgfx/src/gpu/ProgramInfo.cpp +339 -0
- package/cpp/third_party/tgfx/src/gpu/ProgramInfo.h +173 -0
- package/cpp/third_party/tgfx/src/gpu/ProxyProvider.cpp +711 -0
- package/cpp/third_party/tgfx/src/gpu/ProxyProvider.h +223 -0
- package/cpp/third_party/tgfx/src/gpu/Quad.cpp +65 -0
- package/cpp/third_party/tgfx/src/gpu/Quad.h +73 -0
- package/cpp/third_party/tgfx/src/gpu/QuadRecord.h +71 -0
- package/cpp/third_party/tgfx/src/gpu/QuadsVertexProvider.cpp +603 -0
- package/cpp/third_party/tgfx/src/gpu/QuadsVertexProvider.h +109 -0
- package/cpp/third_party/tgfx/src/gpu/RRectsVertexProvider.cpp +722 -0
- package/cpp/third_party/tgfx/src/gpu/RRectsVertexProvider.h +108 -0
- package/cpp/third_party/tgfx/src/gpu/RectsVertexProvider.cpp +928 -0
- package/cpp/third_party/tgfx/src/gpu/RectsVertexProvider.h +153 -0
- package/cpp/third_party/tgfx/src/gpu/RenderContext.cpp +773 -0
- package/cpp/third_party/tgfx/src/gpu/RenderContext.h +113 -0
- package/cpp/third_party/tgfx/src/gpu/RenderPipeline.cpp +31 -0
- package/cpp/third_party/tgfx/src/gpu/ResourceCache.cpp +288 -0
- package/cpp/third_party/tgfx/src/gpu/ResourceCache.h +170 -0
- package/cpp/third_party/tgfx/src/gpu/SLType.h +48 -0
- package/cpp/third_party/tgfx/src/gpu/SamplerHandle.h +43 -0
- package/cpp/third_party/tgfx/src/gpu/SamplerState.h +57 -0
- package/cpp/third_party/tgfx/src/gpu/SamplingArgs.h +42 -0
- package/cpp/third_party/tgfx/src/gpu/ShaderBuilder.cpp +354 -0
- package/cpp/third_party/tgfx/src/gpu/ShaderBuilder.h +133 -0
- package/cpp/third_party/tgfx/src/gpu/ShaderCaps.cpp +104 -0
- package/cpp/third_party/tgfx/src/gpu/ShaderCaps.h +101 -0
- package/cpp/third_party/tgfx/src/gpu/ShaderCompiler.cpp +171 -0
- package/cpp/third_party/tgfx/src/gpu/ShaderCompiler.h +42 -0
- package/cpp/third_party/tgfx/src/gpu/ShaderVar.cpp +103 -0
- package/cpp/third_party/tgfx/src/gpu/ShaderVar.h +59 -0
- package/cpp/third_party/tgfx/src/gpu/Swizzle.cpp +77 -0
- package/cpp/third_party/tgfx/src/gpu/Swizzle.h +116 -0
- package/cpp/third_party/tgfx/src/gpu/TPArgs.h +64 -0
- package/cpp/third_party/tgfx/src/gpu/Texture.cpp +33 -0
- package/cpp/third_party/tgfx/src/gpu/Uniform.cpp +52 -0
- package/cpp/third_party/tgfx/src/gpu/Uniform.h +90 -0
- package/cpp/third_party/tgfx/src/gpu/UniformData.cpp +160 -0
- package/cpp/third_party/tgfx/src/gpu/UniformData.h +158 -0
- package/cpp/third_party/tgfx/src/gpu/UniformHandler.cpp +96 -0
- package/cpp/third_party/tgfx/src/gpu/UniformHandler.h +83 -0
- package/cpp/third_party/tgfx/src/gpu/UniqueDomain.cpp +49 -0
- package/cpp/third_party/tgfx/src/gpu/UniqueDomain.h +55 -0
- package/cpp/third_party/tgfx/src/gpu/VaryingHandler.cpp +79 -0
- package/cpp/third_party/tgfx/src/gpu/VaryingHandler.h +87 -0
- package/cpp/third_party/tgfx/src/gpu/VertexProvider.cpp +45 -0
- package/cpp/third_party/tgfx/src/gpu/VertexProvider.h +83 -0
- package/cpp/third_party/tgfx/src/gpu/VertexShaderBuilder.h +48 -0
- package/cpp/third_party/tgfx/src/gpu/Window.cpp +38 -0
- package/cpp/third_party/tgfx/src/gpu/YUVFormat.h +39 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/GLSLBlend.cpp +551 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/GLSLBlend.h +31 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/GLSLFragmentShaderBuilder.cpp +67 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/GLSLFragmentShaderBuilder.h +37 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/GLSLProgramBuilder.cpp +240 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/GLSLProgramBuilder.h +70 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/GLSLVertexShaderBuilder.cpp +51 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/GLSLVertexShaderBuilder.h +33 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLAlphaThresholdFragmentProcessor.cpp +49 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLAlphaThresholdFragmentProcessor.h +34 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLAtlasTextGeometryProcessor.cpp +99 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLAtlasTextGeometryProcessor.h +38 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLClampedGradientEffect.cpp +90 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLClampedGradientEffect.h +37 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLColorMatrixFragmentProcessor.cpp +66 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLColorMatrixFragmentProcessor.h +35 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLComplexEllipseGeometryProcessor.cpp +163 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLComplexEllipseGeometryProcessor.h +34 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLComplexNonAARRectGeometryProcessor.cpp +161 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLComplexNonAARRectGeometryProcessor.h +34 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLComposeFragmentProcessor.cpp +48 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLComposeFragmentProcessor.h +30 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLConicGradientLayout.cpp +50 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLConicGradientLayout.h +34 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLConstColorProcessor.cpp +52 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLConstColorProcessor.h +34 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLDefaultGeometryProcessor.cpp +77 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLDefaultGeometryProcessor.h +35 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLDeviceSpaceTextureEffect.cpp +66 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLDeviceSpaceTextureEffect.h +34 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLDiamondGradientLayout.cpp +39 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLDiamondGradientLayout.h +30 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLDualIntervalGradientColorizer.cpp +84 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLDualIntervalGradientColorizer.h +36 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLEllipseGeometryProcessor.cpp +109 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLEllipseGeometryProcessor.h +34 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLEmptyXferProcessor.cpp +31 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLEmptyXferProcessor.h +28 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLGaussianBlur1DFragmentProcessor.cpp +94 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLGaussianBlur1DFragmentProcessor.h +37 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLHairlineLineGeometryProcessor.cpp +92 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLHairlineLineGeometryProcessor.h +38 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLHairlineQuadGeometryProcessor.cpp +109 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLHairlineQuadGeometryProcessor.h +38 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLLinearGradientLayout.cpp +36 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLLinearGradientLayout.h +30 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLLumaFragmentProcessor.cpp +45 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLLumaFragmentProcessor.h +33 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLMeshGeometryProcessor.cpp +105 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLMeshGeometryProcessor.h +36 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLNonAARRectGeometryProcessor.cpp +131 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLNonAARRectGeometryProcessor.h +34 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLPerlinNoiseFragmentProcessor.cpp +240 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLPerlinNoiseFragmentProcessor.h +36 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLPorterDuffXferProcessor.cpp +102 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLPorterDuffXferProcessor.h +32 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLQuadPerEdgeAAGeometryProcessor.cpp +116 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLQuadPerEdgeAAGeometryProcessor.h +47 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLRRectEffect.cpp +158 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLRRectEffect.h +36 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLRadialGradientLayout.cpp +36 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLRadialGradientLayout.h +30 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLRectEffect.cpp +105 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLRectEffect.h +35 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLRoundStrokeRectGeometryProcessor.cpp +101 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLRoundStrokeRectGeometryProcessor.h +34 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLRuntimeShaderProcessor.cpp +210 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLRuntimeShaderProcessor.h +21 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLShapeInstancedGeometryProcessor.cpp +98 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLShapeInstancedGeometryProcessor.h +34 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLSingleIntervalGradientColorizer.cpp +47 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLSingleIntervalGradientColorizer.h +35 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLStencilCoverCoverPassGeometryProcessor.cpp +71 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLStencilCoverCoverPassGeometryProcessor.h +33 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLStencilCoverStencilPassGeometryProcessor.cpp +85 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLStencilCoverStencilPassGeometryProcessor.h +34 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLTextureEffect.cpp +295 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLTextureEffect.h +41 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLTextureGradientColorizer.cpp +41 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLTextureGradientColorizer.h +30 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLTiledTextureEffect.cpp +480 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLTiledTextureEffect.h +65 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLUnrolledBinaryGradientColorizer.cpp +291 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLUnrolledBinaryGradientColorizer.h +49 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLXfermodeFragmentProcessor.cpp +74 -0
- package/cpp/third_party/tgfx/src/gpu/glsl/processors/GLSLXfermodeFragmentProcessor.h +31 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalBuffer.h +64 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalBuffer.mm +112 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalCaps.h +117 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalCaps.mm +177 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalCommandBuffer.h +45 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalCommandBuffer.mm +31 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalCommandEncoder.h +71 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalCommandEncoder.mm +173 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalCommandQueue.h +86 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalCommandQueue.mm +208 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalDefines.h +54 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalDevice.h +30 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalDevice.mm +72 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalDrawableProxy.h +52 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalDrawableProxy.mm +94 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalExternalTexture.h +37 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalGPU.h +159 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalGPU.mm +267 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalHardwareTexture.h +60 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalHardwareTexture.mm +146 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalRenderPass.h +110 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalRenderPass.mm +386 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalRenderPipeline.h +91 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalRenderPipeline.mm +310 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalResource.h +47 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalResource.mm +21 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalSampler.h +55 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalSampler.mm +73 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalSemaphore.h +81 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalSemaphore.mm +66 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalShaderModule.h +106 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalShaderModule.mm +244 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalTexture.h +67 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalTexture.mm +157 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalUtil.h +66 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalUtil.mm +337 -0
- package/cpp/third_party/tgfx/src/gpu/metal/MetalWindow.mm +122 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLBuffer.cpp +117 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLBuffer.h +64 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLCaps.cpp +325 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLCaps.h +118 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLCommandEncoder.cpp +178 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLCommandEncoder.h +50 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLCommandQueue.cpp +122 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLCommandQueue.h +52 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLCoreFunctions.h +112 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLDefines.h +925 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLDepthStencilTexture.cpp +66 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLDepthStencilTexture.h +44 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLDevice.cpp +104 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLExternalTexture.h +42 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLFunctions.h +293 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLGPU.cpp +336 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLGPU.h +119 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLInterface.cpp +276 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLInterface.h +48 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLMultisampleTexture.cpp +98 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLMultisampleTexture.h +46 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLProcGetter.h +32 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLRenderPass.cpp +293 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLRenderPass.h +96 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLRenderPipeline.cpp +336 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLRenderPipeline.h +106 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLResource.h +45 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLSampler.h +53 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLSemaphore.cpp +41 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLSemaphore.h +47 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLShaderModule.cpp +33 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLShaderModule.h +40 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLStandard.h +23 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLState.cpp +261 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLState.h +125 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLTexture.cpp +173 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLTexture.h +95 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLUtil.cpp +217 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/GLUtil.h +68 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/cgl/CGLDevice.mm +136 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/cgl/CGLGPU.h +42 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/cgl/CGLGPU.mm +52 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/cgl/CGLHardwareTexture.h +50 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/cgl/CGLHardwareTexture.mm +90 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/cgl/CGLProcGetter.h +35 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/cgl/CGLProcGetter.mm +42 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/cgl/CGLWindow.mm +91 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/eagl/EAGLDevice.mm +308 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/eagl/EAGLGPU.h +46 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/eagl/EAGLGPU.mm +61 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/eagl/EAGLHardwareTexture.h +47 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/eagl/EAGLHardwareTexture.mm +127 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/eagl/EAGLLayerTexture.h +55 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/eagl/EAGLLayerTexture.mm +85 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/eagl/EAGLProcGetter.h +35 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/eagl/EAGLProcGetter.mm +41 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/eagl/EAGLWindow.mm +79 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/egl/EGLDevice.cpp +384 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/egl/EGLDisplayWrapper.cpp +111 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/egl/EGLDisplayWrapper.h +31 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/egl/EGLGPU.cpp +82 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/egl/EGLGPU.h +40 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/egl/EGLGlobals.cpp +100 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/egl/EGLHardwareTexture.cpp +163 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/egl/EGLHardwareTexture.h +57 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/egl/EGLProcGetter.cpp +53 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/egl/EGLProcGetter.h +28 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/egl/EGLWindow.cpp +126 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/qt/QGLDevice.cpp +171 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/qt/QGLDrawableProxy.cpp +94 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/qt/QGLDrawableProxy.h +61 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/qt/QGLGPU.cpp +76 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/qt/QGLGPU.h +52 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/qt/QGLProcGetter.cpp +33 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/qt/QGLProcGetter.h +35 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/qt/QGLWindow.cpp +293 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/webgl/WebGLBuffer.cpp +93 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/webgl/WebGLBuffer.h +45 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/webgl/WebGLDevice.cpp +161 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/webgl/WebGLGPU.cpp +30 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/webgl/WebGLGPU.h +32 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/webgl/WebGLProcGetter.cpp +50 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/webgl/WebGLProcGetter.h +28 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/webgl/WebGLWindow.cpp +59 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/wgl/WGLDefines.h +113 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/wgl/WGLDevice.cpp +335 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/wgl/WGLGPU.cpp +297 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/wgl/WGLGPU.h +78 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/wgl/WGLHardwareTexture.cpp +289 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/wgl/WGLHardwareTexture.h +53 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/wgl/WGLInterface.cpp +155 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/wgl/WGLInterface.h +75 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/wgl/WGLProcGetter.cpp +47 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/wgl/WGLProcGetter.h +36 -0
- package/cpp/third_party/tgfx/src/gpu/opengl/wgl/WGLWindow.cpp +71 -0
- package/cpp/third_party/tgfx/src/gpu/ops/AtlasTextOp.cpp +99 -0
- package/cpp/third_party/tgfx/src/gpu/ops/AtlasTextOp.h +62 -0
- package/cpp/third_party/tgfx/src/gpu/ops/DrawOp.cpp +41 -0
- package/cpp/third_party/tgfx/src/gpu/ops/DrawOp.h +125 -0
- package/cpp/third_party/tgfx/src/gpu/ops/HairlineLineOp.cpp +91 -0
- package/cpp/third_party/tgfx/src/gpu/ops/HairlineLineOp.h +66 -0
- package/cpp/third_party/tgfx/src/gpu/ops/HairlineQuadOp.cpp +91 -0
- package/cpp/third_party/tgfx/src/gpu/ops/HairlineQuadOp.h +66 -0
- package/cpp/third_party/tgfx/src/gpu/ops/MeshDrawOp.cpp +75 -0
- package/cpp/third_party/tgfx/src/gpu/ops/MeshDrawOp.h +53 -0
- package/cpp/third_party/tgfx/src/gpu/ops/Quads3DDrawOp.cpp +98 -0
- package/cpp/third_party/tgfx/src/gpu/ops/Quads3DDrawOp.h +64 -0
- package/cpp/third_party/tgfx/src/gpu/ops/RRectDrawOp.cpp +101 -0
- package/cpp/third_party/tgfx/src/gpu/ops/RRectDrawOp.h +88 -0
- package/cpp/third_party/tgfx/src/gpu/ops/RectDrawOp.cpp +116 -0
- package/cpp/third_party/tgfx/src/gpu/ops/RectDrawOp.h +103 -0
- package/cpp/third_party/tgfx/src/gpu/ops/ShapeDrawOp.cpp +104 -0
- package/cpp/third_party/tgfx/src/gpu/ops/ShapeDrawOp.h +53 -0
- package/cpp/third_party/tgfx/src/gpu/ops/ShapeInstancedDrawOp.cpp +136 -0
- package/cpp/third_party/tgfx/src/gpu/ops/ShapeInstancedDrawOp.h +69 -0
- package/cpp/third_party/tgfx/src/gpu/ops/StandardDrawOp.cpp +61 -0
- package/cpp/third_party/tgfx/src/gpu/ops/StandardDrawOp.h +94 -0
- package/cpp/third_party/tgfx/src/gpu/ops/StencilCoverPathDrawOp.cpp +302 -0
- package/cpp/third_party/tgfx/src/gpu/ops/StencilCoverPathDrawOp.h +149 -0
- package/cpp/third_party/tgfx/src/gpu/processors/AlphaThresholdFragmentProcessor.h +42 -0
- package/cpp/third_party/tgfx/src/gpu/processors/AtlasTextGeometryProcessor.cpp +46 -0
- package/cpp/third_party/tgfx/src/gpu/processors/AtlasTextGeometryProcessor.h +65 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ClampedGradientEffect.cpp +30 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ClampedGradientEffect.h +49 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ColorMatrixFragmentProcessor.h +43 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ColorSpaceXFormEffect.cpp +58 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ColorSpaceXFormEffect.h +52 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ComplexEllipseGeometryProcessor.cpp +44 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ComplexEllipseGeometryProcessor.h +66 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ComplexNonAARRectGeometryProcessor.cpp +45 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ComplexNonAARRectGeometryProcessor.h +62 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ComposeFragmentProcessor.cpp +58 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ComposeFragmentProcessor.h +42 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ConicGradientLayout.cpp +31 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ConicGradientLayout.h +44 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ConstColorProcessor.cpp +25 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ConstColorProcessor.h +48 -0
- package/cpp/third_party/tgfx/src/gpu/processors/DefaultGeometryProcessor.cpp +37 -0
- package/cpp/third_party/tgfx/src/gpu/processors/DefaultGeometryProcessor.h +58 -0
- package/cpp/third_party/tgfx/src/gpu/processors/DeviceSpaceTextureEffect.cpp +35 -0
- package/cpp/third_party/tgfx/src/gpu/processors/DeviceSpaceTextureEffect.h +46 -0
- package/cpp/third_party/tgfx/src/gpu/processors/DiamondGradientLayout.cpp +31 -0
- package/cpp/third_party/tgfx/src/gpu/processors/DiamondGradientLayout.h +41 -0
- package/cpp/third_party/tgfx/src/gpu/processors/DualIntervalGradientColorizer.h +50 -0
- package/cpp/third_party/tgfx/src/gpu/processors/EllipseGeometryProcessor.cpp +40 -0
- package/cpp/third_party/tgfx/src/gpu/processors/EllipseGeometryProcessor.h +60 -0
- package/cpp/third_party/tgfx/src/gpu/processors/EmptyXferProcessor.cpp +25 -0
- package/cpp/third_party/tgfx/src/gpu/processors/EmptyXferProcessor.h +44 -0
- package/cpp/third_party/tgfx/src/gpu/processors/FragmentProcessor.cpp +213 -0
- package/cpp/third_party/tgfx/src/gpu/processors/FragmentProcessor.h +339 -0
- package/cpp/third_party/tgfx/src/gpu/processors/GaussianBlur1DFragmentProcessor.cpp +35 -0
- package/cpp/third_party/tgfx/src/gpu/processors/GaussianBlur1DFragmentProcessor.h +51 -0
- package/cpp/third_party/tgfx/src/gpu/processors/GeometryProcessor.cpp +109 -0
- package/cpp/third_party/tgfx/src/gpu/processors/GeometryProcessor.h +165 -0
- package/cpp/third_party/tgfx/src/gpu/processors/HairlineLineGeometryProcessor.cpp +40 -0
- package/cpp/third_party/tgfx/src/gpu/processors/HairlineLineGeometryProcessor.h +65 -0
- package/cpp/third_party/tgfx/src/gpu/processors/HairlineQuadGeometryProcessor.cpp +40 -0
- package/cpp/third_party/tgfx/src/gpu/processors/HairlineQuadGeometryProcessor.h +65 -0
- package/cpp/third_party/tgfx/src/gpu/processors/LinearGradientLayout.cpp +31 -0
- package/cpp/third_party/tgfx/src/gpu/processors/LinearGradientLayout.h +41 -0
- package/cpp/third_party/tgfx/src/gpu/processors/LumaFragmentProcessor.cpp +55 -0
- package/cpp/third_party/tgfx/src/gpu/processors/LumaFragmentProcessor.h +52 -0
- package/cpp/third_party/tgfx/src/gpu/processors/MeshGeometryProcessor.cpp +54 -0
- package/cpp/third_party/tgfx/src/gpu/processors/MeshGeometryProcessor.h +59 -0
- package/cpp/third_party/tgfx/src/gpu/processors/NonAARRectGeometryProcessor.cpp +44 -0
- package/cpp/third_party/tgfx/src/gpu/processors/NonAARRectGeometryProcessor.h +61 -0
- package/cpp/third_party/tgfx/src/gpu/processors/PerlinNoiseFragmentProcessor.cpp +62 -0
- package/cpp/third_party/tgfx/src/gpu/processors/PerlinNoiseFragmentProcessor.h +67 -0
- package/cpp/third_party/tgfx/src/gpu/processors/PorterDuffXferProcessor.cpp +33 -0
- package/cpp/third_party/tgfx/src/gpu/processors/PorterDuffXferProcessor.h +49 -0
- package/cpp/third_party/tgfx/src/gpu/processors/Processor.h +54 -0
- package/cpp/third_party/tgfx/src/gpu/processors/QuadPerEdgeAAGeometryProcessor.cpp +53 -0
- package/cpp/third_party/tgfx/src/gpu/processors/QuadPerEdgeAAGeometryProcessor.h +63 -0
- package/cpp/third_party/tgfx/src/gpu/processors/RRectEffect.cpp +32 -0
- package/cpp/third_party/tgfx/src/gpu/processors/RRectEffect.h +82 -0
- package/cpp/third_party/tgfx/src/gpu/processors/RadialGradientLayout.cpp +31 -0
- package/cpp/third_party/tgfx/src/gpu/processors/RadialGradientLayout.h +41 -0
- package/cpp/third_party/tgfx/src/gpu/processors/RectEffect.cpp +32 -0
- package/cpp/third_party/tgfx/src/gpu/processors/RectEffect.h +76 -0
- package/cpp/third_party/tgfx/src/gpu/processors/RoundStrokeRectGeometryProcessor.cpp +49 -0
- package/cpp/third_party/tgfx/src/gpu/processors/RoundStrokeRectGeometryProcessor.h +58 -0
- package/cpp/third_party/tgfx/src/gpu/processors/RuntimeShaderProcessor.cpp +35 -0
- package/cpp/third_party/tgfx/src/gpu/processors/RuntimeShaderProcessor.h +40 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ShapeInstancedGeometryProcessor.cpp +47 -0
- package/cpp/third_party/tgfx/src/gpu/processors/ShapeInstancedGeometryProcessor.h +56 -0
- package/cpp/third_party/tgfx/src/gpu/processors/SingleIntervalGradientColorizer.h +44 -0
- package/cpp/third_party/tgfx/src/gpu/processors/StencilCoverCoverPassGeometryProcessor.cpp +28 -0
- package/cpp/third_party/tgfx/src/gpu/processors/StencilCoverCoverPassGeometryProcessor.h +61 -0
- package/cpp/third_party/tgfx/src/gpu/processors/StencilCoverStencilPassGeometryProcessor.cpp +35 -0
- package/cpp/third_party/tgfx/src/gpu/processors/StencilCoverStencilPassGeometryProcessor.h +62 -0
- package/cpp/third_party/tgfx/src/gpu/processors/TextureEffect.cpp +117 -0
- package/cpp/third_party/tgfx/src/gpu/processors/TextureEffect.h +76 -0
- package/cpp/third_party/tgfx/src/gpu/processors/TextureGradientColorizer.h +52 -0
- package/cpp/third_party/tgfx/src/gpu/processors/TiledTextureEffect.cpp +190 -0
- package/cpp/third_party/tgfx/src/gpu/processors/TiledTextureEffect.h +85 -0
- package/cpp/third_party/tgfx/src/gpu/processors/UnrolledBinaryGradientColorizer.cpp +25 -0
- package/cpp/third_party/tgfx/src/gpu/processors/UnrolledBinaryGradientColorizer.h +72 -0
- package/cpp/third_party/tgfx/src/gpu/processors/XferProcessor.h +64 -0
- package/cpp/third_party/tgfx/src/gpu/processors/XfermodeFragmentProcessor.cpp +65 -0
- package/cpp/third_party/tgfx/src/gpu/processors/XfermodeFragmentProcessor.h +68 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/DefaultTextureProxy.cpp +42 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/DefaultTextureProxy.h +37 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/ExternalRenderTargetProxy.h +71 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/ExternalTextureRenderTargetProxy.cpp +40 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/ExternalTextureRenderTargetProxy.h +36 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/GPUBufferProxy.h +42 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/GPUHairlineProxy.h +61 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/GPUMeshProxy.cpp +102 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/GPUMeshProxy.h +97 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/GPUShapeProxy.h +58 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/HardwareRenderTargetProxy.cpp +43 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/HardwareRenderTargetProxy.h +43 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/HardwareTextureProxy.cpp +41 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/HardwareTextureProxy.h +42 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/RenderTargetProxy.cpp +91 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/RenderTargetProxy.h +179 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/ResourceProxy.h +63 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/StencilCoverPathProxy.h +60 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/TextureProxy.h +124 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/TextureRenderTargetProxy.cpp +46 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/TextureRenderTargetProxy.h +87 -0
- package/cpp/third_party/tgfx/src/gpu/proxies/VertexBufferView.h +60 -0
- package/cpp/third_party/tgfx/src/gpu/resources/BufferResource.cpp +45 -0
- package/cpp/third_party/tgfx/src/gpu/resources/BufferResource.h +76 -0
- package/cpp/third_party/tgfx/src/gpu/resources/DefaultTextureView.cpp +36 -0
- package/cpp/third_party/tgfx/src/gpu/resources/DefaultTextureView.h +42 -0
- package/cpp/third_party/tgfx/src/gpu/resources/ExternalRenderTarget.cpp +37 -0
- package/cpp/third_party/tgfx/src/gpu/resources/ExternalRenderTarget.h +61 -0
- package/cpp/third_party/tgfx/src/gpu/resources/RenderTarget.h +142 -0
- package/cpp/third_party/tgfx/src/gpu/resources/Resource.cpp +37 -0
- package/cpp/third_party/tgfx/src/gpu/resources/Resource.h +103 -0
- package/cpp/third_party/tgfx/src/gpu/resources/ResourceKey.cpp +210 -0
- package/cpp/third_party/tgfx/src/gpu/resources/ResourceKey.h +222 -0
- package/cpp/third_party/tgfx/src/gpu/resources/TextureRenderTarget.cpp +131 -0
- package/cpp/third_party/tgfx/src/gpu/resources/TextureRenderTarget.h +73 -0
- package/cpp/third_party/tgfx/src/gpu/resources/TextureView.cpp +154 -0
- package/cpp/third_party/tgfx/src/gpu/resources/TextureView.h +235 -0
- package/cpp/third_party/tgfx/src/gpu/resources/YUVTextureView.cpp +132 -0
- package/cpp/third_party/tgfx/src/gpu/resources/YUVTextureView.h +92 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/AtlasUploadTask.cpp +154 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/AtlasUploadTask.h +62 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/GPUBufferUploadTask.cpp +50 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/GPUBufferUploadTask.h +43 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/GenerateMipmapsTask.cpp +36 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/GenerateMipmapsTask.h +34 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/HairlineBufferUploadTask.cpp +93 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/HairlineBufferUploadTask.h +49 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/MeshBufferUploadTask.cpp +148 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/MeshBufferUploadTask.h +78 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/OpsRenderTask.cpp +81 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/OpsRenderTask.h +41 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/ReadbackBufferCreateTask.cpp +38 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/ReadbackBufferCreateTask.h +35 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/RenderTargetCopyTask.cpp +48 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/RenderTargetCopyTask.h +38 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/RenderTask.h +37 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/ResourceTask.cpp +40 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/ResourceTask.h +48 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/RuntimeDrawTask.cpp +150 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/RuntimeDrawTask.h +52 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/ShapeBufferUploadTask.cpp +63 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/ShapeBufferUploadTask.h +39 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/StencilCoverPathUploadTask.cpp +55 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/StencilCoverPathUploadTask.h +43 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/TextureUploadTask.cpp +47 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/TextureUploadTask.h +36 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/TransferPixelsTask.cpp +42 -0
- package/cpp/third_party/tgfx/src/gpu/tasks/TransferPixelsTask.h +38 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanAPI.h +43 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanBuffer.cpp +137 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanBuffer.h +66 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanCaps.cpp +172 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanCaps.h +116 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanCommandBuffer.cpp +34 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanCommandBuffer.h +68 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanCommandEncoder.cpp +361 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanCommandEncoder.h +95 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanCommandQueue.cpp +393 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanCommandQueue.h +102 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanDefines.h +56 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanDevice.cpp +55 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanDevice.h +24 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanExtensions.cpp +224 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanExtensions.h +93 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanFrameSession.h +96 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanGPU.cpp +970 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanGPU.h +293 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanHardwareTexture.cpp +306 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanHardwareTexture.h +62 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanRenderPass.cpp +551 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanRenderPass.h +115 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanRenderPipeline.cpp +596 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanRenderPipeline.h +108 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanResource.cpp +21 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanResource.h +43 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanSampler.cpp +108 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanSampler.h +52 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanSemaphore.cpp +82 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanSemaphore.h +71 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanShaderModule.cpp +65 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanShaderModule.h +54 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanSwapchainProxy.cpp +110 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanSwapchainProxy.h +84 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanTexture.cpp +208 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanTexture.h +90 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanUtil.cpp +236 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanUtil.h +73 -0
- package/cpp/third_party/tgfx/src/gpu/vulkan/VulkanWindow.cpp +764 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUBuffer.cpp +171 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUBuffer.h +72 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUCaps.cpp +109 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUCaps.h +78 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUCommandBuffer.h +45 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUCommandEncoder.cpp +223 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUCommandEncoder.h +60 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUCommandQueue.cpp +104 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUCommandQueue.h +63 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUDefines.h +58 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUDevice.cpp +98 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUDevice.h +24 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUDrawableProxy.cpp +117 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUDrawableProxy.h +58 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUGPU.cpp +294 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUGPU.h +136 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPURenderPass.cpp +305 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPURenderPass.h +97 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPURenderPipeline.cpp +305 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPURenderPipeline.h +72 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUResource.cpp +21 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUResource.h +43 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUSampler.cpp +57 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUSampler.h +47 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUSemaphore.cpp +28 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUSemaphore.h +33 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUShaderModule.cpp +275 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUShaderModule.h +57 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUTexture.cpp +144 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUTexture.h +73 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUUtil.cpp +364 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUUtil.h +72 -0
- package/cpp/third_party/tgfx/src/gpu/webgpu/WebGPUWindow.cpp +156 -0
- package/cpp/third_party/tgfx/src/layers/BackgroundHandler.cpp +363 -0
- package/cpp/third_party/tgfx/src/layers/BackgroundHandler.h +217 -0
- package/cpp/third_party/tgfx/src/layers/BackgroundSnapshotMap.h +102 -0
- package/cpp/third_party/tgfx/src/layers/BackgroundSource.cpp +285 -0
- package/cpp/third_party/tgfx/src/layers/BackgroundSource.h +104 -0
- package/cpp/third_party/tgfx/src/layers/DashEffect.cpp +41 -0
- package/cpp/third_party/tgfx/src/layers/DashEffect.h +33 -0
- package/cpp/third_party/tgfx/src/layers/DisplayList.cpp +1250 -0
- package/cpp/third_party/tgfx/src/layers/DrawArgs.h +76 -0
- package/cpp/third_party/tgfx/src/layers/ImageLayer.cpp +50 -0
- package/cpp/third_party/tgfx/src/layers/Layer.cpp +2257 -0
- package/cpp/third_party/tgfx/src/layers/LayerProperty.cpp +62 -0
- package/cpp/third_party/tgfx/src/layers/LayerRecorder.cpp +405 -0
- package/cpp/third_party/tgfx/src/layers/LayerStyleSource.h +102 -0
- package/cpp/third_party/tgfx/src/layers/MaskContext.cpp +225 -0
- package/cpp/third_party/tgfx/src/layers/MaskContext.h +104 -0
- package/cpp/third_party/tgfx/src/layers/MeshLayer.cpp +88 -0
- package/cpp/third_party/tgfx/src/layers/NoiseDensityUtils.cpp +88 -0
- package/cpp/third_party/tgfx/src/layers/NoiseDensityUtils.h +47 -0
- package/cpp/third_party/tgfx/src/layers/OffscreenRenderer.cpp +265 -0
- package/cpp/third_party/tgfx/src/layers/OffscreenRenderer.h +78 -0
- package/cpp/third_party/tgfx/src/layers/OpaqueContext.cpp +477 -0
- package/cpp/third_party/tgfx/src/layers/OpaqueContext.h +176 -0
- package/cpp/third_party/tgfx/src/layers/OpaqueThreshold.h +23 -0
- package/cpp/third_party/tgfx/src/layers/RegionTransformer.cpp +234 -0
- package/cpp/third_party/tgfx/src/layers/RegionTransformer.h +109 -0
- package/cpp/third_party/tgfx/src/layers/RootLayer.cpp +117 -0
- package/cpp/third_party/tgfx/src/layers/RootLayer.h +91 -0
- package/cpp/third_party/tgfx/src/layers/ShapeLayer.cpp +275 -0
- package/cpp/third_party/tgfx/src/layers/ShapeStyle.cpp +37 -0
- package/cpp/third_party/tgfx/src/layers/SolidLayer.cpp +95 -0
- package/cpp/third_party/tgfx/src/layers/SpreadUtils.cpp +233 -0
- package/cpp/third_party/tgfx/src/layers/SpreadUtils.h +71 -0
- package/cpp/third_party/tgfx/src/layers/SubtreeCache.cpp +90 -0
- package/cpp/third_party/tgfx/src/layers/SubtreeCache.h +62 -0
- package/cpp/third_party/tgfx/src/layers/TextLayer.cpp +498 -0
- package/cpp/third_party/tgfx/src/layers/TileCache.cpp +120 -0
- package/cpp/third_party/tgfx/src/layers/TileCache.h +124 -0
- package/cpp/third_party/tgfx/src/layers/VectorLayer.cpp +159 -0
- package/cpp/third_party/tgfx/src/layers/compositing3d/BspTree.cpp +89 -0
- package/cpp/third_party/tgfx/src/layers/compositing3d/BspTree.h +112 -0
- package/cpp/third_party/tgfx/src/layers/compositing3d/Context3DCompositor.cpp +287 -0
- package/cpp/third_party/tgfx/src/layers/compositing3d/Context3DCompositor.h +121 -0
- package/cpp/third_party/tgfx/src/layers/compositing3d/DrawPolygon3D.cpp +269 -0
- package/cpp/third_party/tgfx/src/layers/compositing3d/DrawPolygon3D.h +158 -0
- package/cpp/third_party/tgfx/src/layers/compositing3d/Layer3DContext.cpp +85 -0
- package/cpp/third_party/tgfx/src/layers/compositing3d/Layer3DContext.h +110 -0
- package/cpp/third_party/tgfx/src/layers/compositing3d/Opaque3DContext.cpp +114 -0
- package/cpp/third_party/tgfx/src/layers/compositing3d/Opaque3DContext.h +55 -0
- package/cpp/third_party/tgfx/src/layers/compositing3d/Render3DContext.cpp +277 -0
- package/cpp/third_party/tgfx/src/layers/compositing3d/Render3DContext.h +87 -0
- package/cpp/third_party/tgfx/src/layers/contents/ComposeContent.cpp +109 -0
- package/cpp/third_party/tgfx/src/layers/contents/ComposeContent.h +57 -0
- package/cpp/third_party/tgfx/src/layers/contents/DrawContent.cpp +127 -0
- package/cpp/third_party/tgfx/src/layers/contents/DrawContent.h +70 -0
- package/cpp/third_party/tgfx/src/layers/contents/GeometryContent.h +44 -0
- package/cpp/third_party/tgfx/src/layers/contents/LayerContent.h +107 -0
- package/cpp/third_party/tgfx/src/layers/contents/MatrixContent.cpp +86 -0
- package/cpp/third_party/tgfx/src/layers/contents/MatrixContent.h +53 -0
- package/cpp/third_party/tgfx/src/layers/contents/MeshContent.cpp +48 -0
- package/cpp/third_party/tgfx/src/layers/contents/MeshContent.h +45 -0
- package/cpp/third_party/tgfx/src/layers/contents/PathContent.cpp +76 -0
- package/cpp/third_party/tgfx/src/layers/contents/PathContent.h +49 -0
- package/cpp/third_party/tgfx/src/layers/contents/RRectContent.cpp +66 -0
- package/cpp/third_party/tgfx/src/layers/contents/RRectContent.h +48 -0
- package/cpp/third_party/tgfx/src/layers/contents/RRectsContent.cpp +97 -0
- package/cpp/third_party/tgfx/src/layers/contents/RRectsContent.h +49 -0
- package/cpp/third_party/tgfx/src/layers/contents/RectContent.cpp +67 -0
- package/cpp/third_party/tgfx/src/layers/contents/RectContent.h +48 -0
- package/cpp/third_party/tgfx/src/layers/contents/RectsContent.cpp +94 -0
- package/cpp/third_party/tgfx/src/layers/contents/RectsContent.h +48 -0
- package/cpp/third_party/tgfx/src/layers/contents/ShapeContent.cpp +193 -0
- package/cpp/third_party/tgfx/src/layers/contents/ShapeContent.h +81 -0
- package/cpp/third_party/tgfx/src/layers/contents/TextContent.cpp +56 -0
- package/cpp/third_party/tgfx/src/layers/contents/TextContent.h +46 -0
- package/cpp/third_party/tgfx/src/layers/filters/BlendFilter.cpp +51 -0
- package/cpp/third_party/tgfx/src/layers/filters/BlurFilter.cpp +60 -0
- package/cpp/third_party/tgfx/src/layers/filters/ColorMatrixFilter.cpp +43 -0
- package/cpp/third_party/tgfx/src/layers/filters/DropShadowFilter.cpp +92 -0
- package/cpp/third_party/tgfx/src/layers/filters/InnerShadowFilter.cpp +93 -0
- package/cpp/third_party/tgfx/src/layers/filters/LayerFilter.cpp +43 -0
- package/cpp/third_party/tgfx/src/layers/filters/LayerImageFilter.cpp +56 -0
- package/cpp/third_party/tgfx/src/layers/filters/NoiseFilter.cpp +356 -0
- package/cpp/third_party/tgfx/src/layers/imagefilters/GlassRefractionImageFilter.cpp +81 -0
- package/cpp/third_party/tgfx/src/layers/imagefilters/GlassRefractionImageFilter.h +48 -0
- package/cpp/third_party/tgfx/src/layers/layerstyles/BackgroundBlurStyle.cpp +103 -0
- package/cpp/third_party/tgfx/src/layers/layerstyles/DropShadowStyle.cpp +180 -0
- package/cpp/third_party/tgfx/src/layers/layerstyles/GlassStyle.cpp +413 -0
- package/cpp/third_party/tgfx/src/layers/layerstyles/InnerShadowStyle.cpp +219 -0
- package/cpp/third_party/tgfx/src/layers/layerstyles/LayerStyle.cpp +42 -0
- package/cpp/third_party/tgfx/src/layers/layerstyles/NoiseStyle.cpp +280 -0
- package/cpp/third_party/tgfx/src/layers/layerstyles/StyledShape.cpp +51 -0
- package/cpp/third_party/tgfx/src/layers/processors/GLSLGlassRefractionFragmentProcessor.cpp +282 -0
- package/cpp/third_party/tgfx/src/layers/processors/GLSLGlassRefractionFragmentProcessor.h +39 -0
- package/cpp/third_party/tgfx/src/layers/processors/GLSLTentBlur1DFragmentProcessor.cpp +134 -0
- package/cpp/third_party/tgfx/src/layers/processors/GLSLTentBlur1DFragmentProcessor.h +37 -0
- package/cpp/third_party/tgfx/src/layers/processors/GlassRefractionFragmentProcessor.cpp +78 -0
- package/cpp/third_party/tgfx/src/layers/processors/GlassRefractionFragmentProcessor.h +94 -0
- package/cpp/third_party/tgfx/src/layers/processors/TentBlur1DFragmentProcessor.cpp +37 -0
- package/cpp/third_party/tgfx/src/layers/processors/TentBlur1DFragmentProcessor.h +54 -0
- package/cpp/third_party/tgfx/src/layers/vectors/Ellipse.cpp +81 -0
- package/cpp/third_party/tgfx/src/layers/vectors/FillStyle.cpp +173 -0
- package/cpp/third_party/tgfx/src/layers/vectors/Geometry.cpp +304 -0
- package/cpp/third_party/tgfx/src/layers/vectors/Geometry.h +142 -0
- package/cpp/third_party/tgfx/src/layers/vectors/Gradient.cpp +196 -0
- package/cpp/third_party/tgfx/src/layers/vectors/ImagePattern.cpp +147 -0
- package/cpp/third_party/tgfx/src/layers/vectors/MergePath.cpp +78 -0
- package/cpp/third_party/tgfx/src/layers/vectors/Painter.cpp +112 -0
- package/cpp/third_party/tgfx/src/layers/vectors/Painter.h +158 -0
- package/cpp/third_party/tgfx/src/layers/vectors/Polystar.cpp +285 -0
- package/cpp/third_party/tgfx/src/layers/vectors/Rectangle.cpp +101 -0
- package/cpp/third_party/tgfx/src/layers/vectors/Repeater.cpp +174 -0
- package/cpp/third_party/tgfx/src/layers/vectors/RoundCorner.cpp +56 -0
- package/cpp/third_party/tgfx/src/layers/vectors/ShapePath.cpp +68 -0
- package/cpp/third_party/tgfx/src/layers/vectors/SolidColor.cpp +37 -0
- package/cpp/third_party/tgfx/src/layers/vectors/StrokeStyle.cpp +260 -0
- package/cpp/third_party/tgfx/src/layers/vectors/Text.cpp +77 -0
- package/cpp/third_party/tgfx/src/layers/vectors/TextModifier.cpp +256 -0
- package/cpp/third_party/tgfx/src/layers/vectors/TextPath.cpp +258 -0
- package/cpp/third_party/tgfx/src/layers/vectors/TextSelector.cpp +493 -0
- package/cpp/third_party/tgfx/src/layers/vectors/TrimPath.cpp +194 -0
- package/cpp/third_party/tgfx/src/layers/vectors/VectorContext.cpp +80 -0
- package/cpp/third_party/tgfx/src/layers/vectors/VectorContext.h +73 -0
- package/cpp/third_party/tgfx/src/layers/vectors/VectorElement.cpp +31 -0
- package/cpp/third_party/tgfx/src/layers/vectors/VectorGroup.cpp +188 -0
- package/cpp/third_party/tgfx/src/pdf/DeflateStream.cpp +133 -0
- package/cpp/third_party/tgfx/src/pdf/DeflateStream.h +42 -0
- package/cpp/third_party/tgfx/src/pdf/PDFBitmap.cpp +414 -0
- package/cpp/third_party/tgfx/src/pdf/PDFBitmap.h +39 -0
- package/cpp/third_party/tgfx/src/pdf/PDFDocumentImpl.cpp +517 -0
- package/cpp/third_party/tgfx/src/pdf/PDFDocumentImpl.h +208 -0
- package/cpp/third_party/tgfx/src/pdf/PDFExportContext.cpp +1490 -0
- package/cpp/third_party/tgfx/src/pdf/PDFExportContext.h +188 -0
- package/cpp/third_party/tgfx/src/pdf/PDFFont.cpp +582 -0
- package/cpp/third_party/tgfx/src/pdf/PDFFont.h +183 -0
- package/cpp/third_party/tgfx/src/pdf/PDFFormXObject.cpp +54 -0
- package/cpp/third_party/tgfx/src/pdf/PDFFormXObject.h +33 -0
- package/cpp/third_party/tgfx/src/pdf/PDFGlyphUse.h +89 -0
- package/cpp/third_party/tgfx/src/pdf/PDFGradientShader.cpp +1009 -0
- package/cpp/third_party/tgfx/src/pdf/PDFGradientShader.h +44 -0
- package/cpp/third_party/tgfx/src/pdf/PDFGraphicStackState.cpp +175 -0
- package/cpp/third_party/tgfx/src/pdf/PDFGraphicStackState.h +65 -0
- package/cpp/third_party/tgfx/src/pdf/PDFGraphicState.cpp +91 -0
- package/cpp/third_party/tgfx/src/pdf/PDFGraphicState.h +75 -0
- package/cpp/third_party/tgfx/src/pdf/PDFMetadata.cpp +109 -0
- package/cpp/third_party/tgfx/src/pdf/PDFMetadataUtils.cpp +334 -0
- package/cpp/third_party/tgfx/src/pdf/PDFMetadataUtils.h +39 -0
- package/cpp/third_party/tgfx/src/pdf/PDFResourceDictionary.cpp +83 -0
- package/cpp/third_party/tgfx/src/pdf/PDFResourceDictionary.h +42 -0
- package/cpp/third_party/tgfx/src/pdf/PDFShader.cpp +392 -0
- package/cpp/third_party/tgfx/src/pdf/PDFShader.h +46 -0
- package/cpp/third_party/tgfx/src/pdf/PDFTag.cpp +441 -0
- package/cpp/third_party/tgfx/src/pdf/PDFTag.h +158 -0
- package/cpp/third_party/tgfx/src/pdf/PDFTypes.cpp +351 -0
- package/cpp/third_party/tgfx/src/pdf/PDFTypes.h +174 -0
- package/cpp/third_party/tgfx/src/pdf/PDFUnion.cpp +324 -0
- package/cpp/third_party/tgfx/src/pdf/PDFUnion.h +104 -0
- package/cpp/third_party/tgfx/src/pdf/PDFUtils.cpp +437 -0
- package/cpp/third_party/tgfx/src/pdf/PDFUtils.h +100 -0
- package/cpp/third_party/tgfx/src/pdf/fontSubset/PDFMakeCIDGlyphWidthsArray.cpp +203 -0
- package/cpp/third_party/tgfx/src/pdf/fontSubset/PDFMakeCIDGlyphWidthsArray.h +36 -0
- package/cpp/third_party/tgfx/src/pdf/fontSubset/PDFMakeToUnicodeCmap.cpp +221 -0
- package/cpp/third_party/tgfx/src/pdf/fontSubset/PDFMakeToUnicodeCmap.h +32 -0
- package/cpp/third_party/tgfx/src/pdf/fontSubset/PDFSubsetFont.cpp +128 -0
- package/cpp/third_party/tgfx/src/pdf/fontSubset/PDFSubsetFont.h +30 -0
- package/cpp/third_party/tgfx/src/pdf/fontSubset/PDFType1Font.cpp +339 -0
- package/cpp/third_party/tgfx/src/pdf/fontSubset/PDFType1Font.h +28 -0
- package/cpp/third_party/tgfx/src/platform/ImageReader.cpp +124 -0
- package/cpp/third_party/tgfx/src/platform/ImageStream.h +78 -0
- package/cpp/third_party/tgfx/src/platform/Print.cpp +43 -0
- package/cpp/third_party/tgfx/src/platform/android/AHardwareBufferFunctions.cpp +55 -0
- package/cpp/third_party/tgfx/src/platform/android/AHardwareBufferFunctions.h +53 -0
- package/cpp/third_party/tgfx/src/platform/android/AndroidBitmap.cpp +133 -0
- package/cpp/third_party/tgfx/src/platform/android/GlyphRenderer.cpp +437 -0
- package/cpp/third_party/tgfx/src/platform/android/GlyphRenderer.h +92 -0
- package/cpp/third_party/tgfx/src/platform/android/HandlerThread.cpp +69 -0
- package/cpp/third_party/tgfx/src/platform/android/HandlerThread.h +43 -0
- package/cpp/third_party/tgfx/src/platform/android/HardwareBuffer.cpp +127 -0
- package/cpp/third_party/tgfx/src/platform/android/JNIEnvironment.cpp +94 -0
- package/cpp/third_party/tgfx/src/platform/android/JNIInit.cpp +49 -0
- package/cpp/third_party/tgfx/src/platform/android/JNIInit.h +26 -0
- package/cpp/third_party/tgfx/src/platform/android/JNIUtil.cpp +38 -0
- package/cpp/third_party/tgfx/src/platform/android/JNIUtil.h +32 -0
- package/cpp/third_party/tgfx/src/platform/android/NativeCodec.cpp +415 -0
- package/cpp/third_party/tgfx/src/platform/android/NativeCodec.h +52 -0
- package/cpp/third_party/tgfx/src/platform/android/NativeImageBuffer.cpp +70 -0
- package/cpp/third_party/tgfx/src/platform/android/NativeImageBuffer.h +59 -0
- package/cpp/third_party/tgfx/src/platform/android/Print.cpp +38 -0
- package/cpp/third_party/tgfx/src/platform/android/SurfaceTexture.cpp +309 -0
- package/cpp/third_party/tgfx/src/platform/android/SurfaceTexture.h +84 -0
- package/cpp/third_party/tgfx/src/platform/android/SurfaceTextureReader.cpp +71 -0
- package/cpp/third_party/tgfx/src/platform/apple/BitmapContextUtil.h +26 -0
- package/cpp/third_party/tgfx/src/platform/apple/BitmapContextUtil.mm +63 -0
- package/cpp/third_party/tgfx/src/platform/apple/CGColorSpaceUtil.h +29 -0
- package/cpp/third_party/tgfx/src/platform/apple/CGColorSpaceUtil.mm +46 -0
- package/cpp/third_party/tgfx/src/platform/apple/CTTypeface.mm +44 -0
- package/cpp/third_party/tgfx/src/platform/apple/HardwareBuffer.mm +102 -0
- package/cpp/third_party/tgfx/src/platform/apple/NativeCodec.h +43 -0
- package/cpp/third_party/tgfx/src/platform/apple/NativeCodec.mm +197 -0
- package/cpp/third_party/tgfx/src/platform/mock/HardwareBuffer.cpp +47 -0
- package/cpp/third_party/tgfx/src/platform/mock/NativeCodec.cpp +33 -0
- package/cpp/third_party/tgfx/src/platform/ohos/HardwareBuffer.cpp +99 -0
- package/cpp/third_party/tgfx/src/platform/ohos/NativeCodec.cpp +230 -0
- package/cpp/third_party/tgfx/src/platform/ohos/NativeCodec.h +49 -0
- package/cpp/third_party/tgfx/src/platform/ohos/OHOSImageInfo.cpp +85 -0
- package/cpp/third_party/tgfx/src/platform/ohos/OHOSImageInfo.h +52 -0
- package/cpp/third_party/tgfx/src/platform/ohos/OHOSPixelMap.cpp +66 -0
- package/cpp/third_party/tgfx/src/platform/ohos/Print.cpp +45 -0
- package/cpp/third_party/tgfx/src/platform/web/HardwareBuffer.cpp +51 -0
- package/cpp/third_party/tgfx/src/platform/web/NativeCodec.cpp +113 -0
- package/cpp/third_party/tgfx/src/platform/web/NativeCodec.h +45 -0
- package/cpp/third_party/tgfx/src/platform/web/ReadPixelsFromCanvasImage.cpp +54 -0
- package/cpp/third_party/tgfx/src/platform/web/ReadPixelsFromCanvasImage.h +31 -0
- package/cpp/third_party/tgfx/src/platform/web/TGFXWasmBindings.cpp +79 -0
- package/cpp/third_party/tgfx/src/platform/web/TGFXWasmBindings.h +23 -0
- package/cpp/third_party/tgfx/src/platform/web/VideoElement.cpp +84 -0
- package/cpp/third_party/tgfx/src/platform/web/VideoElement.h +51 -0
- package/cpp/third_party/tgfx/src/platform/web/VideoElementReader.cpp +42 -0
- package/cpp/third_party/tgfx/src/platform/web/WebAtlasUploadTask.cpp +67 -0
- package/cpp/third_party/tgfx/src/platform/web/WebAtlasUploadTask.h +31 -0
- package/cpp/third_party/tgfx/src/platform/web/WebGlyphRasterizer.cpp +47 -0
- package/cpp/third_party/tgfx/src/platform/web/WebGlyphRasterizer.h +35 -0
- package/cpp/third_party/tgfx/src/platform/web/WebImageBuffer.cpp +185 -0
- package/cpp/third_party/tgfx/src/platform/web/WebImageBuffer.h +85 -0
- package/cpp/third_party/tgfx/src/platform/web/WebImageInfo.cpp +134 -0
- package/cpp/third_party/tgfx/src/platform/web/WebImageInfo.h +33 -0
- package/cpp/third_party/tgfx/src/platform/web/WebPathRasterizer.cpp +108 -0
- package/cpp/third_party/tgfx/src/platform/web/WebPathRasterizer.h +35 -0
- package/cpp/third_party/tgfx/src/platform/web/WebScalerContext.cpp +118 -0
- package/cpp/third_party/tgfx/src/platform/web/WebScalerContext.h +62 -0
- package/cpp/third_party/tgfx/src/platform/web/WebTypeface.cpp +146 -0
- package/cpp/third_party/tgfx/src/platform/web/WebTypeface.h +97 -0
- package/cpp/third_party/tgfx/src/platform/win/D3D11Defines.h +129 -0
- package/cpp/third_party/tgfx/src/platform/win/D3D11Util.cpp +69 -0
- package/cpp/third_party/tgfx/src/platform/win/D3D11Util.h +47 -0
- package/cpp/third_party/tgfx/src/platform/win/HardwareBuffer.cpp +215 -0
- package/cpp/third_party/tgfx/src/platform/win/NativeCodec.cpp +351 -0
- package/cpp/third_party/tgfx/src/platform/win/NativeCodec.h +47 -0
- package/cpp/third_party/tgfx/src/svg/ElementWriter.cpp +1569 -0
- package/cpp/third_party/tgfx/src/svg/ElementWriter.h +199 -0
- package/cpp/third_party/tgfx/src/svg/ResourceStore.h +82 -0
- package/cpp/third_party/tgfx/src/svg/SVGAttribute.cpp +63 -0
- package/cpp/third_party/tgfx/src/svg/SVGAttributeParser.cpp +1293 -0
- package/cpp/third_party/tgfx/src/svg/SVGAttributeParser.h +182 -0
- package/cpp/third_party/tgfx/src/svg/SVGDOM.cpp +126 -0
- package/cpp/third_party/tgfx/src/svg/SVGExportContext.cpp +894 -0
- package/cpp/third_party/tgfx/src/svg/SVGExportContext.h +169 -0
- package/cpp/third_party/tgfx/src/svg/SVGExporter.cpp +76 -0
- package/cpp/third_party/tgfx/src/svg/SVGFilterContext.cpp +132 -0
- package/cpp/third_party/tgfx/src/svg/SVGFilterContext.h +86 -0
- package/cpp/third_party/tgfx/src/svg/SVGLengthContext.cpp +124 -0
- package/cpp/third_party/tgfx/src/svg/SVGNodeConstructor.cpp +490 -0
- package/cpp/third_party/tgfx/src/svg/SVGNodeConstructor.h +94 -0
- package/cpp/third_party/tgfx/src/svg/SVGParseColor.cpp +363 -0
- package/cpp/third_party/tgfx/src/svg/SVGPathParser.cpp +292 -0
- package/cpp/third_party/tgfx/src/svg/SVGRenderContext.cpp +505 -0
- package/cpp/third_party/tgfx/src/svg/SVGRenderContext.h +250 -0
- package/cpp/third_party/tgfx/src/svg/SVGTextBuilder.cpp +112 -0
- package/cpp/third_party/tgfx/src/svg/SVGTextBuilder.h +43 -0
- package/cpp/third_party/tgfx/src/svg/SVGUtils.cpp +508 -0
- package/cpp/third_party/tgfx/src/svg/SVGUtils.h +89 -0
- package/cpp/third_party/tgfx/src/svg/TextShaper.cpp +119 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGCircle.cpp +86 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGClipPath.cpp +47 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGContainer.cpp +74 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGEllipse.cpp +79 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFe.cpp +145 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeBlend.cpp +55 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeColorMatrix.cpp +159 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeComponentTransfer.cpp +140 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeComposite.cpp +78 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeDisplacementMap.cpp +64 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeGaussianBlur.cpp +54 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeImage.cpp +36 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeLightSource.cpp +50 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeLighting.cpp +60 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeMerge.cpp +53 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeMorphology.cpp +60 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeOffset.cpp +37 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFeTurbulence.cpp +100 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGFilter.cpp +219 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGGradient.cpp +117 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGImage.cpp +126 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGLine.cpp +82 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGLinearGradient.cpp +56 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGMask.cpp +80 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGNode.cpp +201 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGPath.cpp +84 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGPattern.cpp +161 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGPoly.cpp +83 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGRadialGradient.cpp +63 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGRect.cpp +104 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGRoot.cpp +133 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGShape.cpp +59 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGStop.cpp +31 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGText.cpp +190 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGTransformableNode.cpp +71 -0
- package/cpp/third_party/tgfx/src/svg/node/SVGUse.cpp +90 -0
- package/cpp/third_party/tgfx/src/svg/xml/DOMParser.cpp +107 -0
- package/cpp/third_party/tgfx/src/svg/xml/DOMParser.h +62 -0
- package/cpp/third_party/tgfx/src/svg/xml/XMLDOM.cpp +156 -0
- package/cpp/third_party/tgfx/src/svg/xml/XMLParser.cpp +187 -0
- package/cpp/third_party/tgfx/src/svg/xml/XMLParser.h +59 -0
- package/cpp/third_party/tgfx/src/svg/xml/XMLWriter.cpp +289 -0
- package/cpp/third_party/tgfx/src/svg/xml/XMLWriter.h +132 -0
- package/cpp/third_party/tgfx/vendor.json +434 -0
- package/ios/HybridTgfxView.swift +95 -0
- package/ios/TgfxMetalView.h +42 -0
- package/ios/TgfxMetalView.mm +267 -0
- package/ios/libs/libtgfx.xcframework/Info.plist +43 -0
- package/ios/libs/libtgfx.xcframework/ios-arm64/libtgfx-ios.a +0 -0
- package/ios/libs/libtgfx.xcframework/ios-arm64-simulator/libtgfx-ios.a +0 -0
- package/lib/compiler/colors.d.ts +26 -0
- package/lib/compiler/colors.js +364 -0
- package/lib/compiler/compile.d.ts +17 -0
- package/lib/compiler/compile.js +474 -0
- package/lib/compiler/filters.d.ts +43 -0
- package/lib/compiler/filters.js +98 -0
- package/lib/compiler/image.d.ts +31 -0
- package/lib/compiler/image.js +71 -0
- package/lib/compiler/paint.d.ts +65 -0
- package/lib/compiler/paint.js +207 -0
- package/lib/compiler/sksl.d.ts +10 -0
- package/lib/compiler/sksl.js +180 -0
- package/lib/compiler/text.d.ts +37 -0
- package/lib/compiler/text.js +77 -0
- package/lib/compiler/transform.d.ts +34 -0
- package/lib/compiler/transform.js +11 -0
- package/lib/compiler/values.d.ts +22 -0
- package/lib/compiler/values.js +22 -0
- package/lib/compiler/writer.d.ts +70 -0
- package/lib/compiler/writer.js +142 -0
- package/lib/components/Canvas.d.ts +10 -0
- package/lib/components/Canvas.js +139 -0
- package/lib/components/Group.d.ts +7 -0
- package/lib/components/Group.js +6 -0
- package/lib/components/Paint.d.ts +45 -0
- package/lib/components/Paint.js +44 -0
- package/lib/components/drawings.d.ts +56 -0
- package/lib/components/drawings.js +55 -0
- package/lib/hooks/source.d.ts +18 -0
- package/lib/hooks/source.js +47 -0
- package/lib/hooks/useCameraFrame.d.ts +94 -0
- package/lib/hooks/useCameraFrame.js +139 -0
- package/lib/hooks/useClock.d.ts +13 -0
- package/lib/hooks/useClock.js +27 -0
- package/lib/hooks/useFonts.d.ts +81 -0
- package/lib/hooks/useFonts.js +117 -0
- package/lib/hooks/useImage.d.ts +70 -0
- package/lib/hooks/useImage.js +116 -0
- package/lib/imperative.d.ts +59 -0
- package/lib/imperative.js +582 -0
- package/lib/index.d.ts +17 -0
- package/lib/index.js +11 -0
- package/lib/reanimated/AnimationDriver.d.ts +9 -0
- package/lib/reanimated/AnimationDriver.js +24 -0
- package/lib/reanimated/liveValue.d.ts +28 -0
- package/lib/reanimated/liveValue.js +44 -0
- package/lib/reanimated/moduleNotFound.d.ts +2 -0
- package/lib/reanimated/moduleNotFound.js +13 -0
- package/lib/reanimated/peer.d.ts +40 -0
- package/lib/reanimated/peer.js +55 -0
- package/lib/reanimated/slotFlags.d.ts +16 -0
- package/lib/reanimated/slotFlags.js +50 -0
- package/lib/reconciler/Container.d.ts +24 -0
- package/lib/reconciler/Container.js +56 -0
- package/lib/reconciler/Reconciler.d.ts +14 -0
- package/lib/reconciler/Reconciler.js +159 -0
- package/lib/reconciler/directNodes.d.ts +19 -0
- package/lib/reconciler/directNodes.js +68 -0
- package/lib/reconciler/types.d.ts +43 -0
- package/lib/reconciler/types.js +38 -0
- package/lib/specs/TgfxFonts.nitro.d.ts +92 -0
- package/lib/specs/TgfxFonts.nitro.js +1 -0
- package/lib/specs/TgfxImage.nitro.d.ts +85 -0
- package/lib/specs/TgfxImage.nitro.js +1 -0
- package/lib/specs/TgfxSlots.nitro.d.ts +44 -0
- package/lib/specs/TgfxSlots.nitro.js +1 -0
- package/lib/specs/TgfxView.nitro.d.ts +98 -0
- package/lib/specs/TgfxView.nitro.js +1 -0
- package/lib/types.d.ts +399 -0
- package/lib/types.js +1 -0
- package/lib/views/TgfxNativeView.d.ts +9 -0
- package/lib/views/TgfxNativeView.js +8 -0
- package/nitro.json +48 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroTgfx+autolinking.cmake +88 -0
- package/nitrogen/generated/android/NitroTgfx+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroTgfxOnLoad.cpp +86 -0
- package/nitrogen/generated/android/NitroTgfxOnLoad.hpp +34 -0
- package/nitrogen/generated/android/c++/JHybridTgfxViewSpec.cpp +135 -0
- package/nitrogen/generated/android/c++/JHybridTgfxViewSpec.hpp +70 -0
- package/nitrogen/generated/android/c++/JNativeSnapshot.hpp +71 -0
- package/nitrogen/generated/android/c++/JNativeSnapshotOptions.hpp +81 -0
- package/nitrogen/generated/android/c++/views/JHybridTgfxViewStateUpdater.cpp +60 -0
- package/nitrogen/generated/android/c++/views/JHybridTgfxViewStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/tgfx/HybridTgfxViewSpec.kt +83 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/tgfx/NativeSnapshot.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/tgfx/NativeSnapshotOptions.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/tgfx/NitroTgfxOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/tgfx/views/HybridTgfxViewManager.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/tgfx/views/HybridTgfxViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/NitroTgfx+autolinking.rb +62 -0
- package/nitrogen/generated/ios/NitroTgfx-Swift-Cxx-Bridge.cpp +57 -0
- package/nitrogen/generated/ios/NitroTgfx-Swift-Cxx-Bridge.hpp +193 -0
- package/nitrogen/generated/ios/NitroTgfx-Swift-Cxx-Umbrella.hpp +53 -0
- package/nitrogen/generated/ios/NitroTgfxAutolinking.mm +63 -0
- package/nitrogen/generated/ios/NitroTgfxAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridTgfxViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridTgfxViewSpecSwift.hpp +130 -0
- package/nitrogen/generated/ios/c++/views/HybridTgfxViewComponent.mm +127 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_NativeSnapshot.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridTgfxViewSpec.swift +60 -0
- package/nitrogen/generated/ios/swift/HybridTgfxViewSpec_cxx.swift +238 -0
- package/nitrogen/generated/ios/swift/NativeSnapshot.swift +44 -0
- package/nitrogen/generated/ios/swift/NativeSnapshotOptions.swift +59 -0
- package/nitrogen/generated/shared/c++/HybridTgfxFontsSpec.cpp +27 -0
- package/nitrogen/generated/shared/c++/HybridTgfxFontsSpec.hpp +75 -0
- package/nitrogen/generated/shared/c++/HybridTgfxImageFactorySpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridTgfxImageFactorySpec.hpp +74 -0
- package/nitrogen/generated/shared/c++/HybridTgfxImageSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridTgfxImageSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/HybridTgfxSlotsFactorySpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridTgfxSlotsFactorySpec.hpp +64 -0
- package/nitrogen/generated/shared/c++/HybridTgfxSlotsSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridTgfxSlotsSpec.hpp +62 -0
- package/nitrogen/generated/shared/c++/HybridTgfxViewSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridTgfxViewSpec.hpp +77 -0
- package/nitrogen/generated/shared/c++/LineMeasurement.hpp +107 -0
- package/nitrogen/generated/shared/c++/NativeSnapshot.hpp +96 -0
- package/nitrogen/generated/shared/c++/NativeSnapshotOptions.hpp +107 -0
- package/nitrogen/generated/shared/c++/PixelFormat.hpp +100 -0
- package/nitrogen/generated/shared/c++/TextLayoutStyle.hpp +119 -0
- package/nitrogen/generated/shared/c++/TextMeasurement.hpp +105 -0
- package/nitrogen/generated/shared/c++/views/HybridTgfxViewComponent.cpp +94 -0
- package/nitrogen/generated/shared/c++/views/HybridTgfxViewComponent.hpp +111 -0
- package/nitrogen/generated/shared/json/TgfxViewConfig.json +11 -0
- package/package.json +144 -8
- package/react-native.config.js +16 -0
- package/scripts/build-tgfx-ios.sh +60 -0
- package/src/compiler/colors.test.ts +195 -0
- package/src/compiler/colors.ts +402 -0
- package/src/compiler/compile.test.ts +971 -0
- package/src/compiler/compile.ts +565 -0
- package/src/compiler/filters.ts +140 -0
- package/src/compiler/image.ts +109 -0
- package/src/compiler/paint.ts +321 -0
- package/src/compiler/sceneHash.test.ts +70 -0
- package/src/compiler/sksl.test.ts +219 -0
- package/src/compiler/sksl.ts +218 -0
- package/src/compiler/stringTable.test.ts +136 -0
- package/src/compiler/svgPath.test.ts +147 -0
- package/src/compiler/text.ts +97 -0
- package/src/compiler/transform.ts +34 -0
- package/src/compiler/values.ts +44 -0
- package/src/compiler/writer.ts +159 -0
- package/src/components/Canvas.test.tsx +735 -0
- package/src/components/Canvas.tsx +199 -0
- package/src/components/Group.ts +9 -0
- package/src/components/Paint.ts +77 -0
- package/src/components/drawings.ts +86 -0
- package/src/hooks/source.ts +64 -0
- package/src/hooks/useCameraFrame.test.tsx +286 -0
- package/src/hooks/useCameraFrame.ts +222 -0
- package/src/hooks/useClock.test.ts +50 -0
- package/src/hooks/useClock.ts +36 -0
- package/src/hooks/useFonts.test.tsx +186 -0
- package/src/hooks/useFonts.ts +163 -0
- package/src/hooks/useImage.test.tsx +236 -0
- package/src/hooks/useImage.ts +143 -0
- package/src/imperative.ts +697 -0
- package/src/index.ts +125 -0
- package/src/reanimated/AnimationDriver.test.ts +12 -0
- package/src/reanimated/AnimationDriver.tsx +34 -0
- package/src/reanimated/liveValue.ts +53 -0
- package/src/reanimated/moduleNotFound.test.ts +54 -0
- package/src/reanimated/moduleNotFound.ts +16 -0
- package/src/reanimated/peer.ts +92 -0
- package/src/reanimated/slotFlags.ts +73 -0
- package/src/reconciler/Container.ts +78 -0
- package/src/reconciler/Reconciler.test.ts +28 -0
- package/src/reconciler/Reconciler.ts +210 -0
- package/src/reconciler/directNodes.test.tsx +150 -0
- package/src/reconciler/directNodes.ts +73 -0
- package/src/reconciler/types.ts +51 -0
- package/src/specs/TgfxFonts.nitro.ts +102 -0
- package/src/specs/TgfxImage.nitro.ts +106 -0
- package/src/specs/TgfxSlots.nitro.ts +46 -0
- package/src/specs/TgfxView.nitro.ts +112 -0
- package/src/testing/cppHarness.ts +116 -0
- package/src/testing/nativeMocks.ts +21 -0
- package/src/types.ts +441 -0
- package/src/views/TgfxNativeView.ts +15 -0
- package/src/views/idleGate.test.ts +58 -0
|
@@ -0,0 +1,1569 @@
|
|
|
1
|
+
/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
//
|
|
3
|
+
// Tencent is pleased to support the open source community by making tgfx available.
|
|
4
|
+
//
|
|
5
|
+
// Copyright (C) 2024 Tencent. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
|
|
8
|
+
// in compliance with the License. You may obtain a copy of the License at
|
|
9
|
+
//
|
|
10
|
+
// https://opensource.org/licenses/BSD-3-Clause
|
|
11
|
+
//
|
|
12
|
+
// unless required by applicable law or agreed to in writing, software distributed under the
|
|
13
|
+
// license is distributed on an "as is" basis, without warranties or conditions of any kind,
|
|
14
|
+
// either express or implied. see the license for the specific language governing permissions
|
|
15
|
+
// and limitations under the license.
|
|
16
|
+
//
|
|
17
|
+
/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
18
|
+
|
|
19
|
+
#include "ElementWriter.h"
|
|
20
|
+
#include "SVGExportContext.h"
|
|
21
|
+
#include "SVGUtils.h"
|
|
22
|
+
#include "core/codecs/jpeg/JpegCodec.h"
|
|
23
|
+
#include "core/codecs/png/PngCodec.h"
|
|
24
|
+
#include "core/filters/AlphaThresholdColorFilter.h"
|
|
25
|
+
#include "core/filters/ComposeColorFilter.h"
|
|
26
|
+
#include "core/filters/ComposeImageFilter.h"
|
|
27
|
+
#include "core/filters/GaussianBlurImageFilter.h"
|
|
28
|
+
#include "core/filters/LumaColorFilter.h"
|
|
29
|
+
#include "core/filters/ShaderMaskFilter.h"
|
|
30
|
+
#include "core/shaders/ColorFilterShader.h"
|
|
31
|
+
#include "core/shaders/MatrixShader.h"
|
|
32
|
+
#include "core/shaders/PerlinNoiseShader.h"
|
|
33
|
+
#include "core/utils/ColorHelper.h"
|
|
34
|
+
#include "core/utils/ColorSpaceHelper.h"
|
|
35
|
+
#include "core/utils/Log.h"
|
|
36
|
+
#include "core/utils/MathExtra.h"
|
|
37
|
+
#include "core/utils/Types.h"
|
|
38
|
+
#include "tgfx/core/BlendMode.h"
|
|
39
|
+
#include "tgfx/core/GradientType.h"
|
|
40
|
+
#include "tgfx/core/Matrix.h"
|
|
41
|
+
#include "tgfx/core/Pixmap.h"
|
|
42
|
+
#include "tgfx/core/RRect.h"
|
|
43
|
+
#include "tgfx/core/Rect.h"
|
|
44
|
+
#include "tgfx/core/Shader.h"
|
|
45
|
+
#include "tgfx/core/Surface.h"
|
|
46
|
+
#include "tgfx/gpu/Context.h"
|
|
47
|
+
#include "tgfx/svg/SVGPathParser.h"
|
|
48
|
+
|
|
49
|
+
namespace tgfx {
|
|
50
|
+
|
|
51
|
+
Resources::Resources(const Color& color) {
|
|
52
|
+
colorValue = color;
|
|
53
|
+
paintColor = ToSVGColor(color);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
ElementWriter::ElementWriter(const std::string& name, XMLWriter* writer,
|
|
57
|
+
std::shared_ptr<ColorSpace> targetColorSpace,
|
|
58
|
+
std::shared_ptr<ColorSpace> assignColorSpace)
|
|
59
|
+
: writer(writer), _targetColorSpace(std::move(targetColorSpace)),
|
|
60
|
+
_assignColorSpace(std::move(assignColorSpace)) {
|
|
61
|
+
writer->startElement(name);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
ElementWriter::ElementWriter(const std::string& name, const std::unique_ptr<XMLWriter>& writer,
|
|
65
|
+
std::shared_ptr<ColorSpace> targetColorSpace,
|
|
66
|
+
std::shared_ptr<ColorSpace> assignColorSpace)
|
|
67
|
+
: ElementWriter(name, writer.get(), std::move(targetColorSpace), std::move(assignColorSpace)) {
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
ElementWriter::ElementWriter(const std::string& name, const std::unique_ptr<XMLWriter>& writer,
|
|
71
|
+
ResourceStore* bucket, std::shared_ptr<ColorSpace> targetColorSpace,
|
|
72
|
+
std::shared_ptr<ColorSpace> assignColorSpace)
|
|
73
|
+
: writer(writer.get()), resourceStore(bucket), _targetColorSpace(std::move(targetColorSpace)),
|
|
74
|
+
_assignColorSpace(std::move(assignColorSpace)) {
|
|
75
|
+
writer->startElement(name);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
ElementWriter::ElementWriter(const std::string& name, Context* context,
|
|
79
|
+
SVGExportContext* svgContext, XMLWriter* writer, ResourceStore* bucket,
|
|
80
|
+
bool disableWarning, const Matrix& matrix, const Brush& brush,
|
|
81
|
+
const Stroke* stroke, std::shared_ptr<ColorSpace> targetColorSpace,
|
|
82
|
+
std::shared_ptr<ColorSpace> assignColorSpace)
|
|
83
|
+
: writer(writer), resourceStore(bucket), disableWarning(disableWarning),
|
|
84
|
+
_targetColorSpace(std::move(targetColorSpace)),
|
|
85
|
+
_assignColorSpace(std::move(assignColorSpace)) {
|
|
86
|
+
generateWriteColorSpaceString();
|
|
87
|
+
Resources resource = addResources(brush, context, svgContext);
|
|
88
|
+
|
|
89
|
+
writer->startElement(name);
|
|
90
|
+
|
|
91
|
+
addFillAndStroke(brush, stroke, resource);
|
|
92
|
+
|
|
93
|
+
if (!matrix.isIdentity()) {
|
|
94
|
+
addAttribute("transform", ToSVGTransform(matrix));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
ElementWriter::~ElementWriter() {
|
|
99
|
+
writer->endElement();
|
|
100
|
+
resourceStore = nullptr;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
void ElementWriter::reportUnsupportedElement(const char* message) const {
|
|
104
|
+
if (!disableWarning) {
|
|
105
|
+
LOGE("[SVG exporting]:%s", message);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
bool ElementWriter::writeColorCSSStyleAttribute(const std::string& attributeName, Color color,
|
|
110
|
+
std::string* retString) {
|
|
111
|
+
if (_writeColorSpaceString.empty()) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
*retString += attributeName + ":" + ToSVGColor(color) + ";" + attributeName + ":color(" +
|
|
115
|
+
_writeColorSpaceString + " " + FloatToString(color.red) + " " +
|
|
116
|
+
FloatToString(color.green) + " " + FloatToString(color.blue) + ");";
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
void ElementWriter::generateWriteColorSpaceString() {
|
|
121
|
+
static std::shared_ptr<ColorSpace> srgb = ColorSpace::SRGB();
|
|
122
|
+
static std::shared_ptr<ColorSpace> displayP3 = ColorSpace::DisplayP3();
|
|
123
|
+
static std::shared_ptr<ColorSpace> a98rgb =
|
|
124
|
+
ColorSpace::MakeRGB(NamedTransferFunction::A98RGB, NamedGamut::AdobeRGB);
|
|
125
|
+
static std::shared_ptr<ColorSpace> rec2020 =
|
|
126
|
+
ColorSpace::MakeRGB(NamedTransferFunction::Rec2020, NamedGamut::Rec2020);
|
|
127
|
+
ColorMatrix33 matrix{};
|
|
128
|
+
NamedPrimaries::ProPhotoRGB.toXYZD50(&matrix);
|
|
129
|
+
static std::shared_ptr<ColorSpace> prophoto =
|
|
130
|
+
ColorSpace::MakeRGB(NamedTransferFunction::ProPhotoRGB, matrix);
|
|
131
|
+
auto tempColorSpace = _assignColorSpace ? _assignColorSpace : _targetColorSpace;
|
|
132
|
+
if (ColorSpace::Equals(tempColorSpace.get(), displayP3.get())) {
|
|
133
|
+
_writeColorSpaceString = "display-p3";
|
|
134
|
+
} else if (ColorSpace::Equals(tempColorSpace.get(), a98rgb.get())) {
|
|
135
|
+
_writeColorSpaceString = "a98-rgb";
|
|
136
|
+
} else if (ColorSpace::Equals(tempColorSpace.get(), rec2020.get())) {
|
|
137
|
+
_writeColorSpaceString = "rec2020";
|
|
138
|
+
} else {
|
|
139
|
+
_writeColorSpaceString = std::string{};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
void ElementWriter::addFillAndStroke(const Brush& brush, const Stroke* stroke,
|
|
144
|
+
const Resources& resources) {
|
|
145
|
+
if (!stroke) { //fill draw
|
|
146
|
+
static const std::string defaultFill = "black";
|
|
147
|
+
if (resources.paintColor != defaultFill) {
|
|
148
|
+
addAttribute("fill", resources.paintColor);
|
|
149
|
+
}
|
|
150
|
+
if (!brush.isOpaque()) {
|
|
151
|
+
addAttribute("fill-opacity", brush.color.alpha);
|
|
152
|
+
}
|
|
153
|
+
} else { //stroke draw
|
|
154
|
+
addAttribute("fill", "none");
|
|
155
|
+
|
|
156
|
+
addAttribute("stroke", resources.paintColor);
|
|
157
|
+
|
|
158
|
+
float strokeWidth = stroke->width;
|
|
159
|
+
if (strokeWidth == 0) {
|
|
160
|
+
// Hairline stroke
|
|
161
|
+
strokeWidth = 1;
|
|
162
|
+
addAttribute("vector-effect", "non-scaling-stroke");
|
|
163
|
+
}
|
|
164
|
+
addAttribute("stroke-width", strokeWidth);
|
|
165
|
+
|
|
166
|
+
auto cap = ToSVGCap(stroke->cap);
|
|
167
|
+
if (!cap.empty()) {
|
|
168
|
+
addAttribute("stroke-linecap", cap);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
auto join = ToSVGJoin(stroke->join);
|
|
172
|
+
if (!join.empty()) {
|
|
173
|
+
addAttribute("stroke-linejoin", join);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (stroke->join == LineJoin::Miter && !FloatNearlyEqual(stroke->miterLimit, 4.f)) {
|
|
177
|
+
addAttribute("stroke-miterlimit", stroke->miterLimit);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (!brush.isOpaque()) {
|
|
181
|
+
addAttribute("stroke-opacity", brush.color.alpha);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
std::string cssStyle;
|
|
185
|
+
if (resources.paintColor.find("url") == std::string::npos) {
|
|
186
|
+
writeColorCSSStyleAttribute(stroke ? "stroke" : "fill", resources.colorValue, &cssStyle);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (brush.blendMode != BlendMode::SrcOver) {
|
|
190
|
+
auto blendModeString = ToSVGBlendMode(brush.blendMode);
|
|
191
|
+
if (!blendModeString.empty()) {
|
|
192
|
+
blendModeString = "mix-blend-mode:" + blendModeString;
|
|
193
|
+
cssStyle += blendModeString + ";";
|
|
194
|
+
} else {
|
|
195
|
+
reportUnsupportedElement("Unsupported blend mode");
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (!cssStyle.empty()) {
|
|
199
|
+
addAttribute("style", cssStyle);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (!resources.filter.empty()) {
|
|
203
|
+
addAttribute("filter", resources.filter);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (!resources.mask.empty()) {
|
|
207
|
+
addAttribute("mask", resources.mask);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
void ElementWriter::addAttribute(const std::string& name, const std::string& val) {
|
|
212
|
+
writer->addAttribute(name, val);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
void ElementWriter::addAttribute(const std::string& name, int32_t val) {
|
|
216
|
+
writer->addS32Attribute(name, val);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
void ElementWriter::addAttribute(const std::string& name, float val) {
|
|
220
|
+
writer->addScalarAttribute(name, val);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
void ElementWriter::addText(const std::string& text) {
|
|
224
|
+
writer->addText(text);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
void ElementWriter::addFontAttributes(const Font& font) {
|
|
228
|
+
addAttribute("font-size", font.getSize());
|
|
229
|
+
|
|
230
|
+
auto typeface = font.getTypeface();
|
|
231
|
+
if (typeface == nullptr) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
auto familyName = typeface->fontFamily();
|
|
235
|
+
if (!familyName.empty()) {
|
|
236
|
+
addAttribute("font-family", familyName);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (font.isFauxItalic()) {
|
|
240
|
+
addAttribute("font-style", "italic");
|
|
241
|
+
}
|
|
242
|
+
if (font.isFauxBold()) {
|
|
243
|
+
addAttribute("font-weight", "bold");
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
void ElementWriter::addRectAttributes(const Rect& rect) {
|
|
248
|
+
// x, y default to 0
|
|
249
|
+
if (rect.x() != 0) {
|
|
250
|
+
addAttribute("x", rect.x());
|
|
251
|
+
}
|
|
252
|
+
if (rect.y() != 0) {
|
|
253
|
+
addAttribute("y", rect.y());
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
addAttribute("width", rect.width());
|
|
257
|
+
addAttribute("height", rect.height());
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
void ElementWriter::addRoundRectAttributes(const RRect& roundRect) {
|
|
261
|
+
// SVG <rect> only supports uniform rx/ry; complex RRects must be emitted as <path>.
|
|
262
|
+
DEBUG_ASSERT(!roundRect.isComplex());
|
|
263
|
+
addRectAttributes(roundRect.rect());
|
|
264
|
+
if (FloatNearlyZero(roundRect.radii()[0].x) && FloatNearlyZero(roundRect.radii()[0].y)) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
addAttribute("rx", roundRect.radii()[0].x);
|
|
268
|
+
addAttribute("ry", roundRect.radii()[0].y);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
void ElementWriter::addCircleAttributes(const Rect& bound) {
|
|
272
|
+
addAttribute("cx", bound.centerX());
|
|
273
|
+
addAttribute("cy", bound.centerY());
|
|
274
|
+
addAttribute("r", bound.width() * 0.5f);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
void ElementWriter::addEllipseAttributes(const Rect& bound) {
|
|
278
|
+
addAttribute("cx", bound.centerX());
|
|
279
|
+
addAttribute("cy", bound.centerY());
|
|
280
|
+
addAttribute("rx", bound.width() * 0.5f);
|
|
281
|
+
addAttribute("ry", bound.height() * 0.5f);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
void ElementWriter::addPathAttributes(const Path& path, SVGPathParser::PathEncoding encoding) {
|
|
285
|
+
addAttribute("d", SVGPathParser::ToSVGString(path, encoding));
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
Resources ElementWriter::addColorFilterResource(const std::shared_ptr<ColorFilter>& colorFilter) {
|
|
289
|
+
Resources resources;
|
|
290
|
+
if (!colorFilter) {
|
|
291
|
+
return resources;
|
|
292
|
+
}
|
|
293
|
+
auto type = Types::Get(colorFilter.get());
|
|
294
|
+
if (type == Types::ColorFilterType::Blend || type == Types::ColorFilterType::Matrix ||
|
|
295
|
+
type == Types::ColorFilterType::Compose || type == Types::ColorFilterType::Luma ||
|
|
296
|
+
type == Types::ColorFilterType::AlphaThreshold) {
|
|
297
|
+
std::string filterID = resourceStore->addFilter();
|
|
298
|
+
{
|
|
299
|
+
ElementWriter filterElement("filter", writer);
|
|
300
|
+
filterElement.addAttribute("id", filterID);
|
|
301
|
+
filterElement.addAttribute("color-interpolation-filters", "sRGB");
|
|
302
|
+
filterElement.addAttribute("x", "0%");
|
|
303
|
+
filterElement.addAttribute("y", "0%");
|
|
304
|
+
filterElement.addAttribute("width", "100%");
|
|
305
|
+
filterElement.addAttribute("height", "100%");
|
|
306
|
+
addColorFilterPrimitives(colorFilter);
|
|
307
|
+
}
|
|
308
|
+
resources.filter = "url(#" + filterID + ")";
|
|
309
|
+
}
|
|
310
|
+
return resources;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
bool ElementWriter::writeFilterPrimitives(const std::shared_ptr<ImageFilter>& imageFilter,
|
|
314
|
+
ElementWriter& filterElement,
|
|
315
|
+
const std::shared_ptr<SVGCustomWriter>& exportWriter,
|
|
316
|
+
const Rect& bound, Context* context,
|
|
317
|
+
bool preserveSoftAlpha) {
|
|
318
|
+
auto type = Types::Get(imageFilter.get());
|
|
319
|
+
switch (type) {
|
|
320
|
+
case Types::ImageFilterType::Blur: {
|
|
321
|
+
const auto blurFilter = static_cast<const GaussianBlurImageFilter*>(imageFilter.get());
|
|
322
|
+
callbackBlurImageFilter(blurFilter, exportWriter, filterElement);
|
|
323
|
+
addBlurImageFilter(blurFilter);
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
case Types::ImageFilterType::DropShadow: {
|
|
327
|
+
const auto dropShadowFilter = static_cast<const DropShadowImageFilter*>(imageFilter.get());
|
|
328
|
+
callbackDropShadowImageFilter(dropShadowFilter, exportWriter, filterElement);
|
|
329
|
+
addDropShadowImageFilter(dropShadowFilter, "", preserveSoftAlpha);
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
case Types::ImageFilterType::InnerShadow: {
|
|
333
|
+
const auto innerShadowFilter = static_cast<const InnerShadowImageFilter*>(imageFilter.get());
|
|
334
|
+
callbackInnerShadowImageFilter(innerShadowFilter, exportWriter, filterElement);
|
|
335
|
+
addInnerShadowImageFilter(innerShadowFilter, "", preserveSoftAlpha);
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
case Types::ImageFilterType::Color: {
|
|
339
|
+
const auto colorFilter = static_cast<const ColorImageFilter*>(imageFilter.get());
|
|
340
|
+
addColorImageFilter(colorFilter);
|
|
341
|
+
break;
|
|
342
|
+
}
|
|
343
|
+
case Types::ImageFilterType::Blend: {
|
|
344
|
+
const auto blendFilter = static_cast<const BlendImageFilter*>(imageFilter.get());
|
|
345
|
+
addBlendImageFilter(blendFilter, "", &bound, context);
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
default:
|
|
349
|
+
reportUnsupportedElement("Unsupported image filter");
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
std::string ElementWriter::emitFilterElement(const std::shared_ptr<ImageFilter>& imageFilter,
|
|
356
|
+
const Rect& bound,
|
|
357
|
+
const std::shared_ptr<SVGCustomWriter>& exportWriter,
|
|
358
|
+
Context* context, bool preserveSoftAlpha) {
|
|
359
|
+
std::string filterID = resourceStore->addFilter();
|
|
360
|
+
ElementWriter filterElement("filter", writer);
|
|
361
|
+
filterElement.addAttribute("id", filterID);
|
|
362
|
+
filterElement.addAttribute("color-interpolation-filters", "sRGB");
|
|
363
|
+
auto type = Types::Get(imageFilter.get());
|
|
364
|
+
// InnerShadow needs extra space for the shadow offset since filterBounds() does not expand.
|
|
365
|
+
float extraWidth = 0;
|
|
366
|
+
float extraHeight = 0;
|
|
367
|
+
if (type == Types::ImageFilterType::InnerShadow) {
|
|
368
|
+
const auto innerShadowFilter = static_cast<const InnerShadowImageFilter*>(imageFilter.get());
|
|
369
|
+
extraWidth = innerShadowFilter->dx;
|
|
370
|
+
extraHeight = innerShadowFilter->dy;
|
|
371
|
+
}
|
|
372
|
+
filterElement.addAttribute("x", bound.x());
|
|
373
|
+
filterElement.addAttribute("y", bound.y());
|
|
374
|
+
filterElement.addAttribute("width", bound.width() + extraWidth);
|
|
375
|
+
filterElement.addAttribute("height", bound.height() + extraHeight);
|
|
376
|
+
filterElement.addAttribute("filterUnits", "userSpaceOnUse");
|
|
377
|
+
if (!writeFilterPrimitives(imageFilter, filterElement, exportWriter, bound, context,
|
|
378
|
+
preserveSoftAlpha)) {
|
|
379
|
+
return "";
|
|
380
|
+
}
|
|
381
|
+
return filterID;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
std::string ElementWriter::addImageFilter(const std::shared_ptr<ImageFilter>& imageFilter,
|
|
385
|
+
const Rect& bound,
|
|
386
|
+
const std::shared_ptr<SVGCustomWriter>& exportWriter,
|
|
387
|
+
Context* context) {
|
|
388
|
+
auto filteredBound = imageFilter->filterBounds(bound);
|
|
389
|
+
return emitFilterElement(imageFilter, filteredBound, exportWriter, context, false);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
std::vector<std::string> ElementWriter::addImageFilterChain(
|
|
393
|
+
const std::shared_ptr<ImageFilter>& imageFilter, const Rect& bound,
|
|
394
|
+
const std::shared_ptr<SVGCustomWriter>& exportWriter, Context* context) {
|
|
395
|
+
if (!imageFilter) {
|
|
396
|
+
return {};
|
|
397
|
+
}
|
|
398
|
+
auto type = Types::Get(imageFilter.get());
|
|
399
|
+
if (type == Types::ImageFilterType::Compose) {
|
|
400
|
+
const auto composeFilter = static_cast<const ComposeImageFilter*>(imageFilter.get());
|
|
401
|
+
// GPU pipeline: each sub-filter receives the previous sub-filter's full output as its source.
|
|
402
|
+
// In SVG, nested <g filter="..."> achieves exactly this: each layer's SourceGraphic/SourceAlpha
|
|
403
|
+
// is the output of the inner layer's filter. This matches the GPU's serial FilterImage chain.
|
|
404
|
+
auto composeBound = imageFilter->filterBounds(bound);
|
|
405
|
+
std::vector<std::string> filterIDs;
|
|
406
|
+
for (const auto& filterItem : composeFilter->filters) {
|
|
407
|
+
filterIDs.push_back(emitFilterElement(filterItem, composeBound, exportWriter, context, true));
|
|
408
|
+
}
|
|
409
|
+
return filterIDs;
|
|
410
|
+
}
|
|
411
|
+
auto id = addImageFilter(imageFilter, bound, exportWriter, context);
|
|
412
|
+
if (!id.empty()) {
|
|
413
|
+
return {id};
|
|
414
|
+
}
|
|
415
|
+
return {};
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
void ElementWriter::callbackBlurImageFilter(const GaussianBlurImageFilter* filter,
|
|
419
|
+
const std::shared_ptr<SVGCustomWriter>& exportWriter,
|
|
420
|
+
ElementWriter& filterElement) {
|
|
421
|
+
if (!exportWriter) {
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
auto attribute = exportWriter->writeBlurImageFilter(filter->blurrinessX, filter->blurrinessY,
|
|
425
|
+
filter->tileMode);
|
|
426
|
+
if (!attribute.name.empty() && !attribute.value.empty()) {
|
|
427
|
+
filterElement.addAttribute(attribute.name, attribute.value);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
void ElementWriter::callbackDropShadowImageFilter(
|
|
432
|
+
const DropShadowImageFilter* filter, const std::shared_ptr<SVGCustomWriter>& exportWriter,
|
|
433
|
+
ElementWriter& filterElement) {
|
|
434
|
+
if (!exportWriter) {
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
float blurrinessX = 0.f;
|
|
438
|
+
float blurrinessY = 0.f;
|
|
439
|
+
if (filter->blurFilter) {
|
|
440
|
+
if (Types::Get(filter->blurFilter.get()) == Types::ImageFilterType::Blur) {
|
|
441
|
+
const auto blurFilter = static_cast<const GaussianBlurImageFilter*>(filter->blurFilter.get());
|
|
442
|
+
blurrinessX = blurFilter->blurrinessX;
|
|
443
|
+
blurrinessY = blurFilter->blurrinessY;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
auto attribute = exportWriter->writeDropShadowImageFilter(
|
|
447
|
+
filter->dx, filter->dy, blurrinessX, blurrinessY, filter->color, filter->shadowOnly);
|
|
448
|
+
if (!attribute.name.empty() && !attribute.value.empty()) {
|
|
449
|
+
filterElement.addAttribute(attribute.name, attribute.value);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
void ElementWriter::callbackInnerShadowImageFilter(
|
|
454
|
+
const InnerShadowImageFilter* filter, const std::shared_ptr<SVGCustomWriter>& exportWriter,
|
|
455
|
+
ElementWriter& filterElement) {
|
|
456
|
+
if (!exportWriter) {
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
float blurrinessX = 0.f;
|
|
460
|
+
float blurrinessY = 0.f;
|
|
461
|
+
if (filter->blurFilter) {
|
|
462
|
+
if (Types::Get(filter->blurFilter.get()) == Types::ImageFilterType::Blur) {
|
|
463
|
+
const auto blurFilter = static_cast<const GaussianBlurImageFilter*>(filter->blurFilter.get());
|
|
464
|
+
blurrinessX = blurFilter->blurrinessX;
|
|
465
|
+
blurrinessY = blurFilter->blurrinessY;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
auto attribute = exportWriter->writeInnerShadowImageFilter(
|
|
469
|
+
filter->dx, filter->dy, blurrinessX, blurrinessY, filter->color, filter->shadowOnly);
|
|
470
|
+
if (!attribute.name.empty() && !attribute.value.empty()) {
|
|
471
|
+
filterElement.addAttribute(attribute.name, attribute.value);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
void ElementWriter::addBlurImageFilter(const GaussianBlurImageFilter* filter,
|
|
476
|
+
const std::string& inputResult) {
|
|
477
|
+
ElementWriter blurElement("feGaussianBlur", writer);
|
|
478
|
+
if (!inputResult.empty()) {
|
|
479
|
+
blurElement.addAttribute("in", inputResult);
|
|
480
|
+
}
|
|
481
|
+
if (FloatNearlyEqual(filter->blurrinessX, filter->blurrinessY)) {
|
|
482
|
+
blurElement.addAttribute("stdDeviation", filter->blurrinessX);
|
|
483
|
+
} else {
|
|
484
|
+
blurElement.addAttribute("stdDeviation", FloatToString(filter->blurrinessX) + " " +
|
|
485
|
+
FloatToString(filter->blurrinessY));
|
|
486
|
+
}
|
|
487
|
+
blurElement.addAttribute("result", "blur");
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
void ElementWriter::addHardAlphaElement() {
|
|
491
|
+
ElementWriter colorMatrixElement("feColorMatrix", writer);
|
|
492
|
+
colorMatrixElement.addAttribute("in", "SourceAlpha");
|
|
493
|
+
colorMatrixElement.addAttribute("type", "matrix");
|
|
494
|
+
colorMatrixElement.addAttribute("values", "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0");
|
|
495
|
+
colorMatrixElement.addAttribute("result", "hardAlpha");
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
void ElementWriter::addSoftAlphaElement() {
|
|
499
|
+
ElementWriter colorMatrixElement("feColorMatrix", writer);
|
|
500
|
+
colorMatrixElement.addAttribute("in", "SourceAlpha");
|
|
501
|
+
colorMatrixElement.addAttribute("type", "matrix");
|
|
502
|
+
// Match the GPU pipeline: preserve the source's soft alpha instead of hardening blurred edges.
|
|
503
|
+
colorMatrixElement.addAttribute("values", "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0");
|
|
504
|
+
colorMatrixElement.addAttribute("result", "softAlpha");
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
void ElementWriter::addDropShadowImageFilter(const DropShadowImageFilter* filter,
|
|
508
|
+
const std::string& inputResult,
|
|
509
|
+
bool preserveSoftAlpha) {
|
|
510
|
+
const auto alphaResult = preserveSoftAlpha ? "softAlpha" : "hardAlpha";
|
|
511
|
+
if (preserveSoftAlpha) {
|
|
512
|
+
addSoftAlphaElement();
|
|
513
|
+
} else {
|
|
514
|
+
addHardAlphaElement();
|
|
515
|
+
}
|
|
516
|
+
{
|
|
517
|
+
ElementWriter offsetElement("feOffset", writer);
|
|
518
|
+
offsetElement.addAttribute("dx", filter->dx);
|
|
519
|
+
offsetElement.addAttribute("dy", filter->dy);
|
|
520
|
+
}
|
|
521
|
+
{
|
|
522
|
+
ElementWriter blurElement("feGaussianBlur", writer);
|
|
523
|
+
float blurX = 0.f;
|
|
524
|
+
float blurY = 0.f;
|
|
525
|
+
if (filter->blurFilter &&
|
|
526
|
+
Types::Get(filter->blurFilter.get()) == Types::ImageFilterType::Blur) {
|
|
527
|
+
const auto blurFilter = static_cast<const GaussianBlurImageFilter*>(filter->blurFilter.get());
|
|
528
|
+
blurX = blurFilter->blurrinessX;
|
|
529
|
+
blurY = blurFilter->blurrinessY;
|
|
530
|
+
}
|
|
531
|
+
if (FloatNearlyEqual(blurX, blurY)) {
|
|
532
|
+
blurElement.addAttribute("stdDeviation", blurX);
|
|
533
|
+
} else {
|
|
534
|
+
blurElement.addAttribute("stdDeviation", FloatToString(blurX) + " " + FloatToString(blurY));
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
if (!filter->shadowOnly) {
|
|
538
|
+
ElementWriter compositeElement("feComposite", writer);
|
|
539
|
+
compositeElement.addAttribute("in2", alphaResult);
|
|
540
|
+
compositeElement.addAttribute("operator", "out");
|
|
541
|
+
}
|
|
542
|
+
{
|
|
543
|
+
ElementWriter colorMatrixElement("feColorMatrix", writer);
|
|
544
|
+
colorMatrixElement.addAttribute("type", "matrix");
|
|
545
|
+
auto color = filter->color;
|
|
546
|
+
color = ConvertColorSpace(color, _targetColorSpace);
|
|
547
|
+
colorMatrixElement.addAttribute("values", "0 0 0 0 " + FloatToString(color.red) + " 0 0 0 0 " +
|
|
548
|
+
FloatToString(color.green) + " 0 0 0 0 " +
|
|
549
|
+
FloatToString(color.blue) + " 0 0 0 " +
|
|
550
|
+
FloatToString(color.alpha) + " 0");
|
|
551
|
+
colorMatrixElement.addAttribute("result", "shadow");
|
|
552
|
+
}
|
|
553
|
+
if (!filter->shadowOnly) {
|
|
554
|
+
auto sourceRef = inputResult.empty() ? "SourceGraphic" : inputResult;
|
|
555
|
+
ElementWriter blendElement("feBlend", writer);
|
|
556
|
+
blendElement.addAttribute("mode", "normal");
|
|
557
|
+
blendElement.addAttribute("in", sourceRef);
|
|
558
|
+
blendElement.addAttribute("in2", "shadow");
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
void ElementWriter::addInnerShadowImageFilter(const InnerShadowImageFilter* filter,
|
|
562
|
+
const std::string& inputResult,
|
|
563
|
+
bool preserveSoftAlpha) {
|
|
564
|
+
if (!filter->blurFilter) {
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
const auto alphaResult = preserveSoftAlpha ? "softAlpha" : "hardAlpha";
|
|
568
|
+
if (preserveSoftAlpha) {
|
|
569
|
+
addSoftAlphaElement();
|
|
570
|
+
} else {
|
|
571
|
+
addHardAlphaElement();
|
|
572
|
+
}
|
|
573
|
+
auto sourceRef = inputResult.empty() ? std::string("SourceGraphic") : inputResult;
|
|
574
|
+
if (!filter->shadowOnly) {
|
|
575
|
+
{
|
|
576
|
+
ElementWriter floodElement("feFlood", writer);
|
|
577
|
+
floodElement.addAttribute("flood-opacity", "0");
|
|
578
|
+
floodElement.addAttribute("result", "BackgroundImageFix");
|
|
579
|
+
}
|
|
580
|
+
{
|
|
581
|
+
ElementWriter blendElement("feBlend", writer);
|
|
582
|
+
blendElement.addAttribute("mode", "normal");
|
|
583
|
+
blendElement.addAttribute("in", sourceRef);
|
|
584
|
+
blendElement.addAttribute("in2", "BackgroundImageFix");
|
|
585
|
+
blendElement.addAttribute("result", "shape");
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
{
|
|
589
|
+
ElementWriter offsetElement("feOffset", writer);
|
|
590
|
+
offsetElement.addAttribute("in", alphaResult);
|
|
591
|
+
offsetElement.addAttribute("dx", filter->dx);
|
|
592
|
+
offsetElement.addAttribute("dy", filter->dy);
|
|
593
|
+
offsetElement.addAttribute("result", "offsetAlpha");
|
|
594
|
+
}
|
|
595
|
+
{
|
|
596
|
+
ElementWriter blurElement("feGaussianBlur", writer);
|
|
597
|
+
blurElement.addAttribute("in", "offsetAlpha");
|
|
598
|
+
if (Types::Get(filter->blurFilter.get()) == Types::ImageFilterType::Blur) {
|
|
599
|
+
auto blurFilter = static_cast<const GaussianBlurImageFilter*>(filter->blurFilter.get());
|
|
600
|
+
if (FloatNearlyEqual(blurFilter->blurrinessX, blurFilter->blurrinessY)) {
|
|
601
|
+
blurElement.addAttribute("stdDeviation", blurFilter->blurrinessX);
|
|
602
|
+
} else {
|
|
603
|
+
blurElement.addAttribute("stdDeviation", FloatToString(blurFilter->blurrinessX) + " " +
|
|
604
|
+
FloatToString(blurFilter->blurrinessY));
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
blurElement.addAttribute("result", "blurredAlpha");
|
|
608
|
+
}
|
|
609
|
+
if (!preserveSoftAlpha) {
|
|
610
|
+
{
|
|
611
|
+
ElementWriter compositeElement("feComposite", writer);
|
|
612
|
+
compositeElement.addAttribute("in2", alphaResult);
|
|
613
|
+
compositeElement.addAttribute("operator", "arithmetic");
|
|
614
|
+
compositeElement.addAttribute("k2", "-1");
|
|
615
|
+
compositeElement.addAttribute("k3", "1");
|
|
616
|
+
}
|
|
617
|
+
{
|
|
618
|
+
ElementWriter colorMatrixElement("feColorMatrix", writer);
|
|
619
|
+
colorMatrixElement.addAttribute("type", "matrix");
|
|
620
|
+
auto color = ConvertColorSpace(filter->color, _targetColorSpace);
|
|
621
|
+
colorMatrixElement.addAttribute("values", "0 0 0 0 " + FloatToString(color.red) +
|
|
622
|
+
" 0 0 0 0 " + FloatToString(color.green) +
|
|
623
|
+
" 0 0 0 0 " + FloatToString(color.blue) +
|
|
624
|
+
" 0 0 0 " + FloatToString(color.alpha) + " 0");
|
|
625
|
+
}
|
|
626
|
+
if (!filter->shadowOnly) {
|
|
627
|
+
ElementWriter blendElement("feBlend", writer);
|
|
628
|
+
blendElement.addAttribute("mode", "normal");
|
|
629
|
+
blendElement.addAttribute("in2", "shape");
|
|
630
|
+
}
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
auto color = ConvertColorSpace(filter->color, _targetColorSpace);
|
|
635
|
+
{
|
|
636
|
+
ElementWriter floodElement("feFlood", writer);
|
|
637
|
+
floodElement.addAttribute("flood-color", ToSVGColor(color));
|
|
638
|
+
floodElement.addAttribute("flood-opacity", color.alpha);
|
|
639
|
+
floodElement.addAttribute("result", "shadowColor");
|
|
640
|
+
std::string cssStyle;
|
|
641
|
+
if (writeColorCSSStyleAttribute("flood-color", color, &cssStyle)) {
|
|
642
|
+
floodElement.addAttribute("style", cssStyle);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
{
|
|
646
|
+
// Match InnerShadowImageFilter::getShadowFragmentProcessor():
|
|
647
|
+
// colorShadow = SrcOut(shadowColor, blurredAlpha).
|
|
648
|
+
ElementWriter compositeElement("feComposite", writer);
|
|
649
|
+
compositeElement.addAttribute("in", "shadowColor");
|
|
650
|
+
compositeElement.addAttribute("in2", "blurredAlpha");
|
|
651
|
+
compositeElement.addAttribute("operator", "out");
|
|
652
|
+
compositeElement.addAttribute("result", "colorShadow");
|
|
653
|
+
}
|
|
654
|
+
if (filter->shadowOnly) {
|
|
655
|
+
ElementWriter compositeElement("feComposite", writer);
|
|
656
|
+
compositeElement.addAttribute("in", "colorShadow");
|
|
657
|
+
compositeElement.addAttribute("in2", "shape");
|
|
658
|
+
compositeElement.addAttribute("operator", "in");
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
{
|
|
662
|
+
// Match InnerShadowImageFilter::asFragmentProcessor():
|
|
663
|
+
// result = SrcATop(colorShadow, source).
|
|
664
|
+
ElementWriter shadowInsideElement("feComposite", writer);
|
|
665
|
+
shadowInsideElement.addAttribute("in", "colorShadow");
|
|
666
|
+
shadowInsideElement.addAttribute("in2", "shape");
|
|
667
|
+
shadowInsideElement.addAttribute("operator", "in");
|
|
668
|
+
shadowInsideElement.addAttribute("result", "shadowInside");
|
|
669
|
+
}
|
|
670
|
+
{
|
|
671
|
+
ElementWriter shapeOutsideElement("feComposite", writer);
|
|
672
|
+
shapeOutsideElement.addAttribute("in", "shape");
|
|
673
|
+
shapeOutsideElement.addAttribute("in2", "colorShadow");
|
|
674
|
+
shapeOutsideElement.addAttribute("operator", "out");
|
|
675
|
+
shapeOutsideElement.addAttribute("result", "shapeOutsideShadow");
|
|
676
|
+
}
|
|
677
|
+
{
|
|
678
|
+
ElementWriter mergeElement("feMerge", writer);
|
|
679
|
+
mergeElement.addAttribute("result", "innerShadowResult");
|
|
680
|
+
{
|
|
681
|
+
ElementWriter mergeNode("feMergeNode", writer);
|
|
682
|
+
mergeNode.addAttribute("in", "shapeOutsideShadow");
|
|
683
|
+
}
|
|
684
|
+
{
|
|
685
|
+
ElementWriter mergeNode("feMergeNode", writer);
|
|
686
|
+
mergeNode.addAttribute("in", "shadowInside");
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
void ElementWriter::addColorImageFilter(const ColorImageFilter* filter,
|
|
692
|
+
const std::string& inputResult) {
|
|
693
|
+
if (!filter->filter) {
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
if (!addColorFilterPrimitives(filter->filter, inputResult)) {
|
|
697
|
+
reportUnsupportedElement("Unsupported color filter in ColorImageFilter");
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
std::string ElementWriter::emitShaderAsPrimitive(const Shader* shader, const Matrix& shaderMatrix,
|
|
702
|
+
const Rect* filterBounds, Context* context) {
|
|
703
|
+
auto resultName = resourceStore->addFilterResult();
|
|
704
|
+
switch (Types::Get(shader)) {
|
|
705
|
+
case Types::ShaderType::Color: {
|
|
706
|
+
const auto colorShader = static_cast<const ColorShader*>(shader);
|
|
707
|
+
Color color;
|
|
708
|
+
if (!colorShader->asColor(&color)) {
|
|
709
|
+
return "";
|
|
710
|
+
}
|
|
711
|
+
color = ConvertColorSpace(color, _targetColorSpace);
|
|
712
|
+
ElementWriter floodElement("feFlood", writer);
|
|
713
|
+
floodElement.addAttribute("flood-color", ToSVGColor(color));
|
|
714
|
+
if (!color.isOpaque()) {
|
|
715
|
+
floodElement.addAttribute("flood-opacity", color.alpha);
|
|
716
|
+
}
|
|
717
|
+
floodElement.addAttribute("result", resultName);
|
|
718
|
+
std::string cssStyle;
|
|
719
|
+
if (writeColorCSSStyleAttribute("flood-color", color, &cssStyle)) {
|
|
720
|
+
floodElement.addAttribute("style", cssStyle);
|
|
721
|
+
}
|
|
722
|
+
return resultName;
|
|
723
|
+
}
|
|
724
|
+
case Types::ShaderType::PerlinNoise: {
|
|
725
|
+
addPerlinNoisePrimitives(shader, resultName);
|
|
726
|
+
return resultName;
|
|
727
|
+
}
|
|
728
|
+
case Types::ShaderType::Gradient: {
|
|
729
|
+
auto gradientShader = static_cast<const GradientShader*>(shader);
|
|
730
|
+
GradientInfo info;
|
|
731
|
+
GradientType gradientType = gradientShader->asGradient(&info);
|
|
732
|
+
std::string svgFragment = "<svg xmlns='http://www.w3.org/2000/svg'";
|
|
733
|
+
if (filterBounds) {
|
|
734
|
+
svgFragment += " width='" + FloatToString(filterBounds->width()) + "'";
|
|
735
|
+
svgFragment += " height='" + FloatToString(filterBounds->height()) + "'";
|
|
736
|
+
svgFragment += " viewBox='" + FloatToString(filterBounds->x()) + " " +
|
|
737
|
+
FloatToString(filterBounds->y()) + " " +
|
|
738
|
+
FloatToString(filterBounds->width()) + " " +
|
|
739
|
+
FloatToString(filterBounds->height()) + "'";
|
|
740
|
+
}
|
|
741
|
+
svgFragment += ">";
|
|
742
|
+
// Shader gradient coordinates are in local space (relative to the shape's top-left).
|
|
743
|
+
// Offset them by filterBounds origin to convert to the viewBox coordinate system.
|
|
744
|
+
float offsetX = filterBounds ? filterBounds->x() : 0;
|
|
745
|
+
float offsetY = filterBounds ? filterBounds->y() : 0;
|
|
746
|
+
if (gradientType == GradientType::Linear) {
|
|
747
|
+
svgFragment += "<defs><linearGradient id='g' gradientUnits='userSpaceOnUse'";
|
|
748
|
+
svgFragment += " x1='" + FloatToString(info.points[0].x + offsetX) + "'";
|
|
749
|
+
svgFragment += " y1='" + FloatToString(info.points[0].y + offsetY) + "'";
|
|
750
|
+
svgFragment += " x2='" + FloatToString(info.points[1].x + offsetX) + "'";
|
|
751
|
+
svgFragment += " y2='" + FloatToString(info.points[1].y + offsetY) + "'>";
|
|
752
|
+
} else if (gradientType == GradientType::Radial) {
|
|
753
|
+
svgFragment += "<defs><radialGradient id='g' gradientUnits='userSpaceOnUse'";
|
|
754
|
+
svgFragment += " cx='" + FloatToString(info.points[0].x + offsetX) + "'";
|
|
755
|
+
svgFragment += " cy='" + FloatToString(info.points[0].y + offsetY) + "'";
|
|
756
|
+
svgFragment += " r='" + FloatToString(info.radiuses[0]) + "'>";
|
|
757
|
+
} else {
|
|
758
|
+
reportUnsupportedElement("Unsupported gradient type in emitShaderAsPrimitive");
|
|
759
|
+
return "";
|
|
760
|
+
}
|
|
761
|
+
for (size_t i = 0; i < info.colors.size(); ++i) {
|
|
762
|
+
auto color = ConvertColorSpace(info.colors[i], _targetColorSpace);
|
|
763
|
+
svgFragment += "<stop offset='" + FloatToString(info.positions[i]) + "'";
|
|
764
|
+
svgFragment += " stop-color='" + ToSVGColor(color) + "'";
|
|
765
|
+
if (!color.isOpaque()) {
|
|
766
|
+
svgFragment += " stop-opacity='" + FloatToString(color.alpha) + "'";
|
|
767
|
+
}
|
|
768
|
+
svgFragment += "/>";
|
|
769
|
+
}
|
|
770
|
+
if (gradientType == GradientType::Linear) {
|
|
771
|
+
svgFragment += "</linearGradient></defs>";
|
|
772
|
+
} else {
|
|
773
|
+
svgFragment += "</radialGradient></defs>";
|
|
774
|
+
}
|
|
775
|
+
svgFragment += "<rect fill='url(#g)'";
|
|
776
|
+
if (filterBounds) {
|
|
777
|
+
svgFragment += " x='" + FloatToString(filterBounds->x()) + "'";
|
|
778
|
+
svgFragment += " y='" + FloatToString(filterBounds->y()) + "'";
|
|
779
|
+
svgFragment += " width='" + FloatToString(filterBounds->width()) + "'";
|
|
780
|
+
svgFragment += " height='" + FloatToString(filterBounds->height()) + "'";
|
|
781
|
+
}
|
|
782
|
+
svgFragment += "/></svg>";
|
|
783
|
+
auto svgData = reinterpret_cast<const unsigned char*>(svgFragment.data());
|
|
784
|
+
auto svgLength = svgFragment.size();
|
|
785
|
+
auto base64Length = ((svgLength + 2) / 3) * 4;
|
|
786
|
+
std::string base64String(base64Length, '\0');
|
|
787
|
+
Base64Encode(svgData, svgLength, base64String.data());
|
|
788
|
+
ElementWriter feImageElement("feImage", writer);
|
|
789
|
+
feImageElement.addAttribute("xlink:href", "data:image/svg+xml;base64," + base64String);
|
|
790
|
+
if (filterBounds) {
|
|
791
|
+
feImageElement.addAttribute("x", filterBounds->x());
|
|
792
|
+
feImageElement.addAttribute("y", filterBounds->y());
|
|
793
|
+
feImageElement.addAttribute("width", filterBounds->width());
|
|
794
|
+
feImageElement.addAttribute("height", filterBounds->height());
|
|
795
|
+
}
|
|
796
|
+
feImageElement.addAttribute("result", resultName);
|
|
797
|
+
return resultName;
|
|
798
|
+
}
|
|
799
|
+
case Types::ShaderType::Image: {
|
|
800
|
+
const auto imageShader = static_cast<const ImageShader*>(shader);
|
|
801
|
+
auto dataUri = SVGExportContext::EncodeImageToDataUri(imageShader->image, context);
|
|
802
|
+
if (!dataUri) {
|
|
803
|
+
return "";
|
|
804
|
+
}
|
|
805
|
+
ElementWriter imageElement("feImage", writer);
|
|
806
|
+
auto imgRect = Rect::MakeWH(static_cast<float>(imageShader->image->width()),
|
|
807
|
+
static_cast<float>(imageShader->image->height()));
|
|
808
|
+
auto mappedRect = shaderMatrix.mapRect(imgRect);
|
|
809
|
+
float offsetX = filterBounds ? filterBounds->x() : 0;
|
|
810
|
+
float offsetY = filterBounds ? filterBounds->y() : 0;
|
|
811
|
+
imageElement.addAttribute("x", mappedRect.x() + offsetX);
|
|
812
|
+
imageElement.addAttribute("y", mappedRect.y() + offsetY);
|
|
813
|
+
imageElement.addAttribute("width", mappedRect.width());
|
|
814
|
+
imageElement.addAttribute("height", mappedRect.height());
|
|
815
|
+
imageElement.addAttribute("preserveAspectRatio", "none");
|
|
816
|
+
imageElement.addAttribute("xlink:href", static_cast<const char*>(dataUri->data()));
|
|
817
|
+
imageElement.addAttribute("result", resultName);
|
|
818
|
+
return resultName;
|
|
819
|
+
}
|
|
820
|
+
default:
|
|
821
|
+
return "";
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
void ElementWriter::addBlendImageFilter(const BlendImageFilter* filter,
|
|
826
|
+
const std::string& inputResult, const Rect* filterBounds,
|
|
827
|
+
Context* context) {
|
|
828
|
+
if (!filter->shader) {
|
|
829
|
+
reportUnsupportedElement("Missing shader in BlendImageFilter");
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
832
|
+
auto sourceRef = inputResult.empty() ? std::string("SourceGraphic") : inputResult;
|
|
833
|
+
if (filter->blendMode == BlendMode::DstIn) {
|
|
834
|
+
if (Types::Get(filter->shader.get()) != Types::ShaderType::Image) {
|
|
835
|
+
reportUnsupportedElement("Unsupported DstIn shader type in BlendImageFilter");
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
const auto imageShader = static_cast<const ImageShader*>(filter->shader.get());
|
|
839
|
+
auto dataUri = SVGExportContext::EncodeImageToDataUri(imageShader->image, context);
|
|
840
|
+
if (!dataUri) {
|
|
841
|
+
reportUnsupportedElement("Failed to encode DstIn image shader in BlendImageFilter");
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
{
|
|
845
|
+
ElementWriter imageElement("feImage", writer);
|
|
846
|
+
if (filterBounds) {
|
|
847
|
+
imageElement.addAttribute("x", filterBounds->x());
|
|
848
|
+
imageElement.addAttribute("y", filterBounds->y());
|
|
849
|
+
}
|
|
850
|
+
imageElement.addAttribute("width", imageShader->image->width());
|
|
851
|
+
imageElement.addAttribute("height", imageShader->image->height());
|
|
852
|
+
imageElement.addAttribute("xlink:href", static_cast<const char*>(dataUri->data()));
|
|
853
|
+
imageElement.addAttribute("result", "blendMask");
|
|
854
|
+
}
|
|
855
|
+
{
|
|
856
|
+
ElementWriter compositeElement("feComposite", writer);
|
|
857
|
+
compositeElement.addAttribute("in", sourceRef);
|
|
858
|
+
compositeElement.addAttribute("in2", "blendMask");
|
|
859
|
+
compositeElement.addAttribute("operator", "in");
|
|
860
|
+
}
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
auto blendModeString = ToSVGBlendMode(filter->blendMode);
|
|
864
|
+
if (blendModeString.empty()) {
|
|
865
|
+
reportUnsupportedElement("Unsupported blend mode in BlendImageFilter");
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
// Unwrap MatrixShader to get the actual shader type and accumulated matrix.
|
|
869
|
+
const Shader* blendShader = filter->shader.get();
|
|
870
|
+
Matrix shaderMatrix = Matrix::I();
|
|
871
|
+
while (blendShader && Types::Get(blendShader) == Types::ShaderType::Matrix) {
|
|
872
|
+
auto matrixShader = static_cast<const MatrixShader*>(blendShader);
|
|
873
|
+
shaderMatrix = shaderMatrix * matrixShader->matrix;
|
|
874
|
+
blendShader = matrixShader->source.get();
|
|
875
|
+
}
|
|
876
|
+
auto shaderType = Types::Get(blendShader);
|
|
877
|
+
if (shaderType == Types::ShaderType::ColorFilter) {
|
|
878
|
+
auto colorFilterShader = static_cast<const ColorFilterShader*>(blendShader);
|
|
879
|
+
// Unwrap the inner shader's MatrixShader layer.
|
|
880
|
+
const Shader* innerShader = colorFilterShader->shader.get();
|
|
881
|
+
Matrix innerMatrix = shaderMatrix;
|
|
882
|
+
while (innerShader && Types::Get(innerShader) == Types::ShaderType::Matrix) {
|
|
883
|
+
auto ms = static_cast<const MatrixShader*>(innerShader);
|
|
884
|
+
innerMatrix = innerMatrix * ms->matrix;
|
|
885
|
+
innerShader = ms->source.get();
|
|
886
|
+
}
|
|
887
|
+
// Step 1: Emit inner shader as a filter primitive.
|
|
888
|
+
auto shaderResult = emitShaderAsPrimitive(innerShader, innerMatrix, filterBounds, context);
|
|
889
|
+
if (shaderResult.empty()) {
|
|
890
|
+
reportUnsupportedElement("Unsupported inner shader in ColorFilterShader BlendImageFilter");
|
|
891
|
+
return;
|
|
892
|
+
}
|
|
893
|
+
// Step 2: Apply the color filter on top of the inner shader output.
|
|
894
|
+
std::string finalResult = shaderResult;
|
|
895
|
+
if (colorFilterShader->colorFilter) {
|
|
896
|
+
auto cfResult = resourceStore->addFilterResult();
|
|
897
|
+
if (!addColorFilterPrimitives(colorFilterShader->colorFilter, shaderResult, cfResult)) {
|
|
898
|
+
reportUnsupportedElement("Unsupported color filter in ColorFilterShader BlendImageFilter");
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
finalResult = cfResult;
|
|
902
|
+
}
|
|
903
|
+
// Step 3: Blend the processed result with the source.
|
|
904
|
+
ElementWriter blendElement("feBlend", writer);
|
|
905
|
+
blendElement.addAttribute("in", finalResult);
|
|
906
|
+
blendElement.addAttribute("in2", sourceRef);
|
|
907
|
+
blendElement.addAttribute("mode", blendModeString);
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
// Color, PerlinNoise, Gradient, Image shaders share the same pattern:
|
|
911
|
+
// emit shader as filter primitive, then blend with source.
|
|
912
|
+
auto resultName = emitShaderAsPrimitive(blendShader, shaderMatrix, filterBounds, context);
|
|
913
|
+
if (resultName.empty()) {
|
|
914
|
+
reportUnsupportedElement("Unsupported shader type in BlendImageFilter");
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
ElementWriter blendElement("feBlend", writer);
|
|
918
|
+
blendElement.addAttribute("in", resultName);
|
|
919
|
+
blendElement.addAttribute("in2", sourceRef);
|
|
920
|
+
blendElement.addAttribute("mode", blendModeString);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
bool ElementWriter::addColorFilterPrimitives(const std::shared_ptr<ColorFilter>& colorFilter,
|
|
924
|
+
const std::string& inputResult,
|
|
925
|
+
const std::string& outputResult) {
|
|
926
|
+
if (!colorFilter) {
|
|
927
|
+
return false;
|
|
928
|
+
}
|
|
929
|
+
switch (Types::Get(colorFilter.get())) {
|
|
930
|
+
case Types::ColorFilterType::Matrix:
|
|
931
|
+
addMatrixColorFilterPrimitives(static_cast<const MatrixColorFilter*>(colorFilter.get()),
|
|
932
|
+
inputResult, outputResult);
|
|
933
|
+
return true;
|
|
934
|
+
case Types::ColorFilterType::Blend:
|
|
935
|
+
addBlendColorFilterPrimitives(static_cast<const ModeColorFilter*>(colorFilter.get()),
|
|
936
|
+
inputResult, outputResult);
|
|
937
|
+
return true;
|
|
938
|
+
case Types::ColorFilterType::Compose: {
|
|
939
|
+
const auto compose = static_cast<const ComposeColorFilter*>(colorFilter.get());
|
|
940
|
+
// Generate a unique result name to bridge inner's output to outer's input.
|
|
941
|
+
// Without this, outer's Blend path falls back to SourceGraphic instead of inner's output.
|
|
942
|
+
auto bridgeResult = resourceStore->addFilterResult();
|
|
943
|
+
if (!addColorFilterPrimitives(compose->inner, inputResult, bridgeResult)) {
|
|
944
|
+
return false;
|
|
945
|
+
}
|
|
946
|
+
return addColorFilterPrimitives(compose->outer, bridgeResult, outputResult);
|
|
947
|
+
}
|
|
948
|
+
case Types::ColorFilterType::Luma: {
|
|
949
|
+
// tgfx Luma outputs vec4(luma) where luma = dot(rgb, vec3(Kr, Kg, Kb)).
|
|
950
|
+
// All four channels (R, G, B, A) are set to the luminance value.
|
|
951
|
+
// Use a custom feColorMatrix to replicate: R'=G'=B'=A' = Kr*R + Kg*G + Kb*B.
|
|
952
|
+
ElementWriter colorMatrixElement("feColorMatrix", writer);
|
|
953
|
+
if (!inputResult.empty()) {
|
|
954
|
+
colorMatrixElement.addAttribute("in", inputResult);
|
|
955
|
+
}
|
|
956
|
+
colorMatrixElement.addAttribute("type", "matrix");
|
|
957
|
+
colorMatrixElement.addAttribute("values",
|
|
958
|
+
"0.2126 0.7152 0.0722 0 0 "
|
|
959
|
+
"0.2126 0.7152 0.0722 0 0 "
|
|
960
|
+
"0.2126 0.7152 0.0722 0 0 "
|
|
961
|
+
"0.2126 0.7152 0.0722 0 0");
|
|
962
|
+
if (!outputResult.empty()) {
|
|
963
|
+
colorMatrixElement.addAttribute("result", outputResult);
|
|
964
|
+
}
|
|
965
|
+
return true;
|
|
966
|
+
}
|
|
967
|
+
case Types::ColorFilterType::AlphaThreshold: {
|
|
968
|
+
const auto thresholdFilter = static_cast<const AlphaThresholdColorFilter*>(colorFilter.get());
|
|
969
|
+
float threshold = thresholdFilter->threshold;
|
|
970
|
+
ElementWriter transferElement("feComponentTransfer", writer);
|
|
971
|
+
if (!inputResult.empty()) {
|
|
972
|
+
transferElement.addAttribute("in", inputResult);
|
|
973
|
+
}
|
|
974
|
+
{
|
|
975
|
+
ElementWriter funcA("feFuncA", writer);
|
|
976
|
+
funcA.addAttribute("type", "discrete");
|
|
977
|
+
// Generate a 256-entry discrete table: values below threshold map to 0, at or above to 1.
|
|
978
|
+
int cutoff = FloatCeilToInt(threshold * 256.0f);
|
|
979
|
+
if (cutoff < 0) {
|
|
980
|
+
cutoff = 0;
|
|
981
|
+
}
|
|
982
|
+
if (cutoff > 256) {
|
|
983
|
+
cutoff = 256;
|
|
984
|
+
}
|
|
985
|
+
std::string tableValues;
|
|
986
|
+
for (int i = 0; i < 256; ++i) {
|
|
987
|
+
if (i > 0) {
|
|
988
|
+
tableValues += " ";
|
|
989
|
+
}
|
|
990
|
+
tableValues += (i < cutoff) ? "0" : "1";
|
|
991
|
+
}
|
|
992
|
+
funcA.addAttribute("tableValues", tableValues);
|
|
993
|
+
}
|
|
994
|
+
if (!outputResult.empty()) {
|
|
995
|
+
transferElement.addAttribute("result", outputResult);
|
|
996
|
+
}
|
|
997
|
+
return true;
|
|
998
|
+
}
|
|
999
|
+
default:
|
|
1000
|
+
return false;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
void ElementWriter::addMatrixColorFilterPrimitives(const MatrixColorFilter* matrixColorFilter,
|
|
1005
|
+
const std::string& inputResult,
|
|
1006
|
+
const std::string& outputResult) {
|
|
1007
|
+
ElementWriter colorMatrixElement("feColorMatrix", writer);
|
|
1008
|
+
if (!inputResult.empty()) {
|
|
1009
|
+
colorMatrixElement.addAttribute("in", inputResult);
|
|
1010
|
+
}
|
|
1011
|
+
colorMatrixElement.addAttribute("type", "matrix");
|
|
1012
|
+
auto colorMatrix = matrixColorFilter->matrix;
|
|
1013
|
+
std::string matrixString;
|
|
1014
|
+
for (uint32_t i = 0; i < colorMatrix.size(); i++) {
|
|
1015
|
+
matrixString += FloatToString(colorMatrix[i]);
|
|
1016
|
+
if (i != 19) {
|
|
1017
|
+
matrixString += " ";
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
colorMatrixElement.addAttribute("values", matrixString);
|
|
1021
|
+
if (!outputResult.empty()) {
|
|
1022
|
+
colorMatrixElement.addAttribute("result", outputResult);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
void ElementWriter::addBlendColorFilterPrimitives(const ModeColorFilter* modeColorFilter,
|
|
1027
|
+
const std::string& inputResult,
|
|
1028
|
+
const std::string& outputResult) {
|
|
1029
|
+
auto color = ConvertColorSpace(modeColorFilter->color, _targetColorSpace);
|
|
1030
|
+
// blendSource: the color data to blend against. In a Compose chain, this is inner's output.
|
|
1031
|
+
auto blendSource = inputResult.empty() ? std::string("SourceGraphic") : inputResult;
|
|
1032
|
+
|
|
1033
|
+
// SVG feBlend modes include Porter-Duff compositing terms (e.g. src*(1-dstA)), which causes
|
|
1034
|
+
// color leakage into transparent regions. For Multiply mode, use feColorMatrix instead — it
|
|
1035
|
+
// performs pure per-channel multiplication without compositing, matching the GPU pipeline.
|
|
1036
|
+
if (modeColorFilter->mode == BlendMode::Multiply) {
|
|
1037
|
+
ElementWriter colorMatrixElement("feColorMatrix", writer);
|
|
1038
|
+
if (!inputResult.empty()) {
|
|
1039
|
+
colorMatrixElement.addAttribute("in", inputResult);
|
|
1040
|
+
}
|
|
1041
|
+
colorMatrixElement.addAttribute("type", "matrix");
|
|
1042
|
+
colorMatrixElement.addAttribute("values", FloatToString(color.red) + " 0 0 0 0 0 " +
|
|
1043
|
+
FloatToString(color.green) + " 0 0 0 0 0 " +
|
|
1044
|
+
FloatToString(color.blue) + " 0 0 0 0 0 " +
|
|
1045
|
+
FloatToString(color.alpha) + " 0");
|
|
1046
|
+
if (!outputResult.empty()) {
|
|
1047
|
+
colorMatrixElement.addAttribute("result", outputResult);
|
|
1048
|
+
}
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
auto blendModeString = ToSVGBlendMode(modeColorFilter->mode);
|
|
1053
|
+
if (blendModeString.empty()) {
|
|
1054
|
+
reportUnsupportedElement("Unsupported blend mode in color filter");
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
{
|
|
1058
|
+
ElementWriter floodElement("feFlood", writer);
|
|
1059
|
+
floodElement.addAttribute("flood-color", ToSVGColor(color));
|
|
1060
|
+
floodElement.addAttribute("flood-opacity", color.alpha);
|
|
1061
|
+
floodElement.addAttribute("result", "flood");
|
|
1062
|
+
std::string cssStyle;
|
|
1063
|
+
if (writeColorCSSStyleAttribute("flood-color", color, &cssStyle)) {
|
|
1064
|
+
floodElement.addAttribute("style", cssStyle);
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
{
|
|
1068
|
+
ElementWriter blendElement("feBlend", writer);
|
|
1069
|
+
blendElement.addAttribute("in", "flood");
|
|
1070
|
+
blendElement.addAttribute("in2", blendSource);
|
|
1071
|
+
blendElement.addAttribute("mode", blendModeString);
|
|
1072
|
+
blendElement.addAttribute("result", "blend");
|
|
1073
|
+
}
|
|
1074
|
+
{
|
|
1075
|
+
// Always clip to SourceGraphic alpha (the original shape boundary), not inner's potentially
|
|
1076
|
+
// alpha-modified output. GPU's ModeColorFilter operates per-pixel without an extra alpha clip
|
|
1077
|
+
// from inner — the shape boundary itself provides the clip.
|
|
1078
|
+
ElementWriter compositeElement("feComposite", writer);
|
|
1079
|
+
compositeElement.addAttribute("in", "blend");
|
|
1080
|
+
compositeElement.addAttribute("in2", "SourceGraphic");
|
|
1081
|
+
compositeElement.addAttribute("operator", "in");
|
|
1082
|
+
if (!outputResult.empty()) {
|
|
1083
|
+
compositeElement.addAttribute("result", outputResult);
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
Resources ElementWriter::addResources(const Brush& brush, Context* context,
|
|
1089
|
+
SVGExportContext* svgContext) {
|
|
1090
|
+
auto color = ConvertColorSpace(brush.color, _targetColorSpace);
|
|
1091
|
+
Resources resources(color);
|
|
1092
|
+
|
|
1093
|
+
if (auto shader = brush.shader) {
|
|
1094
|
+
// Unwrap all Matrix and ColorFilter layers to find the leaf shader type.
|
|
1095
|
+
// Only PerlinNoise leaf shaders skip defs (they use filter primitives instead).
|
|
1096
|
+
const Shader* leaf = shader.get();
|
|
1097
|
+
while (leaf) {
|
|
1098
|
+
auto leafType = Types::Get(leaf);
|
|
1099
|
+
if (leafType == Types::ShaderType::Matrix) {
|
|
1100
|
+
leaf = static_cast<const MatrixShader*>(leaf)->source.get();
|
|
1101
|
+
} else if (leafType == Types::ShaderType::ColorFilter) {
|
|
1102
|
+
leaf = static_cast<const ColorFilterShader*>(leaf)->shader.get();
|
|
1103
|
+
} else {
|
|
1104
|
+
break;
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
bool needsDefs = !leaf || Types::Get(leaf) != Types::ShaderType::PerlinNoise;
|
|
1108
|
+
if (needsDefs) {
|
|
1109
|
+
ElementWriter defs("defs", writer);
|
|
1110
|
+
addShaderResources(shader, context, &resources);
|
|
1111
|
+
} else {
|
|
1112
|
+
resources.filter = "pending";
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
// Determine whether the shader produced filter primitives (PerlinNoise / ColorFilterShader)
|
|
1117
|
+
// that need to be combined with brush.colorFilter into a single <filter> element.
|
|
1118
|
+
// A "pending" value in resources.filter means the shader needs filter primitives but has not
|
|
1119
|
+
// yet emitted the <filter> element.
|
|
1120
|
+
bool shaderNeedsFilter = (resources.filter == "pending");
|
|
1121
|
+
bool hasColorFilter = brush.colorFilter != nullptr;
|
|
1122
|
+
|
|
1123
|
+
if (shaderNeedsFilter || hasColorFilter) {
|
|
1124
|
+
resources.filter = "";
|
|
1125
|
+
std::string filterID = resourceStore->addFilter();
|
|
1126
|
+
{
|
|
1127
|
+
ElementWriter filterElement("filter", writer);
|
|
1128
|
+
filterElement.addAttribute("id", filterID);
|
|
1129
|
+
filterElement.addAttribute("color-interpolation-filters", "sRGB");
|
|
1130
|
+
filterElement.addAttribute("x", "0%");
|
|
1131
|
+
filterElement.addAttribute("y", "0%");
|
|
1132
|
+
filterElement.addAttribute("width", "100%");
|
|
1133
|
+
filterElement.addAttribute("height", "100%");
|
|
1134
|
+
if (shaderNeedsFilter) {
|
|
1135
|
+
addShaderFilterPrimitives(brush.shader.get());
|
|
1136
|
+
}
|
|
1137
|
+
if (hasColorFilter) {
|
|
1138
|
+
addColorFilterPrimitives(brush.colorFilter);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
resources.filter = "url(#" + filterID + ")";
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
if (auto maskFilter = brush.maskFilter) {
|
|
1145
|
+
addMaskResources(maskFilter, &resources, context, svgContext);
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
return resources;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
static std::pair<const Shader*, Matrix> DecomposeShader(const std::shared_ptr<Shader>& shader) {
|
|
1152
|
+
Matrix matrix = {};
|
|
1153
|
+
const Shader* tempShader = shader.get();
|
|
1154
|
+
while (Types::Get(tempShader) == Types::ShaderType::Matrix) {
|
|
1155
|
+
auto matrixShader = static_cast<const MatrixShader*>(tempShader);
|
|
1156
|
+
matrix = matrix * matrixShader->matrix;
|
|
1157
|
+
tempShader = matrixShader->source.get();
|
|
1158
|
+
}
|
|
1159
|
+
return {tempShader, matrix};
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
void ElementWriter::addShaderResources(const std::shared_ptr<Shader>& shader, Context* context,
|
|
1163
|
+
Resources* resources) {
|
|
1164
|
+
auto [decomposedShader, matrix] = DecomposeShader(shader);
|
|
1165
|
+
|
|
1166
|
+
auto type = Types::Get(decomposedShader);
|
|
1167
|
+
switch (type) {
|
|
1168
|
+
case Types::ShaderType::Color:
|
|
1169
|
+
addColorShaderResources(static_cast<const ColorShader*>(decomposedShader), resources);
|
|
1170
|
+
break;
|
|
1171
|
+
case Types::ShaderType::Gradient:
|
|
1172
|
+
addGradientShaderResources(static_cast<const GradientShader*>(decomposedShader), matrix,
|
|
1173
|
+
resources);
|
|
1174
|
+
break;
|
|
1175
|
+
case Types::ShaderType::Image:
|
|
1176
|
+
addImageShaderResources(static_cast<const ImageShader*>(decomposedShader), matrix, context,
|
|
1177
|
+
resources);
|
|
1178
|
+
break;
|
|
1179
|
+
case Types::ShaderType::ColorFilter: {
|
|
1180
|
+
auto colorFilterShader = static_cast<const ColorFilterShader*>(decomposedShader);
|
|
1181
|
+
// Process the inner shader (may set fill/gradient/pattern resources).
|
|
1182
|
+
addShaderResources(colorFilterShader->shader, context, resources);
|
|
1183
|
+
// Mark that filter primitives are needed. The actual <filter> element will be emitted
|
|
1184
|
+
// by addResources, which may combine it with a brush colorFilter.
|
|
1185
|
+
if (colorFilterShader->colorFilter) {
|
|
1186
|
+
resources->filter = "pending";
|
|
1187
|
+
}
|
|
1188
|
+
break;
|
|
1189
|
+
}
|
|
1190
|
+
case Types::ShaderType::PerlinNoise: {
|
|
1191
|
+
// Mark that this shader needs a filter. The actual <filter> element will be emitted by
|
|
1192
|
+
// addResources, which may combine it with a brush colorFilter.
|
|
1193
|
+
resources->filter = "pending";
|
|
1194
|
+
break;
|
|
1195
|
+
}
|
|
1196
|
+
default:
|
|
1197
|
+
reportUnsupportedElement("Unsupported shader");
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
void ElementWriter::addShaderFilterPrimitives(const Shader* shader) {
|
|
1202
|
+
const Shader* inner = shader;
|
|
1203
|
+
while (inner && Types::Get(inner) == Types::ShaderType::Matrix) {
|
|
1204
|
+
inner = static_cast<const MatrixShader*>(inner)->source.get();
|
|
1205
|
+
}
|
|
1206
|
+
if (!inner) {
|
|
1207
|
+
return;
|
|
1208
|
+
}
|
|
1209
|
+
auto type = Types::Get(inner);
|
|
1210
|
+
switch (type) {
|
|
1211
|
+
case Types::ShaderType::PerlinNoise:
|
|
1212
|
+
addPerlinNoisePrimitives(inner);
|
|
1213
|
+
break;
|
|
1214
|
+
case Types::ShaderType::ColorFilter: {
|
|
1215
|
+
auto colorFilterShader = static_cast<const ColorFilterShader*>(inner);
|
|
1216
|
+
// Recurse into the inner shader for its filter primitives.
|
|
1217
|
+
addShaderFilterPrimitives(colorFilterShader->shader.get());
|
|
1218
|
+
// Then append the ColorFilterShader's own color filter primitives.
|
|
1219
|
+
if (colorFilterShader->colorFilter) {
|
|
1220
|
+
addColorFilterPrimitives(colorFilterShader->colorFilter);
|
|
1221
|
+
}
|
|
1222
|
+
break;
|
|
1223
|
+
}
|
|
1224
|
+
default:
|
|
1225
|
+
break;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
void ElementWriter::addPerlinNoisePrimitives(const Shader* shader, const std::string& resultName) {
|
|
1230
|
+
auto noiseShader = static_cast<const PerlinNoiseShader*>(shader);
|
|
1231
|
+
ElementWriter turbulenceElement("feTurbulence", writer);
|
|
1232
|
+
turbulenceElement.addAttribute("type", noiseShader->noiseType == PerlinNoiseType::FractalNoise
|
|
1233
|
+
? "fractalNoise"
|
|
1234
|
+
: "turbulence");
|
|
1235
|
+
turbulenceElement.addAttribute("baseFrequency", FloatToString(noiseShader->baseFrequencyX) + " " +
|
|
1236
|
+
FloatToString(noiseShader->baseFrequencyY));
|
|
1237
|
+
turbulenceElement.addAttribute("numOctaves", noiseShader->numOctaves);
|
|
1238
|
+
turbulenceElement.addAttribute("seed", static_cast<int32_t>(noiseShader->seed));
|
|
1239
|
+
if (noiseShader->stitchTiles) {
|
|
1240
|
+
turbulenceElement.addAttribute("stitchTiles", "stitch");
|
|
1241
|
+
}
|
|
1242
|
+
if (!resultName.empty()) {
|
|
1243
|
+
turbulenceElement.addAttribute("result", resultName);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
void ElementWriter::addColorShaderResources(const ColorShader* shader, Resources* resources) {
|
|
1248
|
+
Color color;
|
|
1249
|
+
if (shader->asColor(&color)) {
|
|
1250
|
+
color = ConvertColorSpace(color, _targetColorSpace);
|
|
1251
|
+
resources->paintColor = ToSVGColor(color);
|
|
1252
|
+
resources->colorValue = color;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
void ElementWriter::addGradientShaderResources(const GradientShader* shader, const Matrix& matrix,
|
|
1257
|
+
Resources* resources) {
|
|
1258
|
+
GradientInfo info;
|
|
1259
|
+
GradientType type = shader->asGradient(&info);
|
|
1260
|
+
|
|
1261
|
+
DEBUG_ASSERT(info.colors.size() == info.positions.size());
|
|
1262
|
+
if (type == GradientType::Linear) {
|
|
1263
|
+
resources->paintColor = "url(#" + addLinearGradientDef(info, matrix) + ")";
|
|
1264
|
+
} else if (type == GradientType::Radial) {
|
|
1265
|
+
resources->paintColor = "url(#" + addRadialGradientDef(info, matrix) + ")";
|
|
1266
|
+
} else {
|
|
1267
|
+
resources->paintColor = "url(#" + addUnsupportedGradientDef(info, matrix) + ")";
|
|
1268
|
+
reportUnsupportedElement("Unsupported gradient type");
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
void ElementWriter::addGradientColors(const GradientInfo& info) {
|
|
1273
|
+
DEBUG_ASSERT(info.colors.size() >= 2);
|
|
1274
|
+
std::unique_ptr<ColorSpaceXformSteps> steps = nullptr;
|
|
1275
|
+
if (NeedConvertColorSpace(ColorSpace::SRGB(), _targetColorSpace)) {
|
|
1276
|
+
steps =
|
|
1277
|
+
std::make_unique<ColorSpaceXformSteps>(ColorSpace::SRGB().get(), AlphaType::Unpremultiplied,
|
|
1278
|
+
_targetColorSpace.get(), AlphaType::Unpremultiplied);
|
|
1279
|
+
}
|
|
1280
|
+
for (uint32_t i = 0; i < info.colors.size(); ++i) {
|
|
1281
|
+
auto color = info.colors[i];
|
|
1282
|
+
if (steps) {
|
|
1283
|
+
steps->apply(color.array());
|
|
1284
|
+
}
|
|
1285
|
+
auto colorStr = ToSVGColor(color);
|
|
1286
|
+
ElementWriter stop("stop", writer);
|
|
1287
|
+
stop.addAttribute("offset", info.positions[i]);
|
|
1288
|
+
stop.addAttribute("stop-color", colorStr);
|
|
1289
|
+
std::string cssStyle;
|
|
1290
|
+
if (writeColorCSSStyleAttribute("stop-color", color, &cssStyle)) {
|
|
1291
|
+
stop.addAttribute("style", cssStyle);
|
|
1292
|
+
}
|
|
1293
|
+
if (!color.isOpaque()) {
|
|
1294
|
+
stop.addAttribute("stop-opacity", color.alpha);
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
std::string ElementWriter::addLinearGradientDef(const GradientInfo& info, const Matrix& matrix) {
|
|
1300
|
+
DEBUG_ASSERT(resourceStore);
|
|
1301
|
+
auto id = resourceStore->addGradient();
|
|
1302
|
+
|
|
1303
|
+
{
|
|
1304
|
+
ElementWriter gradient("linearGradient", writer);
|
|
1305
|
+
|
|
1306
|
+
gradient.addAttribute("id", id);
|
|
1307
|
+
if (!matrix.isIdentity()) {
|
|
1308
|
+
gradient.addAttribute("gradientTransform", ToSVGTransform(matrix));
|
|
1309
|
+
}
|
|
1310
|
+
gradient.addAttribute("gradientUnits", "userSpaceOnUse");
|
|
1311
|
+
gradient.addAttribute("x1", info.points[0].x);
|
|
1312
|
+
gradient.addAttribute("y1", info.points[0].y);
|
|
1313
|
+
gradient.addAttribute("x2", info.points[1].x);
|
|
1314
|
+
gradient.addAttribute("y2", info.points[1].y);
|
|
1315
|
+
addGradientColors(info);
|
|
1316
|
+
}
|
|
1317
|
+
return id;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
std::string ElementWriter::addRadialGradientDef(const GradientInfo& info, const Matrix& matrix) {
|
|
1321
|
+
DEBUG_ASSERT(resourceStore);
|
|
1322
|
+
auto id = resourceStore->addGradient();
|
|
1323
|
+
|
|
1324
|
+
{
|
|
1325
|
+
ElementWriter gradient("radialGradient", writer);
|
|
1326
|
+
|
|
1327
|
+
gradient.addAttribute("id", id);
|
|
1328
|
+
if (!matrix.isIdentity()) {
|
|
1329
|
+
gradient.addAttribute("gradientTransform", ToSVGTransform(matrix));
|
|
1330
|
+
}
|
|
1331
|
+
gradient.addAttribute("gradientUnits", "userSpaceOnUse");
|
|
1332
|
+
gradient.addAttribute("r", info.radiuses[0]);
|
|
1333
|
+
gradient.addAttribute("cx", info.points[0].x);
|
|
1334
|
+
gradient.addAttribute("cy", info.points[0].y);
|
|
1335
|
+
addGradientColors(info);
|
|
1336
|
+
}
|
|
1337
|
+
return id;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
std::string ElementWriter::addUnsupportedGradientDef(const GradientInfo& info,
|
|
1341
|
+
const Matrix& matrix) {
|
|
1342
|
+
DEBUG_ASSERT(resourceStore);
|
|
1343
|
+
auto id = resourceStore->addGradient();
|
|
1344
|
+
|
|
1345
|
+
{
|
|
1346
|
+
ElementWriter gradient("radialGradient", writer);
|
|
1347
|
+
|
|
1348
|
+
gradient.addAttribute("id", id);
|
|
1349
|
+
if (!matrix.isIdentity()) {
|
|
1350
|
+
gradient.addAttribute("gradientTransform", ToSVGTransform(matrix));
|
|
1351
|
+
}
|
|
1352
|
+
gradient.addAttribute("gradientUnits", "userSpaceOnUse");
|
|
1353
|
+
gradient.addAttribute("r", info.radiuses[0]);
|
|
1354
|
+
gradient.addAttribute("cx", info.points[0].x);
|
|
1355
|
+
gradient.addAttribute("cy", info.points[0].y);
|
|
1356
|
+
addGradientColors(info);
|
|
1357
|
+
}
|
|
1358
|
+
return id;
|
|
1359
|
+
};
|
|
1360
|
+
|
|
1361
|
+
void ElementWriter::addImageShaderResources(const ImageShader* shader, const Matrix& matrix,
|
|
1362
|
+
Context* context, Resources* resources) {
|
|
1363
|
+
auto image = shader->image;
|
|
1364
|
+
DEBUG_ASSERT(image);
|
|
1365
|
+
image = ConvertImageColorSpace(image, context, _targetColorSpace, _assignColorSpace);
|
|
1366
|
+
auto dataUri = SVGExportContext::EncodeImageToDataUri(image, context);
|
|
1367
|
+
if (!dataUri) {
|
|
1368
|
+
return;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
auto imageWidth = image->width();
|
|
1372
|
+
auto imageHeight = image->height();
|
|
1373
|
+
auto transDimension = [](TileMode mode, int length) -> std::string {
|
|
1374
|
+
if (mode == TileMode::Repeat) {
|
|
1375
|
+
return std::to_string(length);
|
|
1376
|
+
} else {
|
|
1377
|
+
return "100%";
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
std::string widthValue = transDimension(shader->tileModeX, imageWidth);
|
|
1381
|
+
std::string heightValue = transDimension(shader->tileModeY, imageHeight);
|
|
1382
|
+
|
|
1383
|
+
std::string patternID = resourceStore->addPattern();
|
|
1384
|
+
std::string imageID = resourceStore->addImage();
|
|
1385
|
+
{
|
|
1386
|
+
ElementWriter pattern("pattern", writer);
|
|
1387
|
+
pattern.addAttribute("id", patternID);
|
|
1388
|
+
pattern.addAttribute("patternUnits", "userSpaceOnUse");
|
|
1389
|
+
pattern.addAttribute("patternContentUnits", "userSpaceOnUse");
|
|
1390
|
+
pattern.addAttribute("width", widthValue);
|
|
1391
|
+
pattern.addAttribute("height", heightValue);
|
|
1392
|
+
pattern.addAttribute("x", 0);
|
|
1393
|
+
pattern.addAttribute("y", 0);
|
|
1394
|
+
|
|
1395
|
+
{
|
|
1396
|
+
ElementWriter useTag("use", writer);
|
|
1397
|
+
useTag.addAttribute("xlink:href", "#" + imageID);
|
|
1398
|
+
if (!matrix.isIdentity()) {
|
|
1399
|
+
useTag.addAttribute("transform", ToSVGTransform(matrix));
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
{
|
|
1404
|
+
ElementWriter imageTag("image", writer);
|
|
1405
|
+
imageTag.addAttribute("id", imageID);
|
|
1406
|
+
imageTag.addAttribute("x", 0);
|
|
1407
|
+
imageTag.addAttribute("y", 0);
|
|
1408
|
+
imageTag.addAttribute("width", image->width());
|
|
1409
|
+
imageTag.addAttribute("height", image->height());
|
|
1410
|
+
imageTag.addAttribute("xlink:href", static_cast<const char*>(dataUri->data()));
|
|
1411
|
+
}
|
|
1412
|
+
resources->paintColor = "url(#" + patternID + ")";
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
void ElementWriter::addMaskResources(const std::shared_ptr<MaskFilter>& maskFilter,
|
|
1416
|
+
Resources* resources, Context* context,
|
|
1417
|
+
SVGExportContext* svgContext) {
|
|
1418
|
+
if (Types::Get(maskFilter.get()) != Types::MaskFilterType::Shader) {
|
|
1419
|
+
return;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
auto maskShaderFilter = static_cast<const ShaderMaskFilter*>(maskFilter.get());
|
|
1423
|
+
|
|
1424
|
+
bool inverse = maskShaderFilter->isInverted();
|
|
1425
|
+
std::string filterID;
|
|
1426
|
+
if (inverse) {
|
|
1427
|
+
writer->startElement("filter");
|
|
1428
|
+
filterID = resourceStore->addFilter();
|
|
1429
|
+
writer->addAttribute("id", filterID);
|
|
1430
|
+
{
|
|
1431
|
+
writer->startElement("feColorMatrix");
|
|
1432
|
+
writer->addAttribute("type", "matrix");
|
|
1433
|
+
writer->addAttribute("values", "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1");
|
|
1434
|
+
writer->endElement();
|
|
1435
|
+
}
|
|
1436
|
+
writer->endElement();
|
|
1437
|
+
filterID = "url(#" + filterID + ")";
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
auto maskShader = maskShaderFilter->getShader();
|
|
1441
|
+
auto type = Types::Get(maskShader.get());
|
|
1442
|
+
switch (type) {
|
|
1443
|
+
case Types::ShaderType::Image: {
|
|
1444
|
+
auto imageShader = static_cast<const ImageShader*>(maskShader.get());
|
|
1445
|
+
auto image = imageShader->image;
|
|
1446
|
+
|
|
1447
|
+
ElementWriter maskElement("mask", writer);
|
|
1448
|
+
auto maskID = resourceStore->addMask();
|
|
1449
|
+
maskElement.addAttribute("id", maskID);
|
|
1450
|
+
maskElement.addAttribute("style", "mask-type:alpha");
|
|
1451
|
+
maskElement.addAttribute("maskUnits", "userSpaceOnUse");
|
|
1452
|
+
maskElement.addAttribute("width", "100%");
|
|
1453
|
+
maskElement.addAttribute("height", "100%");
|
|
1454
|
+
|
|
1455
|
+
addImageMaskResources(imageShader, filterID, context, svgContext);
|
|
1456
|
+
|
|
1457
|
+
resources->mask = "url(#" + maskID + ")";
|
|
1458
|
+
break;
|
|
1459
|
+
}
|
|
1460
|
+
case Types::ShaderType::Color:
|
|
1461
|
+
case Types::ShaderType::Gradient: {
|
|
1462
|
+
ElementWriter maskElement("mask", writer);
|
|
1463
|
+
auto maskID = resourceStore->addMask();
|
|
1464
|
+
maskElement.addAttribute("id", maskID);
|
|
1465
|
+
maskElement.addAttribute("style", "mask-type:alpha");
|
|
1466
|
+
maskElement.addAttribute("maskUnits", "userSpaceOnUse");
|
|
1467
|
+
maskElement.addAttribute("width", "100%");
|
|
1468
|
+
maskElement.addAttribute("height", "100%");
|
|
1469
|
+
|
|
1470
|
+
addShaderMaskResources(maskShader, filterID, context);
|
|
1471
|
+
|
|
1472
|
+
resources->mask = "url(#" + maskID + ")";
|
|
1473
|
+
break;
|
|
1474
|
+
}
|
|
1475
|
+
default:
|
|
1476
|
+
// TODO (YGaurora): The mask filter can be expanded to support shaders. Once shaders are
|
|
1477
|
+
// supported, the corresponding mask filter will also be supported.
|
|
1478
|
+
reportUnsupportedElement("unsupported mask filter");
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
void ElementWriter::addImageMaskResources(const ImageShader* imageShader,
|
|
1483
|
+
const std::string& filterID, Context* context,
|
|
1484
|
+
SVGExportContext* svgContext) {
|
|
1485
|
+
auto image = imageShader->image;
|
|
1486
|
+
Types::ImageType type = Types::Get(image.get());
|
|
1487
|
+
if (type == Types::ImageType::Picture) {
|
|
1488
|
+
addPictureImageMaskResources(static_cast<const PictureImage*>(image.get()), filterID,
|
|
1489
|
+
svgContext);
|
|
1490
|
+
} else {
|
|
1491
|
+
addRenderImageMaskResources(imageShader, filterID, context);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
void ElementWriter::addPictureImageMaskResources(const PictureImage* pictureImage,
|
|
1496
|
+
const std::string& filterID,
|
|
1497
|
+
SVGExportContext* svgContext) {
|
|
1498
|
+
auto picture = pictureImage->picture;
|
|
1499
|
+
auto pictureBound = picture->getBounds();
|
|
1500
|
+
if (pictureImage->matrix) {
|
|
1501
|
+
pictureImage->matrix->mapRect(&pictureBound);
|
|
1502
|
+
}
|
|
1503
|
+
auto imageBound = Rect::MakeWH(pictureImage->width(), pictureImage->height());
|
|
1504
|
+
std::string clipID;
|
|
1505
|
+
if (!imageBound.contains(pictureBound)) {
|
|
1506
|
+
clipID = resourceStore->addClip();
|
|
1507
|
+
writer->startElement("clipPath");
|
|
1508
|
+
writer->addAttribute("id", clipID);
|
|
1509
|
+
{
|
|
1510
|
+
writer->startElement("rect");
|
|
1511
|
+
addRectAttributes(imageBound);
|
|
1512
|
+
writer->endElement();
|
|
1513
|
+
}
|
|
1514
|
+
writer->endElement();
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
auto matrix = Matrix::I();
|
|
1518
|
+
if (pictureImage->matrix) {
|
|
1519
|
+
matrix = *pictureImage->matrix;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
writer->startElement("g");
|
|
1523
|
+
if (!clipID.empty()) {
|
|
1524
|
+
writer->addAttribute("clip-path", "url(#" + clipID + ")");
|
|
1525
|
+
}
|
|
1526
|
+
if (!filterID.empty()) {
|
|
1527
|
+
writer->addAttribute("filter", filterID);
|
|
1528
|
+
}
|
|
1529
|
+
svgContext->drawPicture(picture, matrix, ClipStack());
|
|
1530
|
+
writer->endElement();
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
void ElementWriter::addRenderImageMaskResources(const ImageShader* imageShader,
|
|
1534
|
+
const std::string& filterID, Context* context) {
|
|
1535
|
+
Resources resources;
|
|
1536
|
+
addImageShaderResources(imageShader, {}, context, &resources);
|
|
1537
|
+
|
|
1538
|
+
writer->startElement("rect");
|
|
1539
|
+
addAttribute("fill", resources.paintColor);
|
|
1540
|
+
if (!filterID.empty()) {
|
|
1541
|
+
writer->addAttribute("filter", filterID);
|
|
1542
|
+
}
|
|
1543
|
+
addAttribute("width", "100%");
|
|
1544
|
+
addAttribute("height", "100%");
|
|
1545
|
+
writer->endElement();
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
void ElementWriter::addShaderMaskResources(const std::shared_ptr<Shader>& shader,
|
|
1549
|
+
const std::string& filterID, Context* context) {
|
|
1550
|
+
Resources resources;
|
|
1551
|
+
addShaderResources(shader, context, &resources);
|
|
1552
|
+
|
|
1553
|
+
writer->startElement("rect");
|
|
1554
|
+
addAttribute("fill", resources.paintColor);
|
|
1555
|
+
if (resources.paintColor.find("url") == std::string::npos) {
|
|
1556
|
+
std::string cssStyle;
|
|
1557
|
+
if (writeColorCSSStyleAttribute("fill", resources.colorValue, &cssStyle)) {
|
|
1558
|
+
addAttribute("style", cssStyle);
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
if (!filterID.empty()) {
|
|
1562
|
+
writer->addAttribute("filter", filterID);
|
|
1563
|
+
}
|
|
1564
|
+
addAttribute("width", "100%");
|
|
1565
|
+
addAttribute("height", "100%");
|
|
1566
|
+
writer->endElement();
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
} // namespace tgfx
|