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,1490 @@
|
|
|
1
|
+
/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
//
|
|
3
|
+
// Tencent is pleased to support the open source community by making tgfx available.
|
|
4
|
+
//
|
|
5
|
+
// Copyright (C) 2025 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 "PDFExportContext.h"
|
|
20
|
+
#include "core/AdvancedTypefaceInfo.h"
|
|
21
|
+
#include "core/CanvasState.h"
|
|
22
|
+
#include "core/ClipStack.h"
|
|
23
|
+
#include "core/DrawContext.h"
|
|
24
|
+
#include "core/GlyphTransform.h"
|
|
25
|
+
#include "core/MeasureContext.h"
|
|
26
|
+
#include "core/PictureRecords.h"
|
|
27
|
+
#include "core/RunRecord.h"
|
|
28
|
+
#include "core/ScalerContext.h"
|
|
29
|
+
#include "core/filters/DropShadowImageFilter.h"
|
|
30
|
+
#include "core/filters/GaussianBlurImageFilter.h"
|
|
31
|
+
#include "core/filters/InnerShadowImageFilter.h"
|
|
32
|
+
#include "core/filters/ShaderMaskFilter.h"
|
|
33
|
+
#include "core/images/FilterImage.h"
|
|
34
|
+
#include "core/images/PictureImage.h"
|
|
35
|
+
#include "core/shaders/ColorShader.h"
|
|
36
|
+
#include "core/shaders/ImageShader.h"
|
|
37
|
+
#include "core/shaders/MatrixShader.h"
|
|
38
|
+
#include "core/utils/ColorHelper.h"
|
|
39
|
+
#include "core/utils/Log.h"
|
|
40
|
+
#include "core/utils/PlacementPtr.h"
|
|
41
|
+
#include "core/utils/ShapeUtils.h"
|
|
42
|
+
#include "core/utils/Types.h"
|
|
43
|
+
#include "pdf/PDFBitmap.h"
|
|
44
|
+
#include "pdf/PDFDocumentImpl.h"
|
|
45
|
+
#include "pdf/PDFFont.h"
|
|
46
|
+
#include "pdf/PDFFormXObject.h"
|
|
47
|
+
#include "pdf/PDFGraphicState.h"
|
|
48
|
+
#include "pdf/PDFResourceDictionary.h"
|
|
49
|
+
#include "pdf/PDFShader.h"
|
|
50
|
+
#include "pdf/PDFTypes.h"
|
|
51
|
+
#include "pdf/PDFUtils.h"
|
|
52
|
+
#include "tgfx/core/BlendMode.h"
|
|
53
|
+
#include "tgfx/core/Brush.h"
|
|
54
|
+
#include "tgfx/core/Color.h"
|
|
55
|
+
#include "tgfx/core/ColorFilter.h"
|
|
56
|
+
#include "tgfx/core/ColorType.h"
|
|
57
|
+
#include "tgfx/core/Data.h"
|
|
58
|
+
#include "tgfx/core/FontMetrics.h"
|
|
59
|
+
#include "tgfx/core/Image.h"
|
|
60
|
+
#include "tgfx/core/ImageFilter.h"
|
|
61
|
+
#include "tgfx/core/ImageInfo.h"
|
|
62
|
+
#include "tgfx/core/Matrix.h"
|
|
63
|
+
#include "tgfx/core/Paint.h"
|
|
64
|
+
#include "tgfx/core/Path.h"
|
|
65
|
+
#include "tgfx/core/PathTypes.h"
|
|
66
|
+
#include "tgfx/core/Picture.h"
|
|
67
|
+
#include "tgfx/core/Point.h"
|
|
68
|
+
#include "tgfx/core/Rect.h"
|
|
69
|
+
#include "tgfx/core/SamplingOptions.h"
|
|
70
|
+
#include "tgfx/core/Shader.h"
|
|
71
|
+
#include "tgfx/core/Shape.h"
|
|
72
|
+
#include "tgfx/core/Size.h"
|
|
73
|
+
#include "tgfx/core/Stroke.h"
|
|
74
|
+
#include "tgfx/core/Surface.h"
|
|
75
|
+
#include "tgfx/core/TileMode.h"
|
|
76
|
+
#include "tgfx/core/Typeface.h"
|
|
77
|
+
#include "tgfx/core/UTF.h"
|
|
78
|
+
#include "tgfx/core/WriteStream.h"
|
|
79
|
+
#include "tgfx/layers/filters/DropShadowFilter.h"
|
|
80
|
+
|
|
81
|
+
namespace tgfx {
|
|
82
|
+
|
|
83
|
+
// A helper class to automatically finish a ContentEntry at the end of a
|
|
84
|
+
// drawing method and maintain the state needed between set up and finish.
|
|
85
|
+
// It manages both the drawn content and an optional shape mask for blend mode post-processing.
|
|
86
|
+
class ScopedContentEntry {
|
|
87
|
+
public:
|
|
88
|
+
/**
|
|
89
|
+
* @param matrix The current transform matrix, used for both content and shape.
|
|
90
|
+
* @param contentExtraMatrix Additional transform for the content only.
|
|
91
|
+
*/
|
|
92
|
+
ScopedContentEntry(PDFExportContext* device, const Matrix& matrix, const ClipStack& clip,
|
|
93
|
+
const Matrix& contentExtraMatrix, const Brush& brush, float textScale = 0)
|
|
94
|
+
: drawContext(device), matrix(matrix), clip(clip) {
|
|
95
|
+
blendMode = brush.blendMode;
|
|
96
|
+
contentStream = drawContext->setUpContentEntry(matrix, clip, contentExtraMatrix, brush,
|
|
97
|
+
textScale, &destFormXObject);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
~ScopedContentEntry() {
|
|
101
|
+
if (contentStream) {
|
|
102
|
+
Path* shape = &path;
|
|
103
|
+
if (shape->isEmpty()) {
|
|
104
|
+
shape = nullptr;
|
|
105
|
+
}
|
|
106
|
+
drawContext->finishContentEntry(matrix, clip, blendMode, destFormXObject, shape);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
explicit operator bool() const {
|
|
111
|
+
return contentStream != nullptr;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
std::shared_ptr<MemoryWriteStream> stream() {
|
|
115
|
+
return contentStream;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* Returns true when we explicitly need the shape of the drawing. */
|
|
119
|
+
bool needShape() {
|
|
120
|
+
switch (blendMode) {
|
|
121
|
+
case BlendMode::Clear:
|
|
122
|
+
case BlendMode::Src:
|
|
123
|
+
case BlendMode::SrcIn:
|
|
124
|
+
case BlendMode::SrcOut:
|
|
125
|
+
case BlendMode::DstIn:
|
|
126
|
+
case BlendMode::DstOut:
|
|
127
|
+
case BlendMode::SrcATop:
|
|
128
|
+
case BlendMode::DstATop:
|
|
129
|
+
case BlendMode::Modulate:
|
|
130
|
+
return true;
|
|
131
|
+
default:
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Returns true unless we only need the shape of the drawing. */
|
|
137
|
+
bool needSource() {
|
|
138
|
+
return blendMode != BlendMode::Clear;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* If the shape is different than the alpha component of the content, then
|
|
142
|
+
* setShape should be called with the shape. In particular, images and
|
|
143
|
+
* devices have rectangular shape.
|
|
144
|
+
*/
|
|
145
|
+
void setShape(const Path& shape) {
|
|
146
|
+
path = shape;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
private:
|
|
150
|
+
PDFExportContext* drawContext = nullptr;
|
|
151
|
+
std::shared_ptr<MemoryWriteStream> contentStream = nullptr;
|
|
152
|
+
BlendMode blendMode = {};
|
|
153
|
+
PDFIndirectReference destFormXObject = {};
|
|
154
|
+
Path path;
|
|
155
|
+
Matrix matrix;
|
|
156
|
+
ClipStack clip;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
PDFExportContext::PDFExportContext(ISize pageSize, PDFDocumentImpl* document,
|
|
160
|
+
const Matrix& transform)
|
|
161
|
+
: _pageSize(pageSize), document(document), _initialTransform(transform) {
|
|
162
|
+
DEBUG_ASSERT(!_pageSize.isEmpty());
|
|
163
|
+
content = MemoryWriteStream::Make();
|
|
164
|
+
contentBuffer = MemoryWriteStream::Make();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
PDFExportContext::~PDFExportContext() = default;
|
|
168
|
+
|
|
169
|
+
void PDFExportContext::reset() {
|
|
170
|
+
content->reset();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
void PDFExportContext::drawFill(const Brush& brush) {
|
|
174
|
+
Path path;
|
|
175
|
+
path.addRect(Rect::MakeSize(_pageSize));
|
|
176
|
+
onDrawPath(Matrix::I(), ClipStack(), path, brush);
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
void PDFExportContext::drawRect(const Rect& rect, const Matrix& matrix, const ClipStack& clip,
|
|
180
|
+
const Brush& brush, const Stroke* stroke) {
|
|
181
|
+
Path path;
|
|
182
|
+
path.addRect(rect);
|
|
183
|
+
if (stroke) {
|
|
184
|
+
stroke->applyToPath(&path);
|
|
185
|
+
}
|
|
186
|
+
onDrawPath(matrix, clip, path, brush);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
void PDFExportContext::drawRRect(const RRect& rRect, const Matrix& matrix, const ClipStack& clip,
|
|
190
|
+
const Brush& brush, const Stroke* stroke) {
|
|
191
|
+
Path path;
|
|
192
|
+
path.addRRect(rRect);
|
|
193
|
+
if (stroke) {
|
|
194
|
+
stroke->applyToPath(&path);
|
|
195
|
+
}
|
|
196
|
+
onDrawPath(matrix, clip, path, brush);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
void PDFExportContext::drawPath(const Path& path, const Matrix& matrix, const ClipStack& clip,
|
|
200
|
+
const Brush& brush) {
|
|
201
|
+
this->onDrawPath(matrix, clip, path, brush);
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
void PDFExportContext::drawShape(std::shared_ptr<Shape> shape, const Matrix& matrix,
|
|
205
|
+
const ClipStack& clip, const Brush& brush, const Stroke* stroke) {
|
|
206
|
+
shape = Shape::ApplyStroke(std::move(shape), stroke);
|
|
207
|
+
auto path = ShapeUtils::GetShapeRenderingPath(shape, matrix.getMaxScale());
|
|
208
|
+
this->onDrawPath(matrix, clip, path, brush);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
void PDFExportContext::drawImage(std::shared_ptr<Image> image, const SamplingOptions& sampling,
|
|
212
|
+
const Matrix& matrix, const ClipStack& clip, const Brush& brush) {
|
|
213
|
+
auto rect = Rect::MakeWH(image->width(), image->height());
|
|
214
|
+
onDrawImageRect(image, rect, sampling, matrix, clip, brush);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
void PDFExportContext::drawImageRect(std::shared_ptr<Image> image, const Rect& srcRect,
|
|
218
|
+
const Rect& dstRect, const SamplingOptions& sampling,
|
|
219
|
+
const Matrix& matrix, const ClipStack& clip,
|
|
220
|
+
const Brush& brush, SrcRectConstraint,
|
|
221
|
+
const Rect* /*strictRect*/) {
|
|
222
|
+
auto subsetImage = image->makeSubset(srcRect);
|
|
223
|
+
if (subsetImage == nullptr) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
onDrawImageRect(image, dstRect, sampling, matrix, clip, brush);
|
|
227
|
+
}
|
|
228
|
+
namespace {
|
|
229
|
+
enum class BlendFastPath {
|
|
230
|
+
Normal, // draw normally
|
|
231
|
+
SrcOver, //< draw as if in srcover mode
|
|
232
|
+
SkipDrawing //< draw nothing
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
bool just_solid_color(const Brush& brush) {
|
|
236
|
+
return brush.isOpaque() && !brush.colorFilter && !brush.shader;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
BlendFastPath check_fast_path(const Brush& brush, bool dstIsOpaque) {
|
|
240
|
+
const auto blendMode = brush.blendMode;
|
|
241
|
+
switch (blendMode) {
|
|
242
|
+
case BlendMode::SrcOver:
|
|
243
|
+
return BlendFastPath::SrcOver;
|
|
244
|
+
case BlendMode::Src:
|
|
245
|
+
if (just_solid_color(brush)) {
|
|
246
|
+
return BlendFastPath::SrcOver;
|
|
247
|
+
}
|
|
248
|
+
return BlendFastPath::Normal;
|
|
249
|
+
case BlendMode::Dst:
|
|
250
|
+
return BlendFastPath::SkipDrawing;
|
|
251
|
+
case BlendMode::DstOver:
|
|
252
|
+
if (dstIsOpaque) {
|
|
253
|
+
return BlendFastPath::SkipDrawing;
|
|
254
|
+
}
|
|
255
|
+
return BlendFastPath::Normal;
|
|
256
|
+
case BlendMode::SrcIn:
|
|
257
|
+
if (dstIsOpaque && just_solid_color(brush)) {
|
|
258
|
+
return BlendFastPath::SrcOver;
|
|
259
|
+
}
|
|
260
|
+
return BlendFastPath::Normal;
|
|
261
|
+
case BlendMode::DstIn:
|
|
262
|
+
if (just_solid_color(brush)) {
|
|
263
|
+
return BlendFastPath::SkipDrawing;
|
|
264
|
+
}
|
|
265
|
+
return BlendFastPath::Normal;
|
|
266
|
+
default:
|
|
267
|
+
return BlendFastPath::Normal;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
void remove_color_filter(Brush& brush) {
|
|
272
|
+
if (auto filter = brush.colorFilter) {
|
|
273
|
+
if (auto shader = brush.shader) {
|
|
274
|
+
shader = shader->makeWithColorFilter(filter);
|
|
275
|
+
brush.shader = shader;
|
|
276
|
+
} else {
|
|
277
|
+
//TODO (YGaurora): filter->filterColor() with color space
|
|
278
|
+
}
|
|
279
|
+
brush.colorFilter = nullptr;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
Brush clean_paint(const Brush& srcBrush) {
|
|
284
|
+
Brush brush(srcBrush);
|
|
285
|
+
if (brush.blendMode != BlendMode::SrcOver &&
|
|
286
|
+
check_fast_path(brush, false) == BlendFastPath::SrcOver) {
|
|
287
|
+
brush.blendMode = BlendMode::SrcOver;
|
|
288
|
+
}
|
|
289
|
+
if (brush.colorFilter) {
|
|
290
|
+
// We assume here that PDFs all draw in sRGB.
|
|
291
|
+
remove_color_filter(brush);
|
|
292
|
+
}
|
|
293
|
+
return brush;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
int add_resource(std::unordered_set<PDFIndirectReference>& resources, PDFIndirectReference ref) {
|
|
297
|
+
resources.insert(ref);
|
|
298
|
+
return ref.value;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Detects the (BlendMode::Src + FilterImage<Blur> + maskFilter) draw pattern. Today this shape is
|
|
302
|
+
// only produced by BackgroundBlurStyle's lower path, but the check intentionally matches on the
|
|
303
|
+
// pattern itself rather than the originating layer style: any caller that ends up in this exact
|
|
304
|
+
// combination is known to render incorrectly through the current PDF maskFilter path, so the
|
|
305
|
+
// caller treats a positive result as a "PDF cannot express this" guard and skips the draw (see
|
|
306
|
+
// TODO at the call site).
|
|
307
|
+
bool IsBackgroundBlurStylePattern(const Brush& brush, const Image* image) {
|
|
308
|
+
if (brush.blendMode != BlendMode::Src) {
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
311
|
+
if (Types::Get(image) != Types::ImageType::Filter) {
|
|
312
|
+
return false;
|
|
313
|
+
}
|
|
314
|
+
const auto* filterImage = static_cast<const FilterImage*>(image);
|
|
315
|
+
return filterImage->filter &&
|
|
316
|
+
Types::Get(filterImage->filter.get()) == Types::ImageFilterType::Blur;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// Generates a glyph path at the given resolutionScale to match the hinting result used by GPU
|
|
320
|
+
// rasterization. FreeType hinting snaps glyph control points to the pixel grid at the rendered
|
|
321
|
+
// font size, so a path obtained at 60px and scaled 4x differs from one obtained directly at 240px.
|
|
322
|
+
// By generating the path at the final device font size (fontSize * resolutionScale) and then
|
|
323
|
+
// scaling back to logical coordinates, the path shape matches the GPU-rasterized mask used by
|
|
324
|
+
// InnerShadowStyle and NoiseStyle.
|
|
325
|
+
Path GetGlyphRunPath(const GlyphRun& glyphRun, float resolutionScale) {
|
|
326
|
+
if (resolutionScale <= 0.0f) {
|
|
327
|
+
return {};
|
|
328
|
+
}
|
|
329
|
+
const bool hasScale = resolutionScale != 1.0f;
|
|
330
|
+
const auto scaleMatrix = Matrix::MakeScale(resolutionScale, resolutionScale);
|
|
331
|
+
auto font = glyphRun.font;
|
|
332
|
+
if (hasScale) {
|
|
333
|
+
font = font.makeWithSize(resolutionScale * font.getSize());
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
Path path = {};
|
|
337
|
+
for (size_t index = 0; index < glyphRun.glyphCount; index++) {
|
|
338
|
+
auto glyphID = glyphRun.glyphs[index];
|
|
339
|
+
Path glyphPath = {};
|
|
340
|
+
if (!font.getPath(glyphID, &glyphPath)) {
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
auto glyphMatrix = GetGlyphMatrix(glyphRun, index);
|
|
344
|
+
if (hasScale) {
|
|
345
|
+
glyphMatrix.preScale(1.0f / resolutionScale, 1.0f / resolutionScale);
|
|
346
|
+
glyphMatrix.postConcat(scaleMatrix);
|
|
347
|
+
}
|
|
348
|
+
glyphPath.transform(glyphMatrix);
|
|
349
|
+
path.addPath(glyphPath);
|
|
350
|
+
}
|
|
351
|
+
if (hasScale) {
|
|
352
|
+
auto inverseMatrix = Matrix::MakeScale(1.0f / resolutionScale, 1.0f / resolutionScale);
|
|
353
|
+
path.transform(inverseMatrix);
|
|
354
|
+
}
|
|
355
|
+
return path;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
} // namespace
|
|
359
|
+
|
|
360
|
+
namespace {
|
|
361
|
+
class GlyphPositioner {
|
|
362
|
+
public:
|
|
363
|
+
GlyphPositioner(std::shared_ptr<MemoryWriteStream> content, float textSkewX, Point origin)
|
|
364
|
+
: content(std::move(content)), currentMatrixOrigin(origin), textSkewX(textSkewX) {
|
|
365
|
+
}
|
|
366
|
+
~GlyphPositioner() {
|
|
367
|
+
this->flush();
|
|
368
|
+
}
|
|
369
|
+
void flush() {
|
|
370
|
+
if (inText) {
|
|
371
|
+
content->writeText("> Tj\n");
|
|
372
|
+
inText = false;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
void setFont(PDFFont* pdfFont) {
|
|
376
|
+
this->flush();
|
|
377
|
+
_pdfFont = pdfFont;
|
|
378
|
+
// Reader 2020.013.20064 incorrectly advances some Type3 fonts https://crbug.com/1226960
|
|
379
|
+
bool convertedToType3 = _pdfFont->getType() == AdvancedTypefaceInfo::FontType::Other;
|
|
380
|
+
bool thousandEM = _pdfFont->strike().strikeSpec.unitsPerEM == 1000;
|
|
381
|
+
viewersAgreeOnAdvancesInFont = thousandEM || !convertedToType3;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
void writeGlyph(uint16_t glyph, float advanceWidth, Point xy) {
|
|
385
|
+
if (!initialized) {
|
|
386
|
+
// Flip the text about the x-axis to account for origin swap and include
|
|
387
|
+
// the passed parameters.
|
|
388
|
+
content->writeText("1 0 ");
|
|
389
|
+
PDFUtils::AppendFloat(-textSkewX, content);
|
|
390
|
+
content->writeText(" -1 ");
|
|
391
|
+
PDFUtils::AppendFloat(currentMatrixOrigin.x, content);
|
|
392
|
+
content->writeText(" ");
|
|
393
|
+
PDFUtils::AppendFloat(currentMatrixOrigin.y, content);
|
|
394
|
+
content->writeText(" Tm\n");
|
|
395
|
+
initialized = true;
|
|
396
|
+
}
|
|
397
|
+
Point position = xy - currentMatrixOrigin;
|
|
398
|
+
if (!viewersAgreeOnXAdvance || position != Point{XAdvance, 0}) {
|
|
399
|
+
this->flush();
|
|
400
|
+
PDFUtils::AppendFloat(position.x - (position.y * textSkewX), content);
|
|
401
|
+
content->writeText(" ");
|
|
402
|
+
PDFUtils::AppendFloat(-position.y, content);
|
|
403
|
+
content->writeText(" Td ");
|
|
404
|
+
currentMatrixOrigin = xy;
|
|
405
|
+
XAdvance = 0;
|
|
406
|
+
viewersAgreeOnXAdvance = true;
|
|
407
|
+
}
|
|
408
|
+
XAdvance += advanceWidth;
|
|
409
|
+
if (!viewersAgreeOnAdvancesInFont) {
|
|
410
|
+
viewersAgreeOnXAdvance = false;
|
|
411
|
+
}
|
|
412
|
+
if (!inText) {
|
|
413
|
+
content->writeText("<");
|
|
414
|
+
inText = true;
|
|
415
|
+
}
|
|
416
|
+
if (_pdfFont->multiByteGlyphs()) {
|
|
417
|
+
PDFUtils::WriteUInt16BE(content, glyph);
|
|
418
|
+
} else {
|
|
419
|
+
PDFUtils::WriteUInt8(content, static_cast<uint8_t>(glyph));
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
private:
|
|
424
|
+
std::shared_ptr<MemoryWriteStream> content;
|
|
425
|
+
PDFFont* _pdfFont = nullptr;
|
|
426
|
+
Point currentMatrixOrigin;
|
|
427
|
+
float XAdvance = 0.0f;
|
|
428
|
+
bool viewersAgreeOnAdvancesInFont = true;
|
|
429
|
+
bool viewersAgreeOnXAdvance = true;
|
|
430
|
+
float textSkewX;
|
|
431
|
+
bool inText = false;
|
|
432
|
+
bool initialized = false;
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
Unichar MapGlyph(const std::vector<Unichar>& glyphToUnicode, GlyphID glyph) {
|
|
436
|
+
return glyph < glyphToUnicode.size() ? glyphToUnicode[glyph] : -1;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
bool NeedsNewFont(PDFFont* font, GlyphID glyphID, AdvancedTypefaceInfo::FontType initialFontType) {
|
|
440
|
+
if (!font || !font->hasGlyph(glyphID)) {
|
|
441
|
+
return true;
|
|
442
|
+
}
|
|
443
|
+
if (initialFontType == AdvancedTypefaceInfo::FontType::Other) {
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
auto scaleContext = PDFFont::GetScalerContext(font->strike().strikeSpec.typeface,
|
|
448
|
+
font->strike().strikeSpec.textSize);
|
|
449
|
+
Path glyphPath;
|
|
450
|
+
bool hasUnmodifiedPath = scaleContext->generatePath(glyphID, false, false, &glyphPath);
|
|
451
|
+
bool convertedToType3 = font->getType() == AdvancedTypefaceInfo::FontType::Other;
|
|
452
|
+
return convertedToType3 == hasUnmodifiedPath;
|
|
453
|
+
}
|
|
454
|
+
} // namespace
|
|
455
|
+
|
|
456
|
+
void PDFExportContext::drawTextBlob(std::shared_ptr<TextBlob> textBlob, const Matrix& matrix,
|
|
457
|
+
const ClipStack& clip, const Brush& brush,
|
|
458
|
+
const Stroke* stroke) {
|
|
459
|
+
for (auto glyphRun : *textBlob) {
|
|
460
|
+
onDrawGlyphRun(glyphRun, matrix, clip, brush, stroke);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
void PDFExportContext::onDrawGlyphRun(const GlyphRun& glyphRun, const Matrix& matrix,
|
|
465
|
+
const ClipStack& clip, const Brush& brush,
|
|
466
|
+
const Stroke* stroke) {
|
|
467
|
+
|
|
468
|
+
auto& font = glyphRun.font;
|
|
469
|
+
if (font.hasColor()) {
|
|
470
|
+
exportGlyphRunAsImage(glyphRun, matrix, clip, brush);
|
|
471
|
+
} else {
|
|
472
|
+
exportGlyphRunAsPath(glyphRun, matrix, clip, brush, stroke);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
void PDFExportContext::exportGlyphRunAsText(const GlyphRun& glyphRun, const Matrix& matrix,
|
|
477
|
+
const ClipStack& clip, const Brush& brush) {
|
|
478
|
+
if (glyphRun.glyphCount == 0) {
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
const auto& glyphRunFont = glyphRun.font;
|
|
483
|
+
auto pdfStrike = PDFStrike::Make(document, glyphRunFont);
|
|
484
|
+
if (!pdfStrike) {
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
auto typeface = pdfStrike->strikeSpec.typeface;
|
|
489
|
+
auto textSize = pdfStrike->strikeSpec.textSize;
|
|
490
|
+
|
|
491
|
+
const auto advancedInfo = PDFFont::GetAdvancedInfo(typeface, textSize, document);
|
|
492
|
+
if (!advancedInfo) {
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
const auto& glyphToUnicode = PDFFont::GetUnicodeMap(*typeface, document);
|
|
497
|
+
if (glyphToUnicode.empty()) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
AdvancedTypefaceInfo::FontType initialFontType = PDFFont::FontType(*pdfStrike, *advancedInfo);
|
|
502
|
+
|
|
503
|
+
// The size, skewX, and scaleX are applied here.
|
|
504
|
+
float advanceScale = textSize * 1.f / pdfStrike->strikeSpec.unitsPerEM;
|
|
505
|
+
|
|
506
|
+
// Clear everything from the runPaint that will be applied by the strike.
|
|
507
|
+
Brush brushPaint(brush);
|
|
508
|
+
brushPaint.maskFilter = nullptr;
|
|
509
|
+
auto paint = clean_paint(brushPaint);
|
|
510
|
+
ScopedContentEntry content(this, matrix, clip, Matrix::I(), paint);
|
|
511
|
+
if (!content) {
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
auto out = content.stream();
|
|
515
|
+
|
|
516
|
+
out->writeText("BT\n");
|
|
517
|
+
{
|
|
518
|
+
// Destinations are in absolute coordinates.
|
|
519
|
+
// The glyphs bounds go through the localToDevice separately for clipping.
|
|
520
|
+
Matrix pageXform = matrix;
|
|
521
|
+
pageXform.postConcat(document->currentPageTransform());
|
|
522
|
+
|
|
523
|
+
const auto numGlyphs = typeface->glyphsCount();
|
|
524
|
+
auto offset = GetGlyphPosition(glyphRun, 0);
|
|
525
|
+
GlyphPositioner glyphPositioner(out, glyphRunFont.getMetrics().leading, offset);
|
|
526
|
+
PDFFont* font = nullptr;
|
|
527
|
+
|
|
528
|
+
// Use clip bounds to cull glyphs outside the visible area, preventing ghost text in the PDF
|
|
529
|
+
// text layer that would otherwise be selectable but visually invisible.
|
|
530
|
+
const auto clipStackBounds =
|
|
531
|
+
clip.state() == ClipState::WideOpen ? Rect::MakeSize(_pageSize) : clip.bounds();
|
|
532
|
+
|
|
533
|
+
for (size_t index = 0; index < glyphRun.glyphCount; ++index) {
|
|
534
|
+
auto glyphID = glyphRun.glyphs[index];
|
|
535
|
+
if (numGlyphs <= glyphID) {
|
|
536
|
+
continue;
|
|
537
|
+
}
|
|
538
|
+
auto xy = GetGlyphPosition(glyphRun, index);
|
|
539
|
+
// Skip glyphs outside the clip region to keep visual and text layers consistent.
|
|
540
|
+
auto glyphBounds = glyphRunFont.getBounds(glyphID);
|
|
541
|
+
glyphBounds.scale(advanceScale, advanceScale);
|
|
542
|
+
glyphBounds.offset(xy + offset);
|
|
543
|
+
matrix.mapRect(&glyphBounds);
|
|
544
|
+
if (!glyphBounds.isEmpty() && !Rect::Intersects(clipStackBounds, glyphBounds)) {
|
|
545
|
+
continue;
|
|
546
|
+
}
|
|
547
|
+
if (glyphBounds.isEmpty() && !clipStackBounds.contains(glyphBounds.x(), glyphBounds.y())) {
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
glyphPositioner.flush();
|
|
552
|
+
out->writeText("/Span<</ActualText ");
|
|
553
|
+
auto unichar = MapGlyph(glyphToUnicode, glyphID);
|
|
554
|
+
auto utf8Text = UTF::ToUTF8(unichar);
|
|
555
|
+
PDFWriteTextString(out, utf8Text);
|
|
556
|
+
// begin marked-content sequence with an associated property list.
|
|
557
|
+
out->writeText(" >> BDC\n");
|
|
558
|
+
if (NeedsNewFont(font, glyphID, initialFontType)) {
|
|
559
|
+
// Not yet specified font or need to switch font.
|
|
560
|
+
font = pdfStrike->getFontResource(glyphID);
|
|
561
|
+
DEBUG_ASSERT(font);
|
|
562
|
+
glyphPositioner.setFont(font);
|
|
563
|
+
PDFWriteResourceName(out, PDFResourceType::Font,
|
|
564
|
+
add_resource(fontResources, font->indirectReference()));
|
|
565
|
+
out->writeText(" ");
|
|
566
|
+
PDFUtils::AppendFloat(textSize, out);
|
|
567
|
+
out->writeText(" Tf\n");
|
|
568
|
+
}
|
|
569
|
+
font->noteGlyphUsage(glyphID);
|
|
570
|
+
GlyphID encodedGlyph = font->glyphToPDFFontEncoding(glyphID);
|
|
571
|
+
float advance = advanceScale * glyphRunFont.getAdvance(glyphID);
|
|
572
|
+
glyphPositioner.writeGlyph(encodedGlyph, advance, xy);
|
|
573
|
+
}
|
|
574
|
+
// if (actualText)
|
|
575
|
+
{
|
|
576
|
+
glyphPositioner.flush();
|
|
577
|
+
out->writeText("EMC\n");
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
out->writeText("ET\n");
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
void PDFExportContext::exportGlyphRunAsPath(const GlyphRun& glyphRun, const Matrix& matrix,
|
|
584
|
+
const ClipStack& clip, const Brush& brush,
|
|
585
|
+
const Stroke* stroke) {
|
|
586
|
+
auto path = GetGlyphRunPath(glyphRun, matrix.getMaxScale());
|
|
587
|
+
if (path.isEmpty()) {
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
auto shape = Shape::MakeFrom(path);
|
|
591
|
+
drawShape(shape, matrix, clip, brush, stroke);
|
|
592
|
+
|
|
593
|
+
//TODO (YGaurora): maybe hasPerspective()
|
|
594
|
+
Brush transparentBrush = brush;
|
|
595
|
+
transparentBrush.color = Color::Transparent();
|
|
596
|
+
exportGlyphRunAsText(glyphRun, matrix, clip, transparentBrush);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
void PDFExportContext::exportGlyphRunAsImage(const GlyphRun& glyphRun, const Matrix& matrix,
|
|
600
|
+
const ClipStack& clip, const Brush& brush) {
|
|
601
|
+
const auto& glyphFont = glyphRun.font;
|
|
602
|
+
for (size_t i = 0; i < glyphRun.glyphCount; ++i) {
|
|
603
|
+
auto glyphID = glyphRun.glyphs[i];
|
|
604
|
+
auto glyphMatrix = GetGlyphMatrix(glyphRun, i);
|
|
605
|
+
auto tempMatrix = matrix;
|
|
606
|
+
Matrix imageMatrix;
|
|
607
|
+
auto glyphImageCodec = glyphFont.getImage(glyphID, nullptr, &imageMatrix);
|
|
608
|
+
if (glyphImageCodec == nullptr) {
|
|
609
|
+
continue;
|
|
610
|
+
}
|
|
611
|
+
tempMatrix.preConcat(imageMatrix);
|
|
612
|
+
tempMatrix.postConcat(glyphMatrix);
|
|
613
|
+
|
|
614
|
+
auto glyphImage = Image::MakeFrom(glyphImageCodec);
|
|
615
|
+
auto rect = Rect::MakeWH(glyphImage->width(), glyphImage->height());
|
|
616
|
+
drawImageRect(std::move(glyphImage), rect, rect, {}, tempMatrix, clip, brush,
|
|
617
|
+
SrcRectConstraint::Fast);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
//TODO (YGaurora): maybe hasPerspective()
|
|
621
|
+
Brush transparentBrush = brush;
|
|
622
|
+
transparentBrush.color = Color::Transparent();
|
|
623
|
+
exportGlyphRunAsText(glyphRun, matrix, clip, transparentBrush);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
void PDFExportContext::drawPicture(std::shared_ptr<Picture> picture, const Matrix& matrix,
|
|
627
|
+
const ClipStack& clip) {
|
|
628
|
+
picture->playback(this, matrix, clip);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
void PDFExportContext::drawDropShadowBeforeLayer(const std::shared_ptr<Picture>& picture,
|
|
632
|
+
const DropShadowImageFilter* dropShadowFilter,
|
|
633
|
+
const Matrix& matrix, const ClipStack& clip,
|
|
634
|
+
const Brush& brush) {
|
|
635
|
+
DEBUG_ASSERT(Types::Get(dropShadowFilter->blurFilter.get()) == Types::ImageFilterType::Blur);
|
|
636
|
+
const auto blurFilter =
|
|
637
|
+
static_cast<const GaussianBlurImageFilter*>(dropShadowFilter->blurFilter.get());
|
|
638
|
+
auto copyFilter = ImageFilter::DropShadowOnly(0.f, 0.f, blurFilter->blurrinessX,
|
|
639
|
+
blurFilter->blurrinessY, dropShadowFilter->color);
|
|
640
|
+
|
|
641
|
+
auto pictureBounds = picture->getBounds();
|
|
642
|
+
auto blurBounds = copyFilter->filterBounds(pictureBounds);
|
|
643
|
+
auto offset = Point::Make(pictureBounds.x() - blurBounds.x(), pictureBounds.y() - blurBounds.y());
|
|
644
|
+
|
|
645
|
+
auto surface = Surface::Make(document->context(), static_cast<int>(blurBounds.width()),
|
|
646
|
+
static_cast<int>(blurBounds.height()), false, 1, false, 0,
|
|
647
|
+
document->dstColorSpace());
|
|
648
|
+
DEBUG_ASSERT(surface);
|
|
649
|
+
auto canvas = surface->getCanvas();
|
|
650
|
+
|
|
651
|
+
Paint picturePaint = {};
|
|
652
|
+
picturePaint.setImageFilter(copyFilter);
|
|
653
|
+
|
|
654
|
+
auto offsetMatrix =
|
|
655
|
+
Matrix::MakeTrans(-pictureBounds.x() + offset.x, -pictureBounds.y() + offset.y);
|
|
656
|
+
canvas->drawPicture(picture, &offsetMatrix, &picturePaint);
|
|
657
|
+
|
|
658
|
+
auto image = surface->makeImageSnapshot();
|
|
659
|
+
if (image) {
|
|
660
|
+
image = image->makeTextureImage(document->context());
|
|
661
|
+
auto imageMatrix = matrix;
|
|
662
|
+
imageMatrix.postTranslate(pictureBounds.x() - offset.x + dropShadowFilter->dx,
|
|
663
|
+
pictureBounds.y() - offset.y + dropShadowFilter->dy);
|
|
664
|
+
drawImage(std::move(image), SamplingOptions(), imageMatrix, clip, brush);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
void PDFExportContext::drawInnerShadowAfterLayer(const PictureRecord* record,
|
|
669
|
+
const InnerShadowImageFilter* innerShadowFilter,
|
|
670
|
+
const Matrix& matrix, const ClipStack& clip,
|
|
671
|
+
const Matrix& currentMatrix) {
|
|
672
|
+
MeasureContext measureContext;
|
|
673
|
+
PlaybackContext playbackContext = {};
|
|
674
|
+
record->playback(&measureContext, &playbackContext);
|
|
675
|
+
auto pictureBounds = measureContext.getBounds();
|
|
676
|
+
if (pictureBounds.isEmpty()) {
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
auto surface = Surface::Make(document->context(), static_cast<int>(pictureBounds.width()),
|
|
681
|
+
static_cast<int>(pictureBounds.height()), false, 1, false, 0,
|
|
682
|
+
document->dstColorSpace());
|
|
683
|
+
DEBUG_ASSERT(surface);
|
|
684
|
+
auto canvas = surface->getCanvas();
|
|
685
|
+
canvas->translate(-pictureBounds.x(), -pictureBounds.y());
|
|
686
|
+
|
|
687
|
+
DEBUG_ASSERT(Types::Get(innerShadowFilter->blurFilter.get()) == Types::ImageFilterType::Blur);
|
|
688
|
+
const auto blurFilter =
|
|
689
|
+
static_cast<const GaussianBlurImageFilter*>(innerShadowFilter->blurFilter.get());
|
|
690
|
+
// Transform (dx, dy) as a vector through the inverse matrix (ignoring translation)
|
|
691
|
+
Matrix invertedMatrix = Matrix::I();
|
|
692
|
+
currentMatrix.invert(&invertedMatrix);
|
|
693
|
+
auto correctedDx = (innerShadowFilter->dx * invertedMatrix.getScaleX()) +
|
|
694
|
+
(innerShadowFilter->dy * invertedMatrix.getSkewX());
|
|
695
|
+
auto correctedDy = (innerShadowFilter->dx * invertedMatrix.getSkewY()) +
|
|
696
|
+
(innerShadowFilter->dy * invertedMatrix.getScaleY());
|
|
697
|
+
// Scale blur values by inverse scale. Use getAxisScales() to correctly decompose the scale
|
|
698
|
+
// factors from a matrix that may contain rotation. getScaleX/Y would give wrong values for
|
|
699
|
+
// rotated matrices (e.g., cos(45°) instead of 1.0 for pure rotation).
|
|
700
|
+
auto scales = currentMatrix.getAxisScales();
|
|
701
|
+
auto invScaleX = scales.x != 0.0f ? 1.0f / scales.x : 1.0f;
|
|
702
|
+
auto invScaleY = scales.y != 0.0f ? 1.0f / scales.y : 1.0f;
|
|
703
|
+
auto copyFilter =
|
|
704
|
+
ImageFilter::InnerShadowOnly(correctedDx, correctedDy, blurFilter->blurrinessX * invScaleX,
|
|
705
|
+
blurFilter->blurrinessY * invScaleY, innerShadowFilter->color);
|
|
706
|
+
|
|
707
|
+
Paint picturePaint = {};
|
|
708
|
+
picturePaint.setImageFilter(copyFilter);
|
|
709
|
+
|
|
710
|
+
canvas->saveLayer(&picturePaint);
|
|
711
|
+
{
|
|
712
|
+
auto surfaceContext = canvas->drawContext;
|
|
713
|
+
auto offsetMatrix = Matrix::MakeTrans(-pictureBounds.x(), -pictureBounds.y());
|
|
714
|
+
PlaybackContext tempPlaybackContext(offsetMatrix, clip);
|
|
715
|
+
record->playback(surfaceContext, &tempPlaybackContext);
|
|
716
|
+
}
|
|
717
|
+
canvas->restore();
|
|
718
|
+
|
|
719
|
+
{
|
|
720
|
+
auto image = surface->makeImageSnapshot();
|
|
721
|
+
auto imageShader = Shader::MakeImageShader(image);
|
|
722
|
+
imageShader =
|
|
723
|
+
imageShader->makeWithMatrix(Matrix::MakeTrans(pictureBounds.x(), pictureBounds.y()));
|
|
724
|
+
Matrix tempMatrix = matrix;
|
|
725
|
+
tempMatrix.preConcat(currentMatrix);
|
|
726
|
+
PlaybackContext tempPlaybackContext(tempMatrix, clip);
|
|
727
|
+
Brush tempBrush;
|
|
728
|
+
tempBrush.shader = imageShader;
|
|
729
|
+
tempPlaybackContext.setBrush(tempBrush);
|
|
730
|
+
record->playback(this, &tempPlaybackContext);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
void PDFExportContext::drawBlurLayer(const std::shared_ptr<Picture>& picture,
|
|
735
|
+
const std::shared_ptr<ImageFilter>& imageFilter,
|
|
736
|
+
const Matrix& matrix, const ClipStack& clip,
|
|
737
|
+
const Brush& brush) {
|
|
738
|
+
auto pictureBounds = picture->getBounds();
|
|
739
|
+
auto blurBounds = imageFilter->filterBounds(pictureBounds);
|
|
740
|
+
blurBounds = blurBounds.makeOutset(100, 100);
|
|
741
|
+
Point offset = {pictureBounds.x() - blurBounds.x(), pictureBounds.y() - blurBounds.y()};
|
|
742
|
+
|
|
743
|
+
auto surface = Surface::Make(document->context(), static_cast<int>(blurBounds.width()),
|
|
744
|
+
static_cast<int>(blurBounds.height()), false, 1, false, 0,
|
|
745
|
+
document->dstColorSpace());
|
|
746
|
+
DEBUG_ASSERT(surface);
|
|
747
|
+
|
|
748
|
+
Canvas* canvas = surface->getCanvas();
|
|
749
|
+
canvas->clear(Color::Transparent());
|
|
750
|
+
|
|
751
|
+
Paint picturePaint = {};
|
|
752
|
+
picturePaint.setImageFilter(imageFilter);
|
|
753
|
+
|
|
754
|
+
auto pictureMatrix = matrix;
|
|
755
|
+
pictureMatrix.postTranslate(-pictureBounds.x() + offset.x, -pictureBounds.y() + offset.y);
|
|
756
|
+
canvas->drawPicture(picture, &pictureMatrix, &picturePaint);
|
|
757
|
+
|
|
758
|
+
auto image = surface->makeImageSnapshot();
|
|
759
|
+
if (image) {
|
|
760
|
+
image = image->makeTextureImage(document->context());
|
|
761
|
+
auto imageMatrix = matrix;
|
|
762
|
+
imageMatrix.postTranslate(pictureBounds.x() - offset.x, pictureBounds.y() - offset.y);
|
|
763
|
+
drawImage(std::move(image), SamplingOptions(), imageMatrix, clip, brush);
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
void PDFExportContext::drawLayer(std::shared_ptr<Picture> picture,
|
|
768
|
+
std::shared_ptr<ImageFilter> imageFilter, const Matrix& matrix,
|
|
769
|
+
const ClipStack& clip, const Brush& brush) {
|
|
770
|
+
|
|
771
|
+
if (imageFilter) {
|
|
772
|
+
if (Types::Get(imageFilter.get()) == Types::ImageFilterType::DropShadow) {
|
|
773
|
+
const auto dropShadowFilter = static_cast<const DropShadowImageFilter*>(imageFilter.get());
|
|
774
|
+
drawDropShadowBeforeLayer(picture, dropShadowFilter, matrix, clip, brush);
|
|
775
|
+
if (!dropShadowFilter->shadowOnly) {
|
|
776
|
+
picture->playback(this, matrix, clip);
|
|
777
|
+
}
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
if (Types::Get(imageFilter.get()) == Types::ImageFilterType::InnerShadow) {
|
|
781
|
+
const auto innerShadowFilter = static_cast<const InnerShadowImageFilter*>(imageFilter.get());
|
|
782
|
+
PlaybackContext playbackContext = {};
|
|
783
|
+
Matrix currentMatrix = Matrix::I();
|
|
784
|
+
for (const auto& record : picture->records) {
|
|
785
|
+
if (!innerShadowFilter->shadowOnly) {
|
|
786
|
+
record->playback(this, &playbackContext);
|
|
787
|
+
}
|
|
788
|
+
if (record->type() == PictureRecordType::SetMatrix) {
|
|
789
|
+
const auto setMatrix = static_cast<const SetMatrix*>(record.get());
|
|
790
|
+
currentMatrix = setMatrix->matrix;
|
|
791
|
+
}
|
|
792
|
+
drawInnerShadowAfterLayer(record.get(), innerShadowFilter, matrix, clip, currentMatrix);
|
|
793
|
+
}
|
|
794
|
+
return;
|
|
795
|
+
}
|
|
796
|
+
if (Types::Get(imageFilter.get()) == Types::ImageFilterType::Blur) {
|
|
797
|
+
drawBlurLayer(picture, imageFilter, matrix, clip, brush);
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
picture->playback(this, matrix, clip);
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
std::shared_ptr<Data> PDFExportContext::getContent() {
|
|
805
|
+
// Close any graphic-state stack frames that ScopedContentEntry left open. finishContentEntry()
|
|
806
|
+
// intentionally skips drainStack() for regular blend modes so that consecutive draws can reuse
|
|
807
|
+
// the same activeStackState (and avoid re-emitting clip / cm sequences). The residual q's must
|
|
808
|
+
// still be balanced before the stream is sealed into a Form XObject or page content stream.
|
|
809
|
+
activeStackState.drainStack();
|
|
810
|
+
activeStackState = PDFGraphicStackState();
|
|
811
|
+
if (content->bytesWritten() == 0) {
|
|
812
|
+
return Data::MakeEmpty();
|
|
813
|
+
}
|
|
814
|
+
auto buffer = MemoryWriteStream::Make();
|
|
815
|
+
if (!_initialTransform.isIdentity()) {
|
|
816
|
+
PDFUtils::AppendTransform(_initialTransform, buffer);
|
|
817
|
+
}
|
|
818
|
+
if (needsExtraSave) {
|
|
819
|
+
buffer->writeText("q\n");
|
|
820
|
+
}
|
|
821
|
+
content->writeToAndReset(buffer);
|
|
822
|
+
if (needsExtraSave) {
|
|
823
|
+
buffer->writeText("Q\n");
|
|
824
|
+
}
|
|
825
|
+
needsExtraSave = false;
|
|
826
|
+
return buffer->readData();
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
void PDFExportContext::onDrawPath(const Matrix& matrix, const ClipStack& clip, const Path& path,
|
|
830
|
+
const Brush& brush) {
|
|
831
|
+
if (brush.maskFilter) {
|
|
832
|
+
this->drawPathWithFilter(matrix, clip, path, Matrix::I(), brush);
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
// Fast path for simple ImageShader rectangle fills.
|
|
837
|
+
// Keep strict constraints to avoid changing non-rectangular/path-based shader behavior.
|
|
838
|
+
Rect pathRect;
|
|
839
|
+
if (!path.isInverseFillType() && path.isRect(&pathRect) && brush.shader) {
|
|
840
|
+
auto shader = brush.shader;
|
|
841
|
+
Matrix shaderMatrix = Matrix::I();
|
|
842
|
+
bool isSimpleImageShader = true;
|
|
843
|
+
while (Types::Get(shader.get()) == Types::ShaderType::Matrix) {
|
|
844
|
+
const auto matrixShader = static_cast<const MatrixShader*>(shader.get());
|
|
845
|
+
shaderMatrix.preConcat(matrixShader->matrix);
|
|
846
|
+
shader = matrixShader->source;
|
|
847
|
+
}
|
|
848
|
+
if (Types::Get(shader.get()) != Types::ShaderType::Image) {
|
|
849
|
+
isSimpleImageShader = false;
|
|
850
|
+
}
|
|
851
|
+
if (isSimpleImageShader) {
|
|
852
|
+
const auto imageShader = static_cast<const ImageShader*>(shader.get());
|
|
853
|
+
auto image = imageShader->image;
|
|
854
|
+
if (image && imageShader->tileModeX == TileMode::Clamp &&
|
|
855
|
+
imageShader->tileModeY == TileMode::Clamp) {
|
|
856
|
+
auto mappedImageRect = Rect::MakeWH(image->width(), image->height());
|
|
857
|
+
shaderMatrix.mapRect(&mappedImageRect);
|
|
858
|
+
auto sortedPathRect = pathRect.makeSorted();
|
|
859
|
+
auto sortedMappedImageRect = mappedImageRect.makeSorted();
|
|
860
|
+
if (sortedMappedImageRect == sortedPathRect) {
|
|
861
|
+
Brush imageBrush = brush;
|
|
862
|
+
imageBrush.shader = nullptr;
|
|
863
|
+
onDrawImageRect(image, sortedMappedImageRect, imageShader->sampling, matrix, clip,
|
|
864
|
+
imageBrush);
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
ScopedContentEntry scopedContent(this, matrix, clip, Matrix::I(), brush);
|
|
872
|
+
if (!scopedContent) {
|
|
873
|
+
return;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
if (scopedContent.needShape()) {
|
|
877
|
+
Path shape(path);
|
|
878
|
+
shape.transform(matrix);
|
|
879
|
+
scopedContent.setShape(shape);
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
auto stream = scopedContent.stream();
|
|
883
|
+
PDFUtils::EmitPath(path, false, stream);
|
|
884
|
+
PDFUtils::PaintPath(path.getFillType(), stream);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
void PDFExportContext::onDrawImageRect(std::shared_ptr<Image> image, const Rect& rect,
|
|
888
|
+
const SamplingOptions& sampling, const Matrix& matrix,
|
|
889
|
+
const ClipStack& clip, const Brush& brush) {
|
|
890
|
+
if (!image) {
|
|
891
|
+
return;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
// First, figure out the src->dst transform and subset the image if needed.
|
|
895
|
+
auto bound = Rect::MakeWH(image->width(), image->height());
|
|
896
|
+
float scaleX = rect.width() / bound.width();
|
|
897
|
+
float scaleY = rect.height() / bound.height();
|
|
898
|
+
float transX = rect.left - (bound.left * scaleX);
|
|
899
|
+
float transY = rect.top - (bound.top * scaleY);
|
|
900
|
+
auto transform = Matrix::I();
|
|
901
|
+
transform.postScale(scaleX, scaleY);
|
|
902
|
+
transform.postTranslate(transX, transY);
|
|
903
|
+
|
|
904
|
+
// Alpha-only images need to get their color from the shader, before applying the colorfilter.
|
|
905
|
+
auto modifiedBrush = brush;
|
|
906
|
+
if (image->isAlphaOnly() && modifiedBrush.colorFilter) {
|
|
907
|
+
// must blend alpha image and shader before applying colorfilter.
|
|
908
|
+
auto surface = Surface::Make(document->context(), image->width(), image->height(), false, 1,
|
|
909
|
+
false, 0, document->dstColorSpace());
|
|
910
|
+
Canvas* canvas = surface->getCanvas();
|
|
911
|
+
Paint tmpPaint;
|
|
912
|
+
// In the case of alpha images with shaders, the shader's coordinate system is the image's
|
|
913
|
+
// coordiantes.
|
|
914
|
+
tmpPaint.setShader(modifiedBrush.shader);
|
|
915
|
+
tmpPaint.setColor(modifiedBrush.color);
|
|
916
|
+
canvas->clear();
|
|
917
|
+
canvas->drawImage(image, &tmpPaint);
|
|
918
|
+
if (modifiedBrush.shader != nullptr) {
|
|
919
|
+
modifiedBrush.shader = nullptr;
|
|
920
|
+
}
|
|
921
|
+
image = surface->makeImageSnapshot();
|
|
922
|
+
DEBUG_ASSERT(!image->isAlphaOnly());
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
if (image->isAlphaOnly()) {
|
|
926
|
+
// The ColorFilter applies to the paint color/shader, not the alpha layer.
|
|
927
|
+
DEBUG_ASSERT(modifiedBrush.colorFilter == nullptr);
|
|
928
|
+
|
|
929
|
+
// PDF doesn't seem to allow masking vector graphics with an Image XObject. Must mask with a
|
|
930
|
+
// Form XObject.
|
|
931
|
+
auto maskContext = PDFExportContext(ISize::Make(image->width(), image->height()), document);
|
|
932
|
+
{
|
|
933
|
+
auto canvas = PDFDocumentImpl::MakeCanvas(&maskContext);
|
|
934
|
+
// This clip prevents the mask image shader from covering entire device if unnecessary.
|
|
935
|
+
canvas->clipRect(clip.bounds());
|
|
936
|
+
if (modifiedBrush.maskFilter) {
|
|
937
|
+
Paint tmpPaint;
|
|
938
|
+
auto imageShader =
|
|
939
|
+
Shader::MakeImageShader(image, TileMode::Clamp, TileMode::Clamp, SamplingOptions());
|
|
940
|
+
imageShader = imageShader->makeWithMatrix(transform);
|
|
941
|
+
tmpPaint.setShader(imageShader);
|
|
942
|
+
tmpPaint.setMaskFilter(modifiedBrush.maskFilter);
|
|
943
|
+
canvas->drawRect(rect, tmpPaint);
|
|
944
|
+
} else {
|
|
945
|
+
canvas->concat(transform);
|
|
946
|
+
canvas->drawImage(image, sampling);
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
// SkIRect maskDeviceBounds = maskDevice->cs().bounds(maskDevice->bounds()).roundOut();
|
|
950
|
+
auto maskDeviceBounds = Rect::MakeSize(maskContext.pageSize());
|
|
951
|
+
ScopedContentEntry content(this, matrix, clip, Matrix::I(), modifiedBrush);
|
|
952
|
+
if (!content) {
|
|
953
|
+
return;
|
|
954
|
+
}
|
|
955
|
+
auto xObjext = maskContext.makeFormXObjectFromDevice(maskDeviceBounds, true);
|
|
956
|
+
auto graphicState = PDFGraphicState::GetSMaskGraphicState(
|
|
957
|
+
xObjext, false, PDFGraphicState::SMaskMode::Luminosity, document);
|
|
958
|
+
this->setGraphicState(graphicState, content.stream());
|
|
959
|
+
PDFUtils::AppendRectangle(Rect::MakeSize(_pageSize), content.stream());
|
|
960
|
+
PDFUtils::PaintPath(PathFillType::Winding, content.stream());
|
|
961
|
+
this->clearMaskOnGraphicState(content.stream());
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
964
|
+
if (modifiedBrush.maskFilter) {
|
|
965
|
+
// TODO(pdf): BackgroundBlurStyle currently lowers to (BlendMode::Src + FilterImage<Blur> +
|
|
966
|
+
// maskFilter). The PDF maskFilter path cannot express this combination correctly — running
|
|
967
|
+
// it produces visibly wrong output. Skip the draw as a temporary workaround until the PDF
|
|
968
|
+
// backend gains a proper backdrop-blur path. Add a regression test once the real path lands.
|
|
969
|
+
if (IsBackgroundBlurStylePattern(modifiedBrush, image.get())) {
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
// Convert the image into an image shader and route through onDrawPath, which emits the
|
|
973
|
+
// bitmap as a tiling pattern combined with the existing maskFilter machinery. This is the
|
|
974
|
+
// historical PDF path that supports DropShadowStyle's mask-filter case.
|
|
975
|
+
auto imageShader =
|
|
976
|
+
Shader::MakeImageShader(image, TileMode::Clamp, TileMode::Clamp, SamplingOptions());
|
|
977
|
+
imageShader = imageShader->makeWithMatrix(transform);
|
|
978
|
+
modifiedBrush.shader = imageShader;
|
|
979
|
+
|
|
980
|
+
Path path;
|
|
981
|
+
path.addRect(rect);
|
|
982
|
+
this->onDrawPath(matrix, clip, path, modifiedBrush);
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
const auto& mapMatrix = transform;
|
|
987
|
+
Matrix scaled;
|
|
988
|
+
// Adjust for origin flip.
|
|
989
|
+
scaled.setScale(1.f, -1.f);
|
|
990
|
+
scaled.postTranslate(0, 1.f);
|
|
991
|
+
// Scale the image up from 1x1 to WxH.
|
|
992
|
+
auto subset = Rect::MakeWH(image->width(), image->height());
|
|
993
|
+
scaled.postScale(subset.width(), subset.height());
|
|
994
|
+
scaled.postConcat(mapMatrix);
|
|
995
|
+
ScopedContentEntry content(this, matrix, clip, scaled, modifiedBrush);
|
|
996
|
+
if (!content) {
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
Path shape;
|
|
1000
|
+
shape.addRect(subset);
|
|
1001
|
+
shape.transform(mapMatrix);
|
|
1002
|
+
if (content.needShape()) {
|
|
1003
|
+
content.setShape(shape);
|
|
1004
|
+
}
|
|
1005
|
+
if (!content.needSource()) {
|
|
1006
|
+
return;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
if (auto colorFilter = modifiedBrush.colorFilter) {
|
|
1010
|
+
auto imageFilter = ImageFilter::ColorFilter(colorFilter);
|
|
1011
|
+
image = image->makeWithFilter(imageFilter);
|
|
1012
|
+
if (!image) {
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
PDFIndirectReference pdfImage =
|
|
1018
|
+
PDFBitmap::Serialize(image, document, document->metadata().encodingQuality);
|
|
1019
|
+
this->drawFormXObject(pdfImage, content.stream(), &shape);
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
namespace {
|
|
1023
|
+
std::vector<PDFIndirectReference> Sort(const std::unordered_set<PDFIndirectReference>& src) {
|
|
1024
|
+
std::vector<PDFIndirectReference> dst;
|
|
1025
|
+
dst.reserve(src.size());
|
|
1026
|
+
for (auto ref : src) {
|
|
1027
|
+
dst.push_back(ref);
|
|
1028
|
+
}
|
|
1029
|
+
std::sort(dst.begin(), dst.end(),
|
|
1030
|
+
[](PDFIndirectReference a, PDFIndirectReference b) { return a.value < b.value; });
|
|
1031
|
+
return dst;
|
|
1032
|
+
}
|
|
1033
|
+
} // namespace
|
|
1034
|
+
|
|
1035
|
+
std::unique_ptr<PDFDictionary> PDFExportContext::makeResourceDictionary() {
|
|
1036
|
+
auto resourceDict = MakePDFResourceDictionary(Sort(graphicStateResources), Sort(shaderResources),
|
|
1037
|
+
Sort(xObjectResources), Sort(fontResources));
|
|
1038
|
+
// Inject the document-wide /CS color space into the Resources/ColorSpace dictionary whenever a
|
|
1039
|
+
// target color space has been set. Form XObjects and Tiling Patterns own independent Resources
|
|
1040
|
+
// dictionaries (ISO 32000-1 §8.10.1, §8.7.3.3) and cannot inherit ColorSpace from the page, so
|
|
1041
|
+
// their content streams that emit "/CS CS" or "/CS cs" would fail in strict PDF readers (Adobe
|
|
1042
|
+
// Acrobat, qpdf) when /CS is not declared locally.
|
|
1043
|
+
if (auto ref = document->colorSpaceRef()) {
|
|
1044
|
+
auto colorSpaceDic = PDFDictionary::Make();
|
|
1045
|
+
colorSpaceDic->insertRef("CS", ref);
|
|
1046
|
+
resourceDict->insertObject("ColorSpace", std::move(colorSpaceDic));
|
|
1047
|
+
}
|
|
1048
|
+
return resourceDict;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
bool PDFExportContext::isContentEmpty() {
|
|
1052
|
+
return content->bytesWritten() == 0 && contentBuffer->bytesWritten() == 0;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
PDFIndirectReference PDFExportContext::makeFormXObjectFromDevice(Rect bounds, bool alpha) {
|
|
1056
|
+
auto inverseTransform = Matrix::I();
|
|
1057
|
+
if (!_initialTransform.isIdentity()) {
|
|
1058
|
+
if (!_initialTransform.invert(&inverseTransform)) {
|
|
1059
|
+
LOGE("Layer initial transform should be invertible.");
|
|
1060
|
+
inverseTransform.reset();
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
const char* colorSpace = alpha ? "DeviceGray" : nullptr;
|
|
1065
|
+
|
|
1066
|
+
auto mediaBox = MakePDFArray(static_cast<int>(bounds.left), static_cast<int>(bounds.top),
|
|
1067
|
+
static_cast<int>(bounds.right), static_cast<int>(bounds.bottom));
|
|
1068
|
+
PDFIndirectReference xObject =
|
|
1069
|
+
MakePDFFormXObject(document, getContent(), std::move(mediaBox), makeResourceDictionary(),
|
|
1070
|
+
inverseTransform, colorSpace);
|
|
1071
|
+
|
|
1072
|
+
reset();
|
|
1073
|
+
return xObject;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
PDFIndirectReference PDFExportContext::makeFormXObjectFromDevice(bool alpha) {
|
|
1077
|
+
return makeFormXObjectFromDevice(
|
|
1078
|
+
Rect{0, 0, static_cast<float>(_pageSize.width), static_cast<float>(_pageSize.height)}, alpha);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
namespace {
|
|
1082
|
+
|
|
1083
|
+
bool TreatAsRegularPDFBlendMode(BlendMode blendMode) {
|
|
1084
|
+
return PDFUtils::BlendModeName(blendMode) != nullptr;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
void PopulateGraphicStateEntryFromPaint(
|
|
1088
|
+
PDFDocumentImpl* document, const Matrix& matrix, Rect deviceBounds, const Brush& brush,
|
|
1089
|
+
const Matrix& initialTransform, float textScale, const std::shared_ptr<ColorSpace>& colorSpace,
|
|
1090
|
+
PDFGraphicStackState::Entry* entry, std::unordered_set<PDFIndirectReference>* shaderResources,
|
|
1091
|
+
std::unordered_set<PDFIndirectReference>* graphicStateResources) {
|
|
1092
|
+
|
|
1093
|
+
entry->matrix = matrix;
|
|
1094
|
+
auto color = brush.color;
|
|
1095
|
+
color.alpha = 1;
|
|
1096
|
+
entry->color = color;
|
|
1097
|
+
entry->shaderIndex = -1;
|
|
1098
|
+
|
|
1099
|
+
// PDF treats a shader as a color, so we only set one or the other.
|
|
1100
|
+
if (auto shader = brush.shader) {
|
|
1101
|
+
// note: we always present the alpha as 1 for the shader, knowing that it will be accounted for
|
|
1102
|
+
// when we create our newGraphicsState (below)
|
|
1103
|
+
if (Types::Get(shader.get()) == Types::ShaderType::Color) {
|
|
1104
|
+
const auto colorShader = static_cast<const ColorShader*>(shader.get());
|
|
1105
|
+
if (colorShader->asColor(&color)) {
|
|
1106
|
+
color.alpha = 1;
|
|
1107
|
+
entry->color = color;
|
|
1108
|
+
}
|
|
1109
|
+
} else {
|
|
1110
|
+
// PDF positions patterns relative to the initial transform, so we need to apply the current
|
|
1111
|
+
// transform to the shader parameters.
|
|
1112
|
+
auto transform = entry->matrix;
|
|
1113
|
+
transform.postConcat(initialTransform);
|
|
1114
|
+
|
|
1115
|
+
// PDF doesn't support kClamp_TileMode, so we simulate it by making a pattern the size of the
|
|
1116
|
+
// current clip.
|
|
1117
|
+
Rect clipStackBounds = deviceBounds;
|
|
1118
|
+
|
|
1119
|
+
// We need to apply the initial transform to bounds in order to get bounds in a consistent
|
|
1120
|
+
// coordinate system.
|
|
1121
|
+
initialTransform.mapRect(&clipStackBounds);
|
|
1122
|
+
clipStackBounds.roundOut();
|
|
1123
|
+
|
|
1124
|
+
PDFIndirectReference pdfShader =
|
|
1125
|
+
PDFShader::Make(document, shader, transform, clipStackBounds, color);
|
|
1126
|
+
if (pdfShader) {
|
|
1127
|
+
// pdfShader has been canonicalized so we can directly compare pointers.
|
|
1128
|
+
entry->shaderIndex = add_resource(*shaderResources, pdfShader);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
auto newGraphicState = PDFGraphicState::GetGraphicStateForPaint(document, brush);
|
|
1134
|
+
entry->graphicStateIndex = add_resource(*graphicStateResources, newGraphicState);
|
|
1135
|
+
entry->textScaleX = textScale;
|
|
1136
|
+
entry->color = ConvertColorSpace(entry->color, colorSpace);
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
} // namespace
|
|
1140
|
+
|
|
1141
|
+
std::shared_ptr<MemoryWriteStream> PDFExportContext::setUpContentEntry(
|
|
1142
|
+
const Matrix& matrix, const ClipStack& clip, const Matrix& contentExtraMatrix,
|
|
1143
|
+
const Brush& brush, float scale, PDFIndirectReference* destination) {
|
|
1144
|
+
DEBUG_ASSERT(!*destination);
|
|
1145
|
+
BlendMode blendMode = brush.blendMode;
|
|
1146
|
+
|
|
1147
|
+
if (blendMode == BlendMode::Dst) {
|
|
1148
|
+
return nullptr;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
if (!TreatAsRegularPDFBlendMode(blendMode) && blendMode != BlendMode::DstOver) {
|
|
1152
|
+
if (!isContentEmpty()) {
|
|
1153
|
+
activeStackState.drainStack();
|
|
1154
|
+
activeStackState = PDFGraphicStackState();
|
|
1155
|
+
*destination = this->makeFormXObjectFromDevice();
|
|
1156
|
+
DEBUG_ASSERT(isContentEmpty());
|
|
1157
|
+
} else if (blendMode != BlendMode::Src && blendMode != BlendMode::SrcOut) {
|
|
1158
|
+
return nullptr;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
if (TreatAsRegularPDFBlendMode(blendMode)) {
|
|
1163
|
+
if (!activeStackState.contentStream) {
|
|
1164
|
+
if (content->bytesWritten() != 0) {
|
|
1165
|
+
content->writeText("Q\nq\n");
|
|
1166
|
+
needsExtraSave = true;
|
|
1167
|
+
}
|
|
1168
|
+
activeStackState = PDFGraphicStackState(content);
|
|
1169
|
+
} else {
|
|
1170
|
+
DEBUG_ASSERT(activeStackState.contentStream == content);
|
|
1171
|
+
}
|
|
1172
|
+
} else {
|
|
1173
|
+
activeStackState.drainStack();
|
|
1174
|
+
activeStackState = PDFGraphicStackState(contentBuffer);
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
DEBUG_ASSERT(activeStackState.contentStream);
|
|
1178
|
+
auto contentMatrix = matrix * contentExtraMatrix;
|
|
1179
|
+
PDFGraphicStackState::Entry entry;
|
|
1180
|
+
PopulateGraphicStateEntryFromPaint(document, contentMatrix, Rect::MakeSize(_pageSize), brush,
|
|
1181
|
+
_initialTransform, scale, document->dstColorSpace(), &entry,
|
|
1182
|
+
&shaderResources, &graphicStateResources);
|
|
1183
|
+
activeStackState.updateMatrixClip(matrix, clip);
|
|
1184
|
+
activeStackState.updateEntryMatrix(entry.matrix);
|
|
1185
|
+
activeStackState.updateDrawingState(entry, document->colorSpaceRef());
|
|
1186
|
+
|
|
1187
|
+
return activeStackState.contentStream;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
void PDFExportContext::finishContentEntry(const Matrix& matrix, const ClipStack& clip,
|
|
1191
|
+
BlendMode blendMode, PDFIndirectReference destination,
|
|
1192
|
+
Path* path) {
|
|
1193
|
+
DEBUG_ASSERT(blendMode != BlendMode::Dst);
|
|
1194
|
+
if (TreatAsRegularPDFBlendMode(blendMode)) {
|
|
1195
|
+
DEBUG_ASSERT(!destination);
|
|
1196
|
+
return;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
DEBUG_ASSERT(activeStackState.contentStream);
|
|
1200
|
+
|
|
1201
|
+
activeStackState.drainStack();
|
|
1202
|
+
activeStackState = PDFGraphicStackState();
|
|
1203
|
+
|
|
1204
|
+
if (blendMode == BlendMode::DstOver) {
|
|
1205
|
+
DEBUG_ASSERT(!destination);
|
|
1206
|
+
if (contentBuffer->bytesWritten() != 0) {
|
|
1207
|
+
if (content->bytesWritten() != 0) {
|
|
1208
|
+
contentBuffer->writeText("Q\nq\n");
|
|
1209
|
+
needsExtraSave = true;
|
|
1210
|
+
}
|
|
1211
|
+
contentBuffer->prependToAndReset(content);
|
|
1212
|
+
DEBUG_ASSERT(contentBuffer->bytesWritten() == 0);
|
|
1213
|
+
}
|
|
1214
|
+
return;
|
|
1215
|
+
}
|
|
1216
|
+
if (contentBuffer->bytesWritten() != 0) {
|
|
1217
|
+
if (content->bytesWritten() != 0) {
|
|
1218
|
+
content->writeText("Q\nq\n");
|
|
1219
|
+
needsExtraSave = true;
|
|
1220
|
+
}
|
|
1221
|
+
contentBuffer->writeToAndReset(content);
|
|
1222
|
+
DEBUG_ASSERT(contentBuffer->bytesWritten() == 0);
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
if (!destination) {
|
|
1226
|
+
DEBUG_ASSERT((blendMode == BlendMode::Src || blendMode == BlendMode::SrcOut));
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
DEBUG_ASSERT(destination);
|
|
1231
|
+
// Changing the current content into a form-xobject will destroy the clip objects which is fine
|
|
1232
|
+
// since the xobject will already be clipped. However if source has shape, we need to clip it too,
|
|
1233
|
+
// so a copy of the clip is saved.
|
|
1234
|
+
|
|
1235
|
+
Brush stockBrush;
|
|
1236
|
+
PDFIndirectReference srcFormXObject;
|
|
1237
|
+
if (this->isContentEmpty()) {
|
|
1238
|
+
// If nothing was drawn and there's no shape, then the draw was a no-op, but dst needs to be
|
|
1239
|
+
// restored for that to be true. If there is shape, then an empty source with Src, SrcIn,
|
|
1240
|
+
// SrcOut, DstIn, DstAtop or Modulate reduces to Clear and DstOut or SrcAtop reduces to Dst.
|
|
1241
|
+
if (path == nullptr || blendMode == BlendMode::DstOut || blendMode == BlendMode::SrcATop) {
|
|
1242
|
+
ScopedContentEntry contentEntry(this, Matrix::I(), ClipStack(), Matrix::I(), stockBrush);
|
|
1243
|
+
this->drawFormXObject(destination, contentEntry.stream(), nullptr);
|
|
1244
|
+
return;
|
|
1245
|
+
} else {
|
|
1246
|
+
blendMode = BlendMode::Clear;
|
|
1247
|
+
}
|
|
1248
|
+
} else {
|
|
1249
|
+
srcFormXObject = this->makeFormXObjectFromDevice();
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
PDFIndirectReference xObject;
|
|
1253
|
+
PDFIndirectReference sMask;
|
|
1254
|
+
if (blendMode == BlendMode::SrcATop) {
|
|
1255
|
+
xObject = srcFormXObject;
|
|
1256
|
+
sMask = destination;
|
|
1257
|
+
} else {
|
|
1258
|
+
if (path != nullptr) {
|
|
1259
|
+
// Draw shape into a form-xobject.
|
|
1260
|
+
Brush filledBrush;
|
|
1261
|
+
filledBrush.color = Color::Black();
|
|
1262
|
+
PDFExportContext shapeContext(_pageSize, document, _initialTransform);
|
|
1263
|
+
shapeContext.onDrawPath(matrix, clip, *path, filledBrush);
|
|
1264
|
+
xObject = destination;
|
|
1265
|
+
sMask = shapeContext.makeFormXObjectFromDevice();
|
|
1266
|
+
} else {
|
|
1267
|
+
xObject = destination;
|
|
1268
|
+
sMask = srcFormXObject;
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
this->drawFormXObjectWithMask(xObject, sMask, BlendMode::SrcOver, true);
|
|
1272
|
+
|
|
1273
|
+
if (blendMode == BlendMode::Clear) {
|
|
1274
|
+
return;
|
|
1275
|
+
} else if (blendMode == BlendMode::Src || blendMode == BlendMode::DstATop) {
|
|
1276
|
+
ScopedContentEntry content(this, Matrix::I(), ClipStack(), Matrix::I(), stockBrush);
|
|
1277
|
+
if (content) {
|
|
1278
|
+
this->drawFormXObject(srcFormXObject, content.stream(), nullptr);
|
|
1279
|
+
}
|
|
1280
|
+
if (blendMode == BlendMode::Src) {
|
|
1281
|
+
return;
|
|
1282
|
+
}
|
|
1283
|
+
} else if (blendMode == BlendMode::SrcATop) {
|
|
1284
|
+
ScopedContentEntry content(this, Matrix::I(), ClipStack(), Matrix::I(), stockBrush);
|
|
1285
|
+
if (content) {
|
|
1286
|
+
this->drawFormXObject(destination, content.stream(), nullptr);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
DEBUG_ASSERT((blendMode == BlendMode::SrcIn || blendMode == BlendMode::DstIn ||
|
|
1291
|
+
blendMode == BlendMode::SrcOut || blendMode == BlendMode::DstOut ||
|
|
1292
|
+
blendMode == BlendMode::SrcATop || blendMode == BlendMode::DstATop ||
|
|
1293
|
+
blendMode == BlendMode::Modulate));
|
|
1294
|
+
|
|
1295
|
+
if (blendMode == BlendMode::SrcIn || blendMode == BlendMode::SrcOut ||
|
|
1296
|
+
blendMode == BlendMode::SrcATop) {
|
|
1297
|
+
this->drawFormXObjectWithMask(srcFormXObject, destination, BlendMode::SrcOver,
|
|
1298
|
+
blendMode == BlendMode::SrcOut);
|
|
1299
|
+
return;
|
|
1300
|
+
} else {
|
|
1301
|
+
auto mode = BlendMode::SrcOver;
|
|
1302
|
+
if (blendMode == BlendMode::Modulate) {
|
|
1303
|
+
this->drawFormXObjectWithMask(srcFormXObject, destination, BlendMode::SrcOver, false);
|
|
1304
|
+
mode = BlendMode::Multiply;
|
|
1305
|
+
}
|
|
1306
|
+
this->drawFormXObjectWithMask(destination, srcFormXObject, mode,
|
|
1307
|
+
blendMode == BlendMode::DstOut);
|
|
1308
|
+
return;
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
void PDFExportContext::drawFormXObject(PDFIndirectReference xObject,
|
|
1313
|
+
const std::shared_ptr<MemoryWriteStream>& stream,
|
|
1314
|
+
Path* shape) {
|
|
1315
|
+
auto point = Point::Zero();
|
|
1316
|
+
if (shape) {
|
|
1317
|
+
// Destinations are in absolute coordinates.
|
|
1318
|
+
auto pageXform = document->currentPageTransform();
|
|
1319
|
+
// The shape already has localToDevice applied.
|
|
1320
|
+
auto shapeBounds = shape->getBounds();
|
|
1321
|
+
pageXform.mapRect(&shapeBounds);
|
|
1322
|
+
point = Point{shapeBounds.left, shapeBounds.bottom};
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
DEBUG_ASSERT(xObject);
|
|
1326
|
+
PDFWriteResourceName(stream, PDFResourceType::XObject, add_resource(xObjectResources, xObject));
|
|
1327
|
+
stream->writeText(" Do\n");
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
void PDFExportContext::clearMaskOnGraphicState(const std::shared_ptr<MemoryWriteStream>& stream) {
|
|
1331
|
+
auto& noSMaskGS = document->noSmaskGraphicState;
|
|
1332
|
+
if (!noSMaskGS) {
|
|
1333
|
+
auto tmp = PDFDictionary::Make("ExtGState");
|
|
1334
|
+
tmp->insertName("SMask", "None");
|
|
1335
|
+
noSMaskGS = document->emit(*tmp);
|
|
1336
|
+
}
|
|
1337
|
+
this->setGraphicState(noSMaskGS, stream);
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
void PDFExportContext::setGraphicState(PDFIndirectReference graphicState,
|
|
1341
|
+
const std::shared_ptr<MemoryWriteStream>& stream) {
|
|
1342
|
+
PDFUtils::ApplyGraphicState(add_resource(graphicStateResources, graphicState), stream);
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
void PDFExportContext::drawFormXObjectWithMask(PDFIndirectReference xObject,
|
|
1346
|
+
PDFIndirectReference sMask, BlendMode mode,
|
|
1347
|
+
bool invertClip) {
|
|
1348
|
+
DEBUG_ASSERT(sMask);
|
|
1349
|
+
Brush brush;
|
|
1350
|
+
brush.blendMode = mode;
|
|
1351
|
+
ScopedContentEntry content(this, Matrix::I(), ClipStack(), Matrix::I(), brush);
|
|
1352
|
+
if (!content) {
|
|
1353
|
+
return;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
this->setGraphicState(PDFGraphicState::GetSMaskGraphicState(
|
|
1357
|
+
sMask, invertClip, PDFGraphicState::SMaskMode::Alpha, document),
|
|
1358
|
+
content.stream());
|
|
1359
|
+
this->drawFormXObject(xObject, content.stream(), nullptr);
|
|
1360
|
+
this->clearMaskOnGraphicState(content.stream());
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
namespace {
|
|
1364
|
+
|
|
1365
|
+
std::tuple<std::shared_ptr<Picture>, Matrix> MaskFilterToPicture(
|
|
1366
|
+
const ShaderMaskFilter* shaderMaskFilter) {
|
|
1367
|
+
auto matrix = Matrix::I();
|
|
1368
|
+
auto shader = shaderMaskFilter->getShader();
|
|
1369
|
+
while (true) {
|
|
1370
|
+
if (Types::Get(shader.get()) == Types::ShaderType::Matrix) {
|
|
1371
|
+
const auto matrixShader = static_cast<const MatrixShader*>(shader.get());
|
|
1372
|
+
matrix.postConcat(matrixShader->matrix);
|
|
1373
|
+
shader = matrixShader->source;
|
|
1374
|
+
} else if (Types::Get(shader.get()) == Types::ShaderType::Image) {
|
|
1375
|
+
const auto imageShader = static_cast<const ImageShader*>(shader.get());
|
|
1376
|
+
auto image = imageShader->image;
|
|
1377
|
+
if (Types::Get(image.get()) == Types::ImageType::Picture) {
|
|
1378
|
+
const auto pictureImage = static_cast<const PictureImage*>(imageShader->image.get());
|
|
1379
|
+
return {pictureImage->picture, matrix};
|
|
1380
|
+
}
|
|
1381
|
+
return {nullptr, Matrix::I()};
|
|
1382
|
+
} else {
|
|
1383
|
+
return {nullptr, Matrix::I()};
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
} // namespace
|
|
1389
|
+
|
|
1390
|
+
void PDFExportContext::drawPathWithFilter(const Matrix& matrix, const ClipStack& clip,
|
|
1391
|
+
const Path& originPath, const Matrix& pathExtraMatrix,
|
|
1392
|
+
const Brush& originPaint) {
|
|
1393
|
+
DEBUG_ASSERT(originPaint.maskFilter);
|
|
1394
|
+
|
|
1395
|
+
Path path(originPath);
|
|
1396
|
+
path.transform(pathExtraMatrix);
|
|
1397
|
+
auto maskBound = path.getBounds();
|
|
1398
|
+
|
|
1399
|
+
Brush paint(originPaint);
|
|
1400
|
+
|
|
1401
|
+
if (Types::Get(originPaint.maskFilter.get()) != Types::MaskFilterType::Shader) {
|
|
1402
|
+
return;
|
|
1403
|
+
}
|
|
1404
|
+
const auto shaderMaskFilter = static_cast<const ShaderMaskFilter*>(originPaint.maskFilter.get());
|
|
1405
|
+
auto [picture, pictureMatrix] = MaskFilterToPicture(shaderMaskFilter);
|
|
1406
|
+
// Inverted masks have no vector Picture representation — always rasterize as bitmap.
|
|
1407
|
+
bool useBitmapMask = !picture || shaderMaskFilter->isInverted();
|
|
1408
|
+
|
|
1409
|
+
auto maskContext = makeCongruentDevice();
|
|
1410
|
+
if (useBitmapMask) {
|
|
1411
|
+
auto surface = Surface::Make(document->context(), static_cast<int>(maskBound.width()),
|
|
1412
|
+
static_cast<int>(maskBound.height()), false, 1, false, 0,
|
|
1413
|
+
document->dstColorSpace());
|
|
1414
|
+
Canvas* maskCanvas = surface->getCanvas();
|
|
1415
|
+
Paint maskPaint;
|
|
1416
|
+
// Compensate for maskBound offset: the mask shader's coordinates are in the path's
|
|
1417
|
+
// coordinate space (which starts at maskBound.x/y), but the surface starts at (0,0).
|
|
1418
|
+
// Apply an inverse translation to the shader so it samples from the correct region.
|
|
1419
|
+
auto shader = shaderMaskFilter->getShader();
|
|
1420
|
+
if (maskBound.x() != 0 || maskBound.y() != 0) {
|
|
1421
|
+
shader = shader->makeWithMatrix(Matrix::MakeTrans(-maskBound.x(), -maskBound.y()));
|
|
1422
|
+
}
|
|
1423
|
+
maskPaint.setShader(shader);
|
|
1424
|
+
maskCanvas->drawPaint(maskPaint);
|
|
1425
|
+
|
|
1426
|
+
auto grayscaleInfo = ImageInfo::Make(surface->width(), surface->height(), ColorType::ALPHA_8);
|
|
1427
|
+
auto byteSize = grayscaleInfo.byteSize();
|
|
1428
|
+
void* pixels = malloc(byteSize);
|
|
1429
|
+
if (!surface->readPixels(grayscaleInfo, pixels)) {
|
|
1430
|
+
free(pixels);
|
|
1431
|
+
return;
|
|
1432
|
+
}
|
|
1433
|
+
// Convert ALPHA_8 pixels to RGBA to avoid GPU texture upload issues.
|
|
1434
|
+
// Gray_8 and ALPHA_8 formats both trigger texture upload attempts, which fail for CPU-only data.
|
|
1435
|
+
// Instead, convert to RGBA_8888 so PDF serialization can handle it without GPU.
|
|
1436
|
+
int w = static_cast<int>(maskBound.width());
|
|
1437
|
+
int h = static_cast<int>(maskBound.height());
|
|
1438
|
+
auto rgbaInfo = ImageInfo::Make(w, h, ColorType::RGBA_8888, AlphaType::Unpremultiplied);
|
|
1439
|
+
auto rgbaSize = rgbaInfo.byteSize();
|
|
1440
|
+
auto* rgbaPixels = static_cast<uint8_t*>(malloc(rgbaSize));
|
|
1441
|
+
auto* alphaPixels = static_cast<const uint8_t*>(pixels);
|
|
1442
|
+
for (int i = 0; i < w * h; ++i) {
|
|
1443
|
+
// PDF SMask has no native inversion support, so we invert the pixel values directly.
|
|
1444
|
+
uint8_t a = shaderMaskFilter->isInverted() ? static_cast<uint8_t>(255 - alphaPixels[i])
|
|
1445
|
+
: alphaPixels[i];
|
|
1446
|
+
// Replicate alpha to RGB channels for luminosity blending in PDF
|
|
1447
|
+
rgbaPixels[i * 4 + 0] = a;
|
|
1448
|
+
rgbaPixels[i * 4 + 1] = a;
|
|
1449
|
+
rgbaPixels[i * 4 + 2] = a;
|
|
1450
|
+
rgbaPixels[i * 4 + 3] = 255; // Full opacity
|
|
1451
|
+
}
|
|
1452
|
+
free(pixels); // Release ALPHA_8 data
|
|
1453
|
+
|
|
1454
|
+
auto rgbaData = Data::MakeAdopted(rgbaPixels, rgbaSize, Data::FreeProc);
|
|
1455
|
+
auto maskImage = Image::MakeFrom(rgbaInfo, rgbaData);
|
|
1456
|
+
|
|
1457
|
+
// PDF doesn't seem to allow masking vector graphics with an Image XObject.
|
|
1458
|
+
// Must mask with a Form XObject.
|
|
1459
|
+
{
|
|
1460
|
+
Canvas canvas(maskContext.get());
|
|
1461
|
+
canvas.drawImage(maskImage, maskBound.x(), maskBound.y());
|
|
1462
|
+
}
|
|
1463
|
+
} else {
|
|
1464
|
+
Canvas canvas(maskContext.get());
|
|
1465
|
+
canvas.concat(pictureMatrix);
|
|
1466
|
+
canvas.drawPicture(picture);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
if (!matrix.isIdentity() && paint.shader) {
|
|
1470
|
+
paint.shader = paint.shader->makeWithMatrix(pathExtraMatrix);
|
|
1471
|
+
}
|
|
1472
|
+
ScopedContentEntry contentEntry(this, matrix, clip, Matrix::I(), paint);
|
|
1473
|
+
if (!contentEntry) {
|
|
1474
|
+
return;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
setGraphicState(PDFGraphicState::GetSMaskGraphicState(
|
|
1478
|
+
maskContext->makeFormXObjectFromDevice(maskBound, true), false,
|
|
1479
|
+
useBitmapMask ? PDFGraphicState::SMaskMode::Luminosity
|
|
1480
|
+
: PDFGraphicState::SMaskMode::Alpha,
|
|
1481
|
+
document),
|
|
1482
|
+
contentEntry.stream());
|
|
1483
|
+
|
|
1484
|
+
PDFUtils::EmitPath(path, false, contentEntry.stream());
|
|
1485
|
+
|
|
1486
|
+
PDFUtils::PaintPath(path.getFillType(), contentEntry.stream());
|
|
1487
|
+
clearMaskOnGraphicState(contentEntry.stream());
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
} // namespace tgfx
|