@shopify/react-native-skia 2.3.5 → 2.3.7
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/android/CMakeLists.txt +12 -20
 - package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +0 -1
 - package/apple/SkiaCVPixelBufferUtils.mm +4 -8
 - package/cpp/api/JsiSkCanvas.h +8 -0
 - package/cpp/api/JsiSkTextStyle.h +1 -1
 - package/cpp/api/recorder/Drawings.h +1 -30
 - package/cpp/api/recorder/RNRecorder.h +17 -2
 - package/cpp/jsi/RuntimeLifecycleMonitor.cpp +27 -12
 - package/cpp/rnskia/RNDawnContext.h +9 -3
 - package/lib/commonjs/skia/types/Canvas.d.ts +6 -1
 - package/lib/commonjs/skia/types/Canvas.js.map +1 -1
 - package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -0
 - package/lib/commonjs/skia/web/JsiSkCanvas.js +3 -0
 - package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
 - package/lib/module/skia/types/Canvas.d.ts +6 -1
 - package/lib/module/skia/types/Canvas.js.map +1 -1
 - package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -0
 - package/lib/module/skia/web/JsiSkCanvas.js +3 -0
 - package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
 - package/lib/typescript/lib/commonjs/skia/web/JsiSkCanvas.d.ts +2 -0
 - package/lib/typescript/lib/module/skia/web/JsiSkCanvas.d.ts +2 -0
 - package/lib/typescript/src/skia/types/Canvas.d.ts +6 -1
 - package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -0
 - package/package.json +22 -3
 - package/scripts/install-skia.mjs +323 -79
 - package/src/skia/types/Canvas.ts +7 -1
 - package/src/skia/web/JsiSkCanvas.ts +7 -0
 
    
        package/android/CMakeLists.txt
    CHANGED
    
    | 
         @@ -11,35 +11,27 @@ set (SKIA_LIBS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../libs/android/${ANDROID_ABI}" 
     | 
|
| 
       11 
11 
     | 
    
         
             
            add_library(skia STATIC IMPORTED)
         
     | 
| 
       12 
12 
     | 
    
         
             
            set_property(TARGET skia PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libskia.a")
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
     | 
    
         
            -
            # Check if Graphite symbols are available in libskia using nm 
     | 
| 
      
 14 
     | 
    
         
            +
            # Check if Graphite symbols are available in libskia using nm
         
     | 
| 
       15 
15 
     | 
    
         
             
            set(SK_GRAPHITE_AVAILABLE OFF)
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
            if(EXISTS "${SKIA_LIBS_PATH}/libskia.a")
         
     | 
| 
       18 
18 
     | 
    
         
             
                # Look for specific Dawn function symbols that indicate Graphite support
         
     | 
| 
       19 
     | 
    
         
            -
                 
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
                    ERROR_QUIET
         
     | 
| 
       24 
     | 
    
         
            -
                    RESULT_VARIABLE NM_RESULT
         
     | 
| 
       25 
     | 
    
         
            -
                )
         
     | 
| 
       26 
     | 
    
         
            -
                
         
     | 
| 
       27 
     | 
    
         
            -
                if(NM_RESULT EQUAL 0 AND NOT "${NM_OUTPUT}" STREQUAL "")
         
     | 
| 
       28 
     | 
    
         
            -
                    set(SK_GRAPHITE_AVAILABLE ON)
         
     | 
| 
       29 
     | 
    
         
            -
                else()
         
     | 
| 
       30 
     | 
    
         
            -
                    # Fallback to objdump if nm doesn't work
         
     | 
| 
      
 19 
     | 
    
         
            +
                # Check each symbol individually for better reliability
         
     | 
| 
      
 20 
     | 
    
         
            +
                set(DAWN_SYMBOLS "dawn::" "wgpu" "_ZN4dawn" "DawnDevice" "dawn_native")
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                foreach(SYMBOL ${DAWN_SYMBOLS})
         
     | 
| 
       31 
23 
     | 
    
         
             
                    execute_process(
         
     | 
| 
       32 
     | 
    
         
            -
                        COMMAND  
     | 
| 
       33 
     | 
    
         
            -
                         
     | 
| 
       34 
     | 
    
         
            -
                        OUTPUT_VARIABLE OBJDUMP_OUTPUT
         
     | 
| 
      
 24 
     | 
    
         
            +
                        COMMAND sh -c "nm '${SKIA_LIBS_PATH}/libskia.a' 2>/dev/null | grep '${SYMBOL}'"
         
     | 
| 
      
 25 
     | 
    
         
            +
                        OUTPUT_VARIABLE NM_OUTPUT
         
     | 
| 
       35 
26 
     | 
    
         
             
                        ERROR_QUIET
         
     | 
| 
       36 
     | 
    
         
            -
                        RESULT_VARIABLE  
     | 
| 
      
 27 
     | 
    
         
            +
                        RESULT_VARIABLE NM_RESULT
         
     | 
| 
       37 
28 
     | 
    
         
             
                    )
         
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
                    if( 
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                    if(NM_RESULT EQUAL 0 AND NOT "${NM_OUTPUT}" STREQUAL "")
         
     | 
| 
       40 
31 
     | 
    
         
             
                        set(SK_GRAPHITE_AVAILABLE ON)
         
     | 
| 
      
 32 
     | 
    
         
            +
                        break()
         
     | 
| 
       41 
33 
     | 
    
         
             
                    endif()
         
     | 
| 
       42 
     | 
    
         
            -
                 
     | 
| 
      
 34 
     | 
    
         
            +
                endforeach()
         
     | 
| 
       43 
35 
     | 
    
         
             
            endif()
         
     | 
| 
       44 
36 
     | 
    
         | 
| 
       45 
37 
     | 
    
         
             
            if(SK_GRAPHITE_AVAILABLE)
         
     | 
| 
         @@ -30,16 +30,12 @@ 
     | 
|
| 
       30 
30 
     | 
    
         
             
            #include <TargetConditionals.h>
         
     | 
| 
       31 
31 
     | 
    
         
             
            #if TARGET_RT_BIG_ENDIAN
         
     | 
| 
       32 
32 
     | 
    
         
             
            #define FourCC2Str(fourcc)                                                     \
         
     | 
| 
       33 
     | 
    
         
            -
              (const char[])  
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
                    *(((char *)&fourcc) + 3), 0                                            \
         
     | 
| 
       36 
     | 
    
         
            -
              }
         
     | 
| 
      
 33 
     | 
    
         
            +
              (const char[]){*((char *)&fourcc), *(((char *)&fourcc) + 1),                 \
         
     | 
| 
      
 34 
     | 
    
         
            +
                             *(((char *)&fourcc) + 2), *(((char *)&fourcc) + 3), 0}
         
     | 
| 
       37 
35 
     | 
    
         
             
            #else
         
     | 
| 
       38 
36 
     | 
    
         
             
            #define FourCC2Str(fourcc)                                                     \
         
     | 
| 
       39 
     | 
    
         
            -
              (const char[])  
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
                    *(((char *)&fourcc) + 1), *(((char *)&fourcc) + 0), 0                  \
         
     | 
| 
       42 
     | 
    
         
            -
              }
         
     | 
| 
      
 37 
     | 
    
         
            +
              (const char[]){*(((char *)&fourcc) + 3), *(((char *)&fourcc) + 2),           \
         
     | 
| 
      
 38 
     | 
    
         
            +
                             *(((char *)&fourcc) + 1), *(((char *)&fourcc) + 0), 0}
         
     | 
| 
       43 
39 
     | 
    
         
             
            #endif
         
     | 
| 
       44 
40 
     | 
    
         | 
| 
       45 
41 
     | 
    
         
             
            // pragma MARK: TextureHolder
         
     | 
    
        package/cpp/api/JsiSkCanvas.h
    CHANGED
    
    | 
         @@ -241,6 +241,13 @@ public: 
     | 
|
| 
       241 
241 
     | 
    
         
             
                return static_cast<int>(_canvas->getSaveCount());
         
     | 
| 
       242 
242 
     | 
    
         
             
              }
         
     | 
| 
       243 
243 
     | 
    
         | 
| 
      
 244 
     | 
    
         
            +
              JSI_HOST_FUNCTION(getTotalMatrix) {
         
     | 
| 
      
 245 
     | 
    
         
            +
                auto matrix =
         
     | 
| 
      
 246 
     | 
    
         
            +
                    std::make_shared<JsiSkMatrix>(getContext(), _canvas->getTotalMatrix());
         
     | 
| 
      
 247 
     | 
    
         
            +
                return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(runtime, matrix,
         
     | 
| 
      
 248 
     | 
    
         
            +
                                                                   getContext());
         
     | 
| 
      
 249 
     | 
    
         
            +
              }
         
     | 
| 
      
 250 
     | 
    
         
            +
             
     | 
| 
       244 
251 
     | 
    
         
             
              JSI_HOST_FUNCTION(drawPoints) {
         
     | 
| 
       245 
252 
     | 
    
         
             
                auto pointMode = arguments[0].asNumber();
         
     | 
| 
       246 
253 
     | 
    
         
             
                std::vector<SkPoint> points;
         
     | 
| 
         @@ -660,6 +667,7 @@ public: 
     | 
|
| 
       660 
667 
     | 
    
         
             
                                   JSI_EXPORT_FUNC(JsiSkCanvas, drawOval),
         
     | 
| 
       661 
668 
     | 
    
         
             
                                   JSI_EXPORT_FUNC(JsiSkCanvas, restoreToCount),
         
     | 
| 
       662 
669 
     | 
    
         
             
                                   JSI_EXPORT_FUNC(JsiSkCanvas, getSaveCount),
         
     | 
| 
      
 670 
     | 
    
         
            +
                                   JSI_EXPORT_FUNC(JsiSkCanvas, getTotalMatrix),
         
     | 
| 
       663 
671 
     | 
    
         
             
                                   JSI_EXPORT_FUNC(JsiSkCanvas, drawPoints),
         
     | 
| 
       664 
672 
     | 
    
         
             
                                   JSI_EXPORT_FUNC(JsiSkCanvas, drawPatch),
         
     | 
| 
       665 
673 
     | 
    
         
             
                                   JSI_EXPORT_FUNC(JsiSkCanvas, drawPath),
         
     | 
    
        package/cpp/api/JsiSkTextStyle.h
    CHANGED
    
    | 
         @@ -137,7 +137,7 @@ public: 
     | 
|
| 
       137 
137 
     | 
    
         
             
                }
         
     | 
| 
       138 
138 
     | 
    
         
             
                if (object.hasProperty(runtime, "halfLeading")) {
         
     | 
| 
       139 
139 
     | 
    
         
             
                  auto propValue = object.getProperty(runtime, "halfLeading");
         
     | 
| 
       140 
     | 
    
         
            -
                  retVal.setHalfLeading(propValue. 
     | 
| 
      
 140 
     | 
    
         
            +
                  retVal.setHalfLeading(propValue.getBool());
         
     | 
| 
       141 
141 
     | 
    
         
             
                }
         
     | 
| 
       142 
142 
     | 
    
         
             
                if (object.hasProperty(runtime, "letterSpacing")) {
         
     | 
| 
       143 
143 
     | 
    
         
             
                  auto propValue = object.getProperty(runtime, "letterSpacing");
         
     | 
| 
         @@ -486,17 +486,6 @@ public: 
     | 
|
| 
       486 
486 
     | 
    
         
             
                convertProperty(runtime, object, "rect", props.rect, variables);
         
     | 
| 
       487 
487 
     | 
    
         
             
              }
         
     | 
| 
       488 
488 
     | 
    
         | 
| 
       489 
     | 
    
         
            -
              ~ImageCmd() {
         
     | 
| 
       490 
     | 
    
         
            -
                if (props.image.has_value()) {
         
     | 
| 
       491 
     | 
    
         
            -
                  auto image = props.image.value();
         
     | 
| 
       492 
     | 
    
         
            -
                  if (image) {
         
     | 
| 
       493 
     | 
    
         
            -
                    _context->runOnMainThread([image]() {
         
     | 
| 
       494 
     | 
    
         
            -
                      // Image will be deleted when this lambda is destroyed on main thread
         
     | 
| 
       495 
     | 
    
         
            -
                    });
         
     | 
| 
       496 
     | 
    
         
            -
                  }
         
     | 
| 
       497 
     | 
    
         
            -
                }
         
     | 
| 
       498 
     | 
    
         
            -
              }
         
     | 
| 
       499 
     | 
    
         
            -
             
     | 
| 
       500 
489 
     | 
    
         
             
              void draw(DrawingCtx *ctx) {
         
     | 
| 
       501 
490 
     | 
    
         
             
                auto [x, y, width, height, rect, fit, image, sampling] = props;
         
     | 
| 
       502 
491 
     | 
    
         
             
                if (image.has_value()) {
         
     | 
| 
         @@ -806,15 +795,6 @@ public: 
     | 
|
| 
       806 
795 
     | 
    
         
             
                convertProperty(runtime, object, "picture", props.picture, variables);
         
     | 
| 
       807 
796 
     | 
    
         
             
              }
         
     | 
| 
       808 
797 
     | 
    
         | 
| 
       809 
     | 
    
         
            -
              ~PictureCmd() {
         
     | 
| 
       810 
     | 
    
         
            -
                auto picture = props.picture;
         
     | 
| 
       811 
     | 
    
         
            -
                if (picture) {
         
     | 
| 
       812 
     | 
    
         
            -
                  _context->runOnMainThread([picture]() {
         
     | 
| 
       813 
     | 
    
         
            -
                    // Picture will be deleted when this lambda is destroyed on main thread
         
     | 
| 
       814 
     | 
    
         
            -
                  });
         
     | 
| 
       815 
     | 
    
         
            -
                }
         
     | 
| 
       816 
     | 
    
         
            -
              }
         
     | 
| 
       817 
     | 
    
         
            -
             
     | 
| 
       818 
798 
     | 
    
         
             
              void draw(DrawingCtx *ctx) { ctx->canvas->drawPicture(props.picture); }
         
     | 
| 
       819 
799 
     | 
    
         
             
            };
         
     | 
| 
       820 
800 
     | 
    
         | 
| 
         @@ -951,15 +931,6 @@ public: 
     | 
|
| 
       951 
931 
     | 
    
         
             
                convertProperty(runtime, object, "sampling", props.sampling, variables);
         
     | 
| 
       952 
932 
     | 
    
         
             
              }
         
     | 
| 
       953 
933 
     | 
    
         | 
| 
       954 
     | 
    
         
            -
              ~AtlasCmd() {
         
     | 
| 
       955 
     | 
    
         
            -
                auto image = props.image;
         
     | 
| 
       956 
     | 
    
         
            -
                if (image) {
         
     | 
| 
       957 
     | 
    
         
            -
                  _context->runOnMainThread([image]() {
         
     | 
| 
       958 
     | 
    
         
            -
                    // Image will be deleted when this lambda is destroyed on main thread
         
     | 
| 
       959 
     | 
    
         
            -
                  });
         
     | 
| 
       960 
     | 
    
         
            -
                }
         
     | 
| 
       961 
     | 
    
         
            -
              }
         
     | 
| 
       962 
     | 
    
         
            -
             
     | 
| 
       963 
934 
     | 
    
         
             
              void draw(DrawingCtx *ctx) {
         
     | 
| 
       964 
935 
     | 
    
         
             
                if (props.image) {
         
     | 
| 
       965 
936 
     | 
    
         
             
                  // Validate transforms and sprites have the same size
         
     | 
| 
         @@ -990,4 +961,4 @@ public: 
     | 
|
| 
       990 
961 
     | 
    
         
             
              }
         
     | 
| 
       991 
962 
     | 
    
         
             
            };
         
     | 
| 
       992 
963 
     | 
    
         | 
| 
       993 
     | 
    
         
            -
            } // namespace RNSkia
         
     | 
| 
      
 964 
     | 
    
         
            +
            } // namespace RNSkia
         
     | 
| 
         @@ -29,7 +29,22 @@ public: 
     | 
|
| 
       29 
29 
     | 
    
         
             
              Variables variables;
         
     | 
| 
       30 
30 
     | 
    
         | 
| 
       31 
31 
     | 
    
         
             
              Recorder() = default;
         
     | 
| 
       32 
     | 
    
         
            -
              ~Recorder()  
     | 
| 
      
 32 
     | 
    
         
            +
              ~Recorder() {
         
     | 
| 
      
 33 
     | 
    
         
            +
                if (!_context || commands.empty()) {
         
     | 
| 
      
 34 
     | 
    
         
            +
                  return;
         
     | 
| 
      
 35 
     | 
    
         
            +
                }
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                auto context = _context;
         
     | 
| 
      
 38 
     | 
    
         
            +
                using CommandList = std::vector<std::unique_ptr<Command>>;
         
     | 
| 
      
 39 
     | 
    
         
            +
                auto pendingCommands = std::make_shared<CommandList>(std::move(commands));
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                context->runOnMainThread(
         
     | 
| 
      
 42 
     | 
    
         
            +
                    [pendingCommands = std::move(pendingCommands)]() mutable {
         
     | 
| 
      
 43 
     | 
    
         
            +
                      // Destroy the recorded commands on the main thread to ensure GPU
         
     | 
| 
      
 44 
     | 
    
         
            +
                      // backed resources release safely.
         
     | 
| 
      
 45 
     | 
    
         
            +
                      pendingCommands->clear();
         
     | 
| 
      
 46 
     | 
    
         
            +
                    });
         
     | 
| 
      
 47 
     | 
    
         
            +
              }
         
     | 
| 
       33 
48 
     | 
    
         | 
| 
       34 
49 
     | 
    
         
             
              void savePaint(jsi::Runtime &runtime, const jsi::Object &props,
         
     | 
| 
       35 
50 
     | 
    
         
             
                             bool standalone) {
         
     | 
| 
         @@ -652,4 +667,4 @@ public: 
     | 
|
| 
       652 
667 
     | 
    
         
             
              }
         
     | 
| 
       653 
668 
     | 
    
         
             
            };
         
     | 
| 
       654 
669 
     | 
    
         | 
| 
       655 
     | 
    
         
            -
            } // namespace RNSkia
         
     | 
| 
      
 670 
     | 
    
         
            +
            } // namespace RNSkia
         
     | 
| 
         @@ -1,5 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #include "RuntimeLifecycleMonitor.h"
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            #include <mutex>
         
     | 
| 
       3 
4 
     | 
    
         
             
            #include <unordered_map>
         
     | 
| 
       4 
5 
     | 
    
         
             
            #include <unordered_set>
         
     | 
| 
       5 
6 
     | 
    
         
             
            #include <utility>
         
     | 
| 
         @@ -9,25 +10,43 @@ namespace RNJsi { 
     | 
|
| 
       9 
10 
     | 
    
         
             
            static std::unordered_map<jsi::Runtime *,
         
     | 
| 
       10 
11 
     | 
    
         
             
                                      std::unordered_set<RuntimeLifecycleListener *>>
         
     | 
| 
       11 
12 
     | 
    
         
             
                listeners;
         
     | 
| 
      
 13 
     | 
    
         
            +
            static std::mutex listenersMutex;
         
     | 
| 
       12 
14 
     | 
    
         | 
| 
       13 
15 
     | 
    
         
             
            struct RuntimeLifecycleMonitorObject : public jsi::HostObject {
         
     | 
| 
       14 
16 
     | 
    
         
             
              jsi::Runtime *_rt;
         
     | 
| 
       15 
17 
     | 
    
         
             
              explicit RuntimeLifecycleMonitorObject(jsi::Runtime *rt) : _rt(rt) {}
         
     | 
| 
       16 
18 
     | 
    
         
             
              ~RuntimeLifecycleMonitorObject() {
         
     | 
| 
       17 
     | 
    
         
            -
                 
     | 
| 
       18 
     | 
    
         
            -
                 
     | 
| 
       19 
     | 
    
         
            -
                   
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
      
 19 
     | 
    
         
            +
                std::unordered_set<RuntimeLifecycleListener *> listenersCopy;
         
     | 
| 
      
 20 
     | 
    
         
            +
                {
         
     | 
| 
      
 21 
     | 
    
         
            +
                  std::lock_guard<std::mutex> lock(listenersMutex);
         
     | 
| 
      
 22 
     | 
    
         
            +
                  auto listenersSet = listeners.find(_rt);
         
     | 
| 
      
 23 
     | 
    
         
            +
                  if (listenersSet != listeners.end()) {
         
     | 
| 
      
 24 
     | 
    
         
            +
                    listenersCopy = listenersSet->second;
         
     | 
| 
      
 25 
     | 
    
         
            +
                    listeners.erase(listenersSet);
         
     | 
| 
       21 
26 
     | 
    
         
             
                  }
         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
      
 27 
     | 
    
         
            +
                }
         
     | 
| 
      
 28 
     | 
    
         
            +
                for (auto listener : listenersCopy) {
         
     | 
| 
      
 29 
     | 
    
         
            +
                  listener->onRuntimeDestroyed(_rt);
         
     | 
| 
       23 
30 
     | 
    
         
             
                }
         
     | 
| 
       24 
31 
     | 
    
         
             
              }
         
     | 
| 
       25 
32 
     | 
    
         
             
            };
         
     | 
| 
       26 
33 
     | 
    
         | 
| 
       27 
34 
     | 
    
         
             
            void RuntimeLifecycleMonitor::addListener(jsi::Runtime &rt,
         
     | 
| 
       28 
35 
     | 
    
         
             
                                                      RuntimeLifecycleListener *listener) {
         
     | 
| 
       29 
     | 
    
         
            -
               
     | 
| 
       30 
     | 
    
         
            -
               
     | 
| 
      
 36 
     | 
    
         
            +
              bool shouldInstallMonitor = false;
         
     | 
| 
      
 37 
     | 
    
         
            +
              {
         
     | 
| 
      
 38 
     | 
    
         
            +
                std::lock_guard<std::mutex> lock(listenersMutex);
         
     | 
| 
      
 39 
     | 
    
         
            +
                auto listenersSet = listeners.find(&rt);
         
     | 
| 
      
 40 
     | 
    
         
            +
                if (listenersSet == listeners.end()) {
         
     | 
| 
      
 41 
     | 
    
         
            +
                  std::unordered_set<RuntimeLifecycleListener *> newSet;
         
     | 
| 
      
 42 
     | 
    
         
            +
                  newSet.insert(listener);
         
     | 
| 
      
 43 
     | 
    
         
            +
                  listeners.emplace(&rt, std::move(newSet));
         
     | 
| 
      
 44 
     | 
    
         
            +
                  shouldInstallMonitor = true;
         
     | 
| 
      
 45 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 46 
     | 
    
         
            +
                  listenersSet->second.insert(listener);
         
     | 
| 
      
 47 
     | 
    
         
            +
                }
         
     | 
| 
      
 48 
     | 
    
         
            +
              }
         
     | 
| 
      
 49 
     | 
    
         
            +
              if (shouldInstallMonitor) {
         
     | 
| 
       31 
50 
     | 
    
         
             
                // We install a global host object in the provided runtime, this way we can
         
     | 
| 
       32 
51 
     | 
    
         
             
                // use that host object destructor to get notified when the runtime is being
         
     | 
| 
       33 
52 
     | 
    
         
             
                // terminated. We use a unique name for the object as it gets saved with the
         
     | 
| 
         @@ -36,16 +55,12 @@ void RuntimeLifecycleMonitor::addListener(jsi::Runtime &rt, 
     | 
|
| 
       36 
55 
     | 
    
         
             
                    rt, "__rnskia_rt_lifecycle_monitor",
         
     | 
| 
       37 
56 
     | 
    
         
             
                    jsi::Object::createFromHostObject(
         
     | 
| 
       38 
57 
     | 
    
         
             
                        rt, std::make_shared<RuntimeLifecycleMonitorObject>(&rt)));
         
     | 
| 
       39 
     | 
    
         
            -
                std::unordered_set<RuntimeLifecycleListener *> newSet;
         
     | 
| 
       40 
     | 
    
         
            -
                newSet.insert(listener);
         
     | 
| 
       41 
     | 
    
         
            -
                listeners.emplace(&rt, std::move(newSet));
         
     | 
| 
       42 
     | 
    
         
            -
              } else {
         
     | 
| 
       43 
     | 
    
         
            -
                listenersSet->second.insert(listener);
         
     | 
| 
       44 
58 
     | 
    
         
             
              }
         
     | 
| 
       45 
59 
     | 
    
         
             
            }
         
     | 
| 
       46 
60 
     | 
    
         | 
| 
       47 
61 
     | 
    
         
             
            void RuntimeLifecycleMonitor::removeListener(
         
     | 
| 
       48 
62 
     | 
    
         
             
                jsi::Runtime &rt, RuntimeLifecycleListener *listener) {
         
     | 
| 
      
 63 
     | 
    
         
            +
              std::lock_guard<std::mutex> lock(listenersMutex);
         
     | 
| 
       49 
64 
     | 
    
         
             
              auto listenersSet = listeners.find(&rt);
         
     | 
| 
       50 
65 
     | 
    
         
             
              if (listenersSet == listeners.end()) {
         
     | 
| 
       51 
66 
     | 
    
         
             
                // nothing to do here
         
     | 
| 
         @@ -203,9 +203,15 @@ private: 
     | 
|
| 
       203 
203 
     | 
    
         
             
              DawnContext() {
         
     | 
| 
       204 
204 
     | 
    
         
             
                DawnProcTable backendProcs = dawn::native::GetProcs();
         
     | 
| 
       205 
205 
     | 
    
         
             
                dawnProcSetProcs(&backendProcs);
         
     | 
| 
       206 
     | 
    
         
            -
                 
     | 
| 
       207 
     | 
    
         
            -
             
     | 
| 
       208 
     | 
    
         
            -
                 
     | 
| 
      
 206 
     | 
    
         
            +
                static const auto kTimedWaitAny = wgpu::InstanceFeatureName::TimedWaitAny;
         
     | 
| 
      
 207 
     | 
    
         
            +
             
     | 
| 
      
 208 
     | 
    
         
            +
                wgpu::InstanceDescriptor instanceDesc{.requiredFeatureCount = 1,
         
     | 
| 
      
 209 
     | 
    
         
            +
                                                      .requiredFeatures = &kTimedWaitAny};
         
     | 
| 
      
 210 
     | 
    
         
            +
             
     | 
| 
      
 211 
     | 
    
         
            +
                // For limits:
         
     | 
| 
      
 212 
     | 
    
         
            +
                wgpu::InstanceLimits limits{.timedWaitAnyMaxCount = 64};
         
     | 
| 
      
 213 
     | 
    
         
            +
                instanceDesc.requiredLimits = &limits;
         
     | 
| 
      
 214 
     | 
    
         
            +
                instance = std::make_unique<dawn::native::Instance>(&instanceDesc);
         
     | 
| 
       209 
215 
     | 
    
         | 
| 
       210 
216 
     | 
    
         
             
                backendContext = DawnUtils::createDawnBackendContext(instance.get());
         
     | 
| 
       211 
217 
     | 
    
         | 
| 
         @@ -8,7 +8,7 @@ import type { SkColor } from "./Color"; 
     | 
|
| 
       8 
8 
     | 
    
         
             
            import type { InputRRect } from "./RRect";
         
     | 
| 
       9 
9 
     | 
    
         
             
            import type { BlendMode } from "./Paint/BlendMode";
         
     | 
| 
       10 
10 
     | 
    
         
             
            import type { SkPoint, PointMode } from "./Point";
         
     | 
| 
       11 
     | 
    
         
            -
            import type { InputMatrix } from "./Matrix";
         
     | 
| 
      
 11 
     | 
    
         
            +
            import type { InputMatrix, SkMatrix } from "./Matrix";
         
     | 
| 
       12 
12 
     | 
    
         
             
            import type { SkImageFilter } from "./ImageFilter";
         
     | 
| 
       13 
13 
     | 
    
         
             
            import type { SkVertices } from "./Vertices";
         
     | 
| 
       14 
14 
     | 
    
         
             
            import type { SkTextBlob } from "./TextBlob";
         
     | 
| 
         @@ -167,6 +167,11 @@ export interface SkCanvas { 
     | 
|
| 
       167 
167 
     | 
    
         
             
                 * @param saveCount
         
     | 
| 
       168 
168 
     | 
    
         
             
                 */
         
     | 
| 
       169 
169 
     | 
    
         
             
                restoreToCount(saveCount: number): void;
         
     | 
| 
      
 170 
     | 
    
         
            +
                /**
         
     | 
| 
      
 171 
     | 
    
         
            +
                 * Legacy version of getLocalToDevice(), which strips away any Z information, and
         
     | 
| 
      
 172 
     | 
    
         
            +
                 * just returns a 3x3 version.
         
     | 
| 
      
 173 
     | 
    
         
            +
                 */
         
     | 
| 
      
 174 
     | 
    
         
            +
                getTotalMatrix(): SkMatrix;
         
     | 
| 
       170 
175 
     | 
    
         
             
                /**
         
     | 
| 
       171 
176 
     | 
    
         
             
                 * Draws the given points using the current clip, current matrix, and the provided paint.
         
     | 
| 
       172 
177 
     | 
    
         
             
                 *
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"names":["ClipOp","exports","SaveLayerFlag"],"sources":["Canvas.ts"],"sourcesContent":["import type { SkPaint } from \"./Paint\";\nimport type { SkRect } from \"./Rect\";\nimport type { SkFont } from \"./Font\";\nimport type { SkPath } from \"./Path\";\nimport type {\n  SkImage,\n  MipmapMode,\n  FilterMode,\n  ImageInfo,\n  SamplingOptions,\n} from \"./Image\";\nimport type { SkSVG } from \"./SVG\";\nimport type { SkColor } from \"./Color\";\nimport type { InputRRect } from \"./RRect\";\nimport type { BlendMode } from \"./Paint/BlendMode\";\nimport type { SkPoint, PointMode } from \"./Point\";\nimport type { InputMatrix } from \"./Matrix\";\nimport type { SkImageFilter } from \"./ImageFilter\";\nimport type { SkVertices } from \"./Vertices\";\nimport type { SkTextBlob } from \"./TextBlob\";\nimport type { SkPicture } from \"./Picture\";\nimport type { SkRSXform } from \"./RSXform\";\n\nexport enum ClipOp {\n  Difference,\n  Intersect,\n}\n\nexport enum SaveLayerFlag {\n  SaveLayerInitWithPrevious = 1 << 2,\n  SaveLayerF16ColorType = 1 << 4,\n}\n\nexport interface SkCanvas {\n  /**\n   * Draws the given image with its top-left corner at (left, top) using the current clip,\n   * the current matrix, and optionally-provided paint.\n   * @param img\n   * @param left\n   * @param top\n   * @param paint\n   */\n  drawImage: (image: SkImage, x: number, y: number, paint?: SkPaint) => void;\n\n  /**\n   * Draws sub-rectangle src from provided image, scaled and translated to fill dst rectangle.\n   * @param img\n   * @param src\n   * @param dest\n   * @param paint\n   * @param fastSample - if false, will filter strictly within src.\n   */\n  drawImageRect(\n    img: SkImage,\n    src: SkRect,\n    dest: SkRect,\n    paint: SkPaint,\n    fastSample?: boolean\n  ): void;\n\n  /**\n   * Draws the given image with its top-left corner at (left, top) using the current clip,\n   * the current matrix. It will use the cubic sampling options B and C if necessary.\n   * @param img\n   * @param left\n   * @param top\n   * @param B - See CubicResampler in SkSamplingOptions.h for more information\n   * @param C - See CubicResampler in SkSamplingOptions.h for more information\n   * @param paint\n   */\n  drawImageCubic(\n    img: SkImage,\n    left: number,\n    top: number,\n    B: number,\n    C: number,\n    paint?: SkPaint | null\n  ): void;\n\n  /**\n   * Draws the given image with its top-left corner at (left, top) using the current clip,\n   * the current matrix. It will use the provided sampling options if necessary.\n   * @param img\n   * @param left\n   * @param top\n   * @param fm - The filter mode.\n   * @param mm - The mipmap mode. Note: for settings other than None, the image must have mipmaps\n   *             calculated with makeCopyWithDefaultMipmaps;\n   * @param paint\n   */\n  drawImageOptions(\n    img: SkImage,\n    left: number,\n    top: number,\n    fm: FilterMode,\n    mm: MipmapMode,\n    paint?: SkPaint | null\n  ): void;\n\n  /**\n   *  Draws the provided image stretched proportionally to fit into dst rectangle.\n   *  The center rectangle divides the image into nine sections: four sides, four corners, and\n   *  the center.\n   * @param img\n   * @param center\n   * @param dest\n   * @param filter - what technique to use when sampling the image\n   * @param paint\n   */\n  drawImageNine(\n    img: SkImage,\n    center: SkRect,\n    dest: SkRect,\n    filter: FilterMode,\n    paint?: SkPaint | null\n  ): void;\n\n  /**\n   * Draws sub-rectangle src from provided image, scaled and translated to fill dst rectangle.\n   * It will use the cubic sampling options B and C if necessary.\n   * @param img\n   * @param src\n   * @param dest\n   * @param B - See CubicResampler in SkSamplingOptions.h for more information\n   * @param C - See CubicResampler in SkSamplingOptions.h for more information\n   * @param paint\n   */\n  drawImageRectCubic(\n    img: SkImage,\n    src: SkRect,\n    dest: SkRect,\n    B: number,\n    C: number,\n    paint?: SkPaint | null\n  ): void;\n\n  /**\n   * Draws sub-rectangle src from provided image, scaled and translated to fill dst rectangle.\n   * It will use the provided sampling options if necessary.\n   * @param img\n   * @param src\n   * @param dest\n   * @param fm - The filter mode.\n   * @param mm - The mipmap mode. Note: for settings other than None, the image must have mipmaps\n   *             calculated with makeCopyWithDefaultMipmaps;\n   * @param paint\n   */\n  drawImageRectOptions(\n    img: SkImage,\n    src: SkRect,\n    dest: SkRect,\n    fm: FilterMode,\n    mm: MipmapMode,\n    paint?: SkPaint | null\n  ): void;\n\n  /** Fills clip with SkPaint paint. SkPaint components, SkShader,\n        SkColorFilter, SkImageFilter, and SkBlendMode affect drawing;\n        SkMaskFilter and SkPathEffect in paint are ignored.\n\n        @param paint  graphics state used to fill SkCanvas\n\n        example: https://fiddle.skia.org/c/@Canvas_drawPaint\n    */\n  drawPaint: (paint: SkPaint) => void;\n\n  /** Draws line segment from (x0, y0) to (x1, y1) using clip, SkMatrix, and SkPaint paint.\n        In paint: SkPaint stroke width describes the line thickness;\n        SkPaint::Cap draws the end rounded or square;\n        SkPaint::Style is ignored, as if were set to SkPaint::kStroke_Style.\n\n        @param x0     start of line segment on x-axis\n        @param y0     start of line segment on y-axis\n        @param x1     end of line segment on x-axis\n        @param y1     end of line segment on y-axis\n        @param paint  stroke, blend, color, and so on, used to draw\n\n        example: https://fiddle.skia.org/c/@Canvas_drawLine\n    */\n  drawLine: (\n    x0: number,\n    y0: number,\n    x1: number,\n    y1: number,\n    paint: SkPaint\n  ) => void;\n  /** Draws SkRect rect using clip, SkMatrix, and SkPaint paint.\n        In paint: SkPaint::Style determines if rectangle is stroked or filled;\n        if stroked, SkPaint stroke width describes the line thickness, and\n        SkPaint::Join draws the corners rounded or square.\n\n        @param rect   rectangle to draw\n        @param paint  stroke or fill, blend, color, and so on, used to draw\n\n        example: https://fiddle.skia.org/c/@Canvas_drawRect\n    */\n  drawRect: (rect: SkRect, paint: SkPaint) => void;\n\n  /**\n   * Draws a circle at (cx, cy) with the given radius.\n   * @param cx\n   * @param cy\n   * @param radius\n   * @param paint\n   */\n  drawCircle(cx: number, cy: number, radius: number, paint: SkPaint): void;\n\n  /**\n   * Draws the given vertices (a triangle mesh) using the current clip, current matrix, and the\n   * provided paint.\n   *  If paint contains an Shader and vertices does not contain texCoords, the shader\n   *  is mapped using the vertices' positions.\n   *  If vertices colors are defined in vertices, and Paint paint contains Shader,\n   *  BlendMode mode combines vertices colors with Shader.\n   * @param verts\n   * @param mode\n   * @param paint\n   */\n  drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint): void;\n\n  /**\n   * Draws a cubic patch defined by 12 control points [top, right, bottom, left] with optional\n   * colors and shader-coordinates [4] specifed for each corner [top-left, top-right, bottom-right, bottom-left]\n   * @param cubics 12 points : 4 connected cubics specifying the boundary of the patch\n   * @param colors optional colors interpolated across the patch\n   * @param texs optional shader coordinates interpolated across the patch\n   * @param mode Specifies how shader and colors blend (if both are specified)\n   * @param paint\n   */\n  drawPatch(\n    cubics: readonly SkPoint[],\n    colors?: readonly SkColor[] | null,\n    texs?: readonly SkPoint[] | null,\n    mode?: BlendMode | null,\n    paint?: SkPaint\n  ): void;\n\n  /**\n   * Restores state to a previous stack value.\n   * @param saveCount\n   */\n  restoreToCount(saveCount: number): void;\n\n  /**\n   * Draws the given points using the current clip, current matrix, and the provided paint.\n   *\n   * See Canvas.h for more on the mode and its interaction with paint.\n   * @param mode\n   * @param points\n   * @param paint\n   */\n  drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint): void;\n\n  /** Draws arc using clip, SkMatrix, and SkPaint paint.\n\n        Arc is part of oval bounded by oval, sweeping from startAngle to startAngle plus\n        sweepAngle. startAngle and sweepAngle are in degrees.\n\n        startAngle of zero places start point at the right middle edge of oval.\n        A positive sweepAngle places arc end point clockwise from start point;\n        a negative sweepAngle places arc end point counterclockwise from start point.\n        sweepAngle may exceed 360 degrees, a full circle.\n        If useCenter is true, draw a wedge that includes lines from oval\n        center to arc end points. If useCenter is false, draw arc between end points.\n\n        If SkRect oval is empty or sweepAngle is zero, nothing is drawn.\n\n        @param oval        SkRect bounds of oval containing arc to draw\n        @param startAngle  angle in degrees where arc begins\n        @param sweepAngle  sweep angle in degrees; positive is clockwise\n        @param useCenter   if true, include the center of the oval\n        @param paint       SkPaint stroke or fill, blend, color, and so on, used to draw\n    */\n  drawArc: (\n    oval: SkRect,\n    startAngle: number,\n    sweepAngle: number,\n    useCenter: boolean,\n    paint: SkPaint\n  ) => void;\n\n  /**\n   * Draws the given rectangle with rounded corners using the current clip, current matrix,\n   * and the provided paint.\n   * @param rrect\n   * @param paint\n   */\n  drawRRect(rrect: InputRRect, paint: SkPaint): void;\n\n  /**\n   * Draws RRect outer and inner using clip, Matrix, and Paint paint.\n   * outer must contain inner or the drawing is undefined.\n   * @param outer\n   * @param inner\n   * @param paint\n   */\n  drawDRRect(outer: InputRRect, inner: InputRRect, paint: SkPaint): void;\n\n  /**\n   * Draws an oval bounded by the given rectangle using the current clip, current matrix,\n   * and the provided paint.\n   * @param oval\n   * @param paint\n   */\n  drawOval(oval: SkRect, paint: SkPaint): void;\n\n  /** Draws SkPath path using clip, SkMatrix, and SkPaint paint.\n        SkPath contains an array of path contour, each of which may be open or closed.\n\n        In paint: SkPaint::Style determines if SkRRect is stroked or filled:\n        if filled, SkPath::FillType determines whether path contour describes inside or\n        outside of fill; if stroked, SkPaint stroke width describes the line thickness,\n        SkPaint::Cap describes line ends, and SkPaint::Join describes how\n        corners are drawn.\n\n        @param path   SkPath to draw\n        @param paint  stroke, blend, color, and so on, used to draw\n\n        example: https://fiddle.skia.org/c/@Canvas_drawPath\n    */\n  drawPath: (path: SkPath, paint: SkPaint) => void;\n\n  /**\n   * Draw the given text at the location (x, y) using the provided paint and font. The text will\n   * be drawn as is; no shaping, left-to-right, etc.\n   * @param str\n   * @param x\n   * @param y\n   * @param paint\n   * @param font\n   */\n  drawText(\n    str: string,\n    x: number,\n    y: number,\n    paint: SkPaint,\n    font: SkFont\n  ): void;\n\n  /**\n   * Draws the given TextBlob at (x, y) using the current clip, current matrix, and the\n   * provided paint. Reminder that the fonts used to draw TextBlob are part of the blob.\n   * @param blob\n   * @param x\n   * @param y\n   * @param paint\n   */\n  drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint): void;\n\n  /**\n   * Draws a run of glyphs, at corresponding positions, in a given font.\n   * @param glyphs the array of glyph IDs (Uint16TypedArray)\n   * @param positions the array of x,y floats to position each glyph\n   * @param x x-coordinate of the origin of the entire run\n   * @param y y-coordinate of the origin of the entire run\n   * @param font the font that contains the glyphs\n   * @param paint\n   */\n  drawGlyphs(\n    glyphs: number[],\n    positions: SkPoint[],\n    x: number,\n    y: number,\n    font: SkFont,\n    paint: SkPaint\n  ): void;\n\n  /**\n   * Renders the SVG Dom object to the canvas. If width/height are omitted,\n   * the SVG will be rendered to fit the canvas.\n   */\n  drawSvg: (svgDom: SkSVG, width?: number, height?: number) => void;\n  /** Saves SkMatrix and clip.\n        Calling restore() discards changes to SkMatrix and clip,\n        restoring the SkMatrix and clip to their state when save() was called.\n\n        SkMatrix may be changed by translate(), scale(), rotate(), skew(), concat(), setMatrix(),\n        and resetMatrix(). Clip may be changed by clipRect(), clipRRect(), clipPath(), clipRegion().\n\n        Saved SkCanvas state is put on a stack; multiple calls to save() should be balance\n        by an equal number of calls to restore().\n\n        Call restoreToCount() with result to restore this and subsequent saves.\n\n        @return  depth of saved stack\n\n        example: https://fiddle.skia.org/c/@Canvas_save\n    */\n  save: () => number;\n\n  /**\n   * Saves Matrix and clip, and allocates a SkBitmap for subsequent drawing.\n   * Calling restore() discards changes to Matrix and clip, and draws the SkBitmap.\n   * It returns the height of the stack.\n   * See Canvas.h for more.\n   * @param paint\n   * @param bounds\n   * @param backdrop\n   * @param flags\n   */\n  saveLayer(\n    paint?: SkPaint,\n    bounds?: SkRect | null,\n    backdrop?: SkImageFilter | null,\n    flags?: SaveLayerFlag\n  ): number;\n\n  /** Removes changes to SkMatrix and clip since SkCanvas state was\n        last saved. The state is removed from the stack.\n\n        Does nothing if the stack is empty.\n\n        example: https://fiddle.skia.org/c/@AutoCanvasRestore_restore\n\n        example: https://fiddle.skia.org/c/@Canvas_restore\n    */\n  restore: () => void;\n\n  /**\n   * Rotates the current matrix by the number of degrees.\n   * @param rot - angle of rotation in degrees.\n   * @param rx\n   * @param ry\n   */\n  rotate(rotationInDegrees: number, rx: number, ry: number): void;\n\n  /**\n   * Scales the current matrix by sx on the x-axis and sy on the y-axis.\n   * @param sx\n   * @param sy\n   */\n  scale(sx: number, sy: number): void;\n\n  /**\n   *  Skews Matrix by sx on the x-axis and sy on the y-axis. A positive value of sx\n   *  skews the drawing right as y-axis values increase; a positive value of sy skews\n   *  the drawing down as x-axis values increase.\n   * @param sx\n   * @param sy\n   */\n  skew(sx: number, sy: number): void;\n\n  /**\n   * Translates Matrix by dx along the x-axis and dy along the y-axis.\n   * @param dx\n   * @param dy\n   */\n  translate(dx: number, dy: number): void;\n\n  /**\n   * Fills clip with the given color.\n   * @param color\n   * @param blendMode - defaults to SrcOver.\n   */\n  drawColor(color: SkColor, blendMode?: BlendMode): void;\n\n  /**\n   * Fills the current clip with the given color using Src BlendMode.\n   * This has the effect of replacing all pixels contained by clip with color.\n   * @param color\n   */\n  clear(color: SkColor): void;\n\n  /**\n   * Replaces clip with the intersection or difference of the current clip and path,\n   * with an aliased or anti-aliased clip edge.\n   * @param path\n   * @param op\n   * @param doAntiAlias\n   */\n  clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean): void;\n\n  /**\n   * Replaces clip with the intersection or difference of the current clip and rect,\n   * with an aliased or anti-aliased clip edge.\n   * @param rect\n   * @param op\n   * @param doAntiAlias\n   */\n  clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean): void;\n\n  /**\n   * Replaces clip with the intersection or difference of the current clip and rrect,\n   * with an aliased or anti-aliased clip edge.\n   * @param rrect\n   * @param op\n   * @param doAntiAlias\n   */\n  clipRRect(rrect: InputRRect, op: ClipOp, doAntiAlias: boolean): void;\n\n  /**\n   * Replaces current matrix with m premultiplied with the existing matrix.\n   * @param m\n   */\n  concat(m: InputMatrix): void;\n\n  /**\n   * Draws the given picture using the current clip, current matrix, and the provided paint.\n   * @param skp\n   */\n  drawPicture(skp: SkPicture): void;\n\n  /**\n   * This method is used to draw an atlas on the canvas.\n   *\n   * @method drawAtlas\n   * @param {SkImage} atlas - The image to be drawn.\n   * @param {SkRect[]} srcs - The source rectangles.\n   * @param {SkRSXform[]} dsts - The destination transformations.\n   * @param {SkPaint} paint - The paint used for drawing.\n   * @param {BlendMode} [blendMode] - The blend mode used for drawing. Optional.\n   * @param {SkColor[]} [colors] - The colors used for drawing. Optional.\n   * @param {CubicResampler | FilterOptions} [sampling] - The sampling options. Optional.\n   * @returns {void} This method does not return anything.\n   */\n  drawAtlas(\n    atlas: SkImage,\n    srcs: SkRect[],\n    dsts: SkRSXform[],\n    paint: SkPaint,\n    blendMode?: BlendMode,\n    colors?: SkColor[],\n    sampling?: SamplingOptions\n  ): void;\n\n  /** Read Image pixels\n   *\n   * @param srcX - x-axis upper left corner of the rectangle to read from\n   * @param srcY - y-axis upper left corner of the rectangle to read from\n   * @param imageInfo - describes the pixel format and dimensions of the data to read into\n   * @return Float32Array or Uint8Array with data or null if the read failed.\n   */\n  readPixels(\n    srcX: number,\n    srcY: number,\n    imageInfo: ImageInfo\n  ): Float32Array | Uint8Array | null;\n}\n"],"mappings":";;;;;;IAuBYA,MAAM,GAAAC,OAAA,CAAAD,MAAA,0BAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAAA,IAKNE,aAAa,GAAAD,OAAA,CAAAC,aAAA,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA","ignoreList":[]}
         
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"names":["ClipOp","exports","SaveLayerFlag"],"sources":["Canvas.ts"],"sourcesContent":["import type { SkPaint } from \"./Paint\";\nimport type { SkRect } from \"./Rect\";\nimport type { SkFont } from \"./Font\";\nimport type { SkPath } from \"./Path\";\nimport type {\n  SkImage,\n  MipmapMode,\n  FilterMode,\n  ImageInfo,\n  SamplingOptions,\n} from \"./Image\";\nimport type { SkSVG } from \"./SVG\";\nimport type { SkColor } from \"./Color\";\nimport type { InputRRect } from \"./RRect\";\nimport type { BlendMode } from \"./Paint/BlendMode\";\nimport type { SkPoint, PointMode } from \"./Point\";\nimport type { InputMatrix, SkMatrix } from \"./Matrix\";\nimport type { SkImageFilter } from \"./ImageFilter\";\nimport type { SkVertices } from \"./Vertices\";\nimport type { SkTextBlob } from \"./TextBlob\";\nimport type { SkPicture } from \"./Picture\";\nimport type { SkRSXform } from \"./RSXform\";\n\nexport enum ClipOp {\n  Difference,\n  Intersect,\n}\n\nexport enum SaveLayerFlag {\n  SaveLayerInitWithPrevious = 1 << 2,\n  SaveLayerF16ColorType = 1 << 4,\n}\n\nexport interface SkCanvas {\n  /**\n   * Draws the given image with its top-left corner at (left, top) using the current clip,\n   * the current matrix, and optionally-provided paint.\n   * @param img\n   * @param left\n   * @param top\n   * @param paint\n   */\n  drawImage: (image: SkImage, x: number, y: number, paint?: SkPaint) => void;\n\n  /**\n   * Draws sub-rectangle src from provided image, scaled and translated to fill dst rectangle.\n   * @param img\n   * @param src\n   * @param dest\n   * @param paint\n   * @param fastSample - if false, will filter strictly within src.\n   */\n  drawImageRect(\n    img: SkImage,\n    src: SkRect,\n    dest: SkRect,\n    paint: SkPaint,\n    fastSample?: boolean\n  ): void;\n\n  /**\n   * Draws the given image with its top-left corner at (left, top) using the current clip,\n   * the current matrix. It will use the cubic sampling options B and C if necessary.\n   * @param img\n   * @param left\n   * @param top\n   * @param B - See CubicResampler in SkSamplingOptions.h for more information\n   * @param C - See CubicResampler in SkSamplingOptions.h for more information\n   * @param paint\n   */\n  drawImageCubic(\n    img: SkImage,\n    left: number,\n    top: number,\n    B: number,\n    C: number,\n    paint?: SkPaint | null\n  ): void;\n\n  /**\n   * Draws the given image with its top-left corner at (left, top) using the current clip,\n   * the current matrix. It will use the provided sampling options if necessary.\n   * @param img\n   * @param left\n   * @param top\n   * @param fm - The filter mode.\n   * @param mm - The mipmap mode. Note: for settings other than None, the image must have mipmaps\n   *             calculated with makeCopyWithDefaultMipmaps;\n   * @param paint\n   */\n  drawImageOptions(\n    img: SkImage,\n    left: number,\n    top: number,\n    fm: FilterMode,\n    mm: MipmapMode,\n    paint?: SkPaint | null\n  ): void;\n\n  /**\n   *  Draws the provided image stretched proportionally to fit into dst rectangle.\n   *  The center rectangle divides the image into nine sections: four sides, four corners, and\n   *  the center.\n   * @param img\n   * @param center\n   * @param dest\n   * @param filter - what technique to use when sampling the image\n   * @param paint\n   */\n  drawImageNine(\n    img: SkImage,\n    center: SkRect,\n    dest: SkRect,\n    filter: FilterMode,\n    paint?: SkPaint | null\n  ): void;\n\n  /**\n   * Draws sub-rectangle src from provided image, scaled and translated to fill dst rectangle.\n   * It will use the cubic sampling options B and C if necessary.\n   * @param img\n   * @param src\n   * @param dest\n   * @param B - See CubicResampler in SkSamplingOptions.h for more information\n   * @param C - See CubicResampler in SkSamplingOptions.h for more information\n   * @param paint\n   */\n  drawImageRectCubic(\n    img: SkImage,\n    src: SkRect,\n    dest: SkRect,\n    B: number,\n    C: number,\n    paint?: SkPaint | null\n  ): void;\n\n  /**\n   * Draws sub-rectangle src from provided image, scaled and translated to fill dst rectangle.\n   * It will use the provided sampling options if necessary.\n   * @param img\n   * @param src\n   * @param dest\n   * @param fm - The filter mode.\n   * @param mm - The mipmap mode. Note: for settings other than None, the image must have mipmaps\n   *             calculated with makeCopyWithDefaultMipmaps;\n   * @param paint\n   */\n  drawImageRectOptions(\n    img: SkImage,\n    src: SkRect,\n    dest: SkRect,\n    fm: FilterMode,\n    mm: MipmapMode,\n    paint?: SkPaint | null\n  ): void;\n\n  /** Fills clip with SkPaint paint. SkPaint components, SkShader,\n        SkColorFilter, SkImageFilter, and SkBlendMode affect drawing;\n        SkMaskFilter and SkPathEffect in paint are ignored.\n\n        @param paint  graphics state used to fill SkCanvas\n\n        example: https://fiddle.skia.org/c/@Canvas_drawPaint\n    */\n  drawPaint: (paint: SkPaint) => void;\n\n  /** Draws line segment from (x0, y0) to (x1, y1) using clip, SkMatrix, and SkPaint paint.\n        In paint: SkPaint stroke width describes the line thickness;\n        SkPaint::Cap draws the end rounded or square;\n        SkPaint::Style is ignored, as if were set to SkPaint::kStroke_Style.\n\n        @param x0     start of line segment on x-axis\n        @param y0     start of line segment on y-axis\n        @param x1     end of line segment on x-axis\n        @param y1     end of line segment on y-axis\n        @param paint  stroke, blend, color, and so on, used to draw\n\n        example: https://fiddle.skia.org/c/@Canvas_drawLine\n    */\n  drawLine: (\n    x0: number,\n    y0: number,\n    x1: number,\n    y1: number,\n    paint: SkPaint\n  ) => void;\n  /** Draws SkRect rect using clip, SkMatrix, and SkPaint paint.\n        In paint: SkPaint::Style determines if rectangle is stroked or filled;\n        if stroked, SkPaint stroke width describes the line thickness, and\n        SkPaint::Join draws the corners rounded or square.\n\n        @param rect   rectangle to draw\n        @param paint  stroke or fill, blend, color, and so on, used to draw\n\n        example: https://fiddle.skia.org/c/@Canvas_drawRect\n    */\n  drawRect: (rect: SkRect, paint: SkPaint) => void;\n\n  /**\n   * Draws a circle at (cx, cy) with the given radius.\n   * @param cx\n   * @param cy\n   * @param radius\n   * @param paint\n   */\n  drawCircle(cx: number, cy: number, radius: number, paint: SkPaint): void;\n\n  /**\n   * Draws the given vertices (a triangle mesh) using the current clip, current matrix, and the\n   * provided paint.\n   *  If paint contains an Shader and vertices does not contain texCoords, the shader\n   *  is mapped using the vertices' positions.\n   *  If vertices colors are defined in vertices, and Paint paint contains Shader,\n   *  BlendMode mode combines vertices colors with Shader.\n   * @param verts\n   * @param mode\n   * @param paint\n   */\n  drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint): void;\n\n  /**\n   * Draws a cubic patch defined by 12 control points [top, right, bottom, left] with optional\n   * colors and shader-coordinates [4] specifed for each corner [top-left, top-right, bottom-right, bottom-left]\n   * @param cubics 12 points : 4 connected cubics specifying the boundary of the patch\n   * @param colors optional colors interpolated across the patch\n   * @param texs optional shader coordinates interpolated across the patch\n   * @param mode Specifies how shader and colors blend (if both are specified)\n   * @param paint\n   */\n  drawPatch(\n    cubics: readonly SkPoint[],\n    colors?: readonly SkColor[] | null,\n    texs?: readonly SkPoint[] | null,\n    mode?: BlendMode | null,\n    paint?: SkPaint\n  ): void;\n\n  /**\n   * Restores state to a previous stack value.\n   * @param saveCount\n   */\n  restoreToCount(saveCount: number): void;\n\n  /**\n   * Legacy version of getLocalToDevice(), which strips away any Z information, and\n   * just returns a 3x3 version.\n   */\n  getTotalMatrix(): SkMatrix;\n\n  /**\n   * Draws the given points using the current clip, current matrix, and the provided paint.\n   *\n   * See Canvas.h for more on the mode and its interaction with paint.\n   * @param mode\n   * @param points\n   * @param paint\n   */\n  drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint): void;\n\n  /** Draws arc using clip, SkMatrix, and SkPaint paint.\n\n        Arc is part of oval bounded by oval, sweeping from startAngle to startAngle plus\n        sweepAngle. startAngle and sweepAngle are in degrees.\n\n        startAngle of zero places start point at the right middle edge of oval.\n        A positive sweepAngle places arc end point clockwise from start point;\n        a negative sweepAngle places arc end point counterclockwise from start point.\n        sweepAngle may exceed 360 degrees, a full circle.\n        If useCenter is true, draw a wedge that includes lines from oval\n        center to arc end points. If useCenter is false, draw arc between end points.\n\n        If SkRect oval is empty or sweepAngle is zero, nothing is drawn.\n\n        @param oval        SkRect bounds of oval containing arc to draw\n        @param startAngle  angle in degrees where arc begins\n        @param sweepAngle  sweep angle in degrees; positive is clockwise\n        @param useCenter   if true, include the center of the oval\n        @param paint       SkPaint stroke or fill, blend, color, and so on, used to draw\n    */\n  drawArc: (\n    oval: SkRect,\n    startAngle: number,\n    sweepAngle: number,\n    useCenter: boolean,\n    paint: SkPaint\n  ) => void;\n\n  /**\n   * Draws the given rectangle with rounded corners using the current clip, current matrix,\n   * and the provided paint.\n   * @param rrect\n   * @param paint\n   */\n  drawRRect(rrect: InputRRect, paint: SkPaint): void;\n\n  /**\n   * Draws RRect outer and inner using clip, Matrix, and Paint paint.\n   * outer must contain inner or the drawing is undefined.\n   * @param outer\n   * @param inner\n   * @param paint\n   */\n  drawDRRect(outer: InputRRect, inner: InputRRect, paint: SkPaint): void;\n\n  /**\n   * Draws an oval bounded by the given rectangle using the current clip, current matrix,\n   * and the provided paint.\n   * @param oval\n   * @param paint\n   */\n  drawOval(oval: SkRect, paint: SkPaint): void;\n\n  /** Draws SkPath path using clip, SkMatrix, and SkPaint paint.\n        SkPath contains an array of path contour, each of which may be open or closed.\n\n        In paint: SkPaint::Style determines if SkRRect is stroked or filled:\n        if filled, SkPath::FillType determines whether path contour describes inside or\n        outside of fill; if stroked, SkPaint stroke width describes the line thickness,\n        SkPaint::Cap describes line ends, and SkPaint::Join describes how\n        corners are drawn.\n\n        @param path   SkPath to draw\n        @param paint  stroke, blend, color, and so on, used to draw\n\n        example: https://fiddle.skia.org/c/@Canvas_drawPath\n    */\n  drawPath: (path: SkPath, paint: SkPaint) => void;\n\n  /**\n   * Draw the given text at the location (x, y) using the provided paint and font. The text will\n   * be drawn as is; no shaping, left-to-right, etc.\n   * @param str\n   * @param x\n   * @param y\n   * @param paint\n   * @param font\n   */\n  drawText(\n    str: string,\n    x: number,\n    y: number,\n    paint: SkPaint,\n    font: SkFont\n  ): void;\n\n  /**\n   * Draws the given TextBlob at (x, y) using the current clip, current matrix, and the\n   * provided paint. Reminder that the fonts used to draw TextBlob are part of the blob.\n   * @param blob\n   * @param x\n   * @param y\n   * @param paint\n   */\n  drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint): void;\n\n  /**\n   * Draws a run of glyphs, at corresponding positions, in a given font.\n   * @param glyphs the array of glyph IDs (Uint16TypedArray)\n   * @param positions the array of x,y floats to position each glyph\n   * @param x x-coordinate of the origin of the entire run\n   * @param y y-coordinate of the origin of the entire run\n   * @param font the font that contains the glyphs\n   * @param paint\n   */\n  drawGlyphs(\n    glyphs: number[],\n    positions: SkPoint[],\n    x: number,\n    y: number,\n    font: SkFont,\n    paint: SkPaint\n  ): void;\n\n  /**\n   * Renders the SVG Dom object to the canvas. If width/height are omitted,\n   * the SVG will be rendered to fit the canvas.\n   */\n  drawSvg: (svgDom: SkSVG, width?: number, height?: number) => void;\n  /** Saves SkMatrix and clip.\n        Calling restore() discards changes to SkMatrix and clip,\n        restoring the SkMatrix and clip to their state when save() was called.\n\n        SkMatrix may be changed by translate(), scale(), rotate(), skew(), concat(), setMatrix(),\n        and resetMatrix(). Clip may be changed by clipRect(), clipRRect(), clipPath(), clipRegion().\n\n        Saved SkCanvas state is put on a stack; multiple calls to save() should be balance\n        by an equal number of calls to restore().\n\n        Call restoreToCount() with result to restore this and subsequent saves.\n\n        @return  depth of saved stack\n\n        example: https://fiddle.skia.org/c/@Canvas_save\n    */\n  save: () => number;\n\n  /**\n   * Saves Matrix and clip, and allocates a SkBitmap for subsequent drawing.\n   * Calling restore() discards changes to Matrix and clip, and draws the SkBitmap.\n   * It returns the height of the stack.\n   * See Canvas.h for more.\n   * @param paint\n   * @param bounds\n   * @param backdrop\n   * @param flags\n   */\n  saveLayer(\n    paint?: SkPaint,\n    bounds?: SkRect | null,\n    backdrop?: SkImageFilter | null,\n    flags?: SaveLayerFlag\n  ): number;\n\n  /** Removes changes to SkMatrix and clip since SkCanvas state was\n        last saved. The state is removed from the stack.\n\n        Does nothing if the stack is empty.\n\n        example: https://fiddle.skia.org/c/@AutoCanvasRestore_restore\n\n        example: https://fiddle.skia.org/c/@Canvas_restore\n    */\n  restore: () => void;\n\n  /**\n   * Rotates the current matrix by the number of degrees.\n   * @param rot - angle of rotation in degrees.\n   * @param rx\n   * @param ry\n   */\n  rotate(rotationInDegrees: number, rx: number, ry: number): void;\n\n  /**\n   * Scales the current matrix by sx on the x-axis and sy on the y-axis.\n   * @param sx\n   * @param sy\n   */\n  scale(sx: number, sy: number): void;\n\n  /**\n   *  Skews Matrix by sx on the x-axis and sy on the y-axis. A positive value of sx\n   *  skews the drawing right as y-axis values increase; a positive value of sy skews\n   *  the drawing down as x-axis values increase.\n   * @param sx\n   * @param sy\n   */\n  skew(sx: number, sy: number): void;\n\n  /**\n   * Translates Matrix by dx along the x-axis and dy along the y-axis.\n   * @param dx\n   * @param dy\n   */\n  translate(dx: number, dy: number): void;\n\n  /**\n   * Fills clip with the given color.\n   * @param color\n   * @param blendMode - defaults to SrcOver.\n   */\n  drawColor(color: SkColor, blendMode?: BlendMode): void;\n\n  /**\n   * Fills the current clip with the given color using Src BlendMode.\n   * This has the effect of replacing all pixels contained by clip with color.\n   * @param color\n   */\n  clear(color: SkColor): void;\n\n  /**\n   * Replaces clip with the intersection or difference of the current clip and path,\n   * with an aliased or anti-aliased clip edge.\n   * @param path\n   * @param op\n   * @param doAntiAlias\n   */\n  clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean): void;\n\n  /**\n   * Replaces clip with the intersection or difference of the current clip and rect,\n   * with an aliased or anti-aliased clip edge.\n   * @param rect\n   * @param op\n   * @param doAntiAlias\n   */\n  clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean): void;\n\n  /**\n   * Replaces clip with the intersection or difference of the current clip and rrect,\n   * with an aliased or anti-aliased clip edge.\n   * @param rrect\n   * @param op\n   * @param doAntiAlias\n   */\n  clipRRect(rrect: InputRRect, op: ClipOp, doAntiAlias: boolean): void;\n\n  /**\n   * Replaces current matrix with m premultiplied with the existing matrix.\n   * @param m\n   */\n  concat(m: InputMatrix): void;\n\n  /**\n   * Draws the given picture using the current clip, current matrix, and the provided paint.\n   * @param skp\n   */\n  drawPicture(skp: SkPicture): void;\n\n  /**\n   * This method is used to draw an atlas on the canvas.\n   *\n   * @method drawAtlas\n   * @param {SkImage} atlas - The image to be drawn.\n   * @param {SkRect[]} srcs - The source rectangles.\n   * @param {SkRSXform[]} dsts - The destination transformations.\n   * @param {SkPaint} paint - The paint used for drawing.\n   * @param {BlendMode} [blendMode] - The blend mode used for drawing. Optional.\n   * @param {SkColor[]} [colors] - The colors used for drawing. Optional.\n   * @param {CubicResampler | FilterOptions} [sampling] - The sampling options. Optional.\n   * @returns {void} This method does not return anything.\n   */\n  drawAtlas(\n    atlas: SkImage,\n    srcs: SkRect[],\n    dsts: SkRSXform[],\n    paint: SkPaint,\n    blendMode?: BlendMode,\n    colors?: SkColor[],\n    sampling?: SamplingOptions\n  ): void;\n\n  /** Read Image pixels\n   *\n   * @param srcX - x-axis upper left corner of the rectangle to read from\n   * @param srcY - y-axis upper left corner of the rectangle to read from\n   * @param imageInfo - describes the pixel format and dimensions of the data to read into\n   * @return Float32Array or Uint8Array with data or null if the read failed.\n   */\n  readPixels(\n    srcX: number,\n    srcY: number,\n    imageInfo: ImageInfo\n  ): Float32Array | Uint8Array | null;\n}\n"],"mappings":";;;;;;IAuBYA,MAAM,GAAAC,OAAA,CAAAD,MAAA,0BAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAAA,IAKNE,aAAa,GAAAD,OAAA,CAAAC,aAAA,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA","ignoreList":[]}
         
     | 
| 
         @@ -17,6 +17,7 @@ export declare class JsiSkCanvas extends HostObject<Canvas, "Canvas"> implements 
     | 
|
| 
       17 
17 
     | 
    
         
             
                drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint): void;
         
     | 
| 
       18 
18 
     | 
    
         
             
                drawPatch(cubics: SkPoint[], colors?: SkColor[] | null, texs?: SkPoint[] | null, mode?: BlendMode | null, paint?: SkPaint): void;
         
     | 
| 
       19 
19 
     | 
    
         
             
                restoreToCount(saveCount: number): void;
         
     | 
| 
      
 20 
     | 
    
         
            +
                getTotalMatrix(): SkMatrix;
         
     | 
| 
       20 
21 
     | 
    
         
             
                drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint): void;
         
     | 
| 
       21 
22 
     | 
    
         
             
                drawArc(oval: SkRect, startAngle: number, sweepAngle: number, useCenter: boolean, paint: SkPaint): void;
         
     | 
| 
       22 
23 
     | 
    
         
             
                drawRRect(rrect: InputRRect, paint: SkPaint): void;
         
     | 
| 
         @@ -68,6 +68,9 @@ class JsiSkCanvas extends _Host.HostObject { 
     | 
|
| 
       68 
68 
     | 
    
         
             
              restoreToCount(saveCount) {
         
     | 
| 
       69 
69 
     | 
    
         
             
                this.ref.restoreToCount(saveCount);
         
     | 
| 
       70 
70 
     | 
    
         
             
              }
         
     | 
| 
      
 71 
     | 
    
         
            +
              getTotalMatrix() {
         
     | 
| 
      
 72 
     | 
    
         
            +
                return new _JsiSkMatrix.JsiSkMatrix(this.CanvasKit, Float32Array.of(...this.ref.getTotalMatrix()));
         
     | 
| 
      
 73 
     | 
    
         
            +
              }
         
     | 
| 
       71 
74 
     | 
    
         
             
              drawPoints(mode, points, paint) {
         
     | 
| 
       72 
75 
     | 
    
         
             
                this.ref.drawPoints((0, _Host.getEnum)(this.CanvasKit, "PointMode", mode), points.map(({
         
     | 
| 
       73 
76 
     | 
    
         
             
                  x,
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"names":["_types","require","_Host","_JsiSkPaint","_JsiSkRect","_JsiSkRRect","_JsiSkImage","_JsiSkVertices","_JsiSkPath","_JsiSkFont","_JsiSkTextBlob","_JsiSkPicture","_JsiSkMatrix","_JsiSkImageFilter","_JsiSkPoint","_JsiSkRSXform","JsiSkCanvas","HostObject","constructor","CanvasKit","ref","drawRect","rect","paint","JsiSkRect","fromValue","JsiSkPaint","drawImage","image","x","y","JsiSkImage","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","getEnum","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","JsiSkVertices","drawPatch","cubics","colors","texs","map","flat","flatMap","p","JsiSkPoint","undefined","restoreToCount","saveCount","drawPoints","points","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","JsiSkRRect","drawDRRect","outer","inner","drawOval","drawPath","path","JsiSkPath","drawText","str","font","JsiSkFont","drawTextBlob","blob","JsiSkTextBlob","drawGlyphs","glyphs","positions","drawSvg","svg","width","height","ctm","getLocalToDevice","console","log","MakeImageFromCanvasImageSource","save","saveLayer","bounds","backdrop","flags","JsiSkImageFilter","restore","rotate","rotationInDegrees","rx","ry","scale","sx","sy","skew","translate","dx","dy","drawColor","color","blendMode","clear","clipPath","op","doAntiAlias","clipRect","clipRRect","concat","m","isArray","JsiSkMatrix","drawPicture","skp","JsiSkPicture","drawAtlas","atlas","srcs","dsts","sampling","s","dst","JsiSkRSXform","cls","Uint32Array","length","i","r","g","b","a","ColorAsInt","ckSampling","FilterMode","Linear","mipmap","MipmapMode","None","isCubicSampling","BlendMode","DstOver","readPixels","srcX","srcY","imageInfo","pxInfo","colorSpace","ColorSpace","SRGB","alphaType","colorType","exports"],"sources":["JsiSkCanvas.ts"],"sourcesContent":["import type {\n  Canvas,\n  CanvasKit,\n  CubicResampler as CKCubicResampler,\n  FilterOptions as CKFilterOptions,\n} from \"canvaskit-wasm\";\n\nimport {\n  type BlendMode,\n  type ClipOp,\n  type FilterMode,\n  type MipmapMode,\n  type PointMode,\n  type SaveLayerFlag,\n  type ImageInfo,\n  type SkCanvas,\n  type SkColor,\n  type SkFont,\n  type SkImage,\n  type SkImageFilter,\n  type SkMatrix,\n  type SkPaint,\n  type SkPath,\n  type SkPicture,\n  type SkPoint,\n  type SkRect,\n  type InputRRect,\n  type SkSVG,\n  type SkTextBlob,\n  type SkVertices,\n  type SkRSXform,\n  type CubicResampler,\n  type FilterOptions,\n  isCubicSampling,\n} from \"../types\";\n\nimport { getEnum, HostObject } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport type { JsiSkSVG } from \"./JsiSkSVG\";\n\nexport class JsiSkCanvas\n  extends HostObject<Canvas, \"Canvas\">\n  implements SkCanvas\n{\n  constructor(CanvasKit: CanvasKit, ref: Canvas) {\n    super(CanvasKit, ref, \"Canvas\");\n  }\n\n  drawRect(rect: SkRect, paint: SkPaint) {\n    this.ref.drawRect(\n      JsiSkRect.fromValue(this.CanvasKit, rect),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawImage(image: SkImage, x: number, y: number, paint?: SkPaint) {\n    this.ref.drawImage(\n      JsiSkImage.fromValue(image),\n      x,\n      y,\n      paint ? JsiSkPaint.fromValue(paint) : paint\n    );\n  }\n\n  drawImageRect(\n    img: SkImage,\n    src: SkRect,\n    dest: SkRect,\n    paint: SkPaint,\n    fastSample?: boolean\n  ) {\n    this.ref.drawImageRect(\n      JsiSkImage.fromValue(img),\n      JsiSkRect.fromValue(this.CanvasKit, src),\n      JsiSkRect.fromValue(this.CanvasKit, dest),\n      JsiSkPaint.fromValue(paint),\n      fastSample\n    );\n  }\n\n  drawImageCubic(\n    img: SkImage,\n    left: number,\n    top: number,\n    B: number,\n    C: number,\n    paint?: SkPaint | null\n  ) {\n    this.ref.drawImageCubic(\n      JsiSkImage.fromValue(img),\n      left,\n      top,\n      B,\n      C,\n      paint ? JsiSkPaint.fromValue(paint) : paint\n    );\n  }\n\n  drawImageOptions(\n    img: SkImage,\n    left: number,\n    top: number,\n    fm: FilterMode,\n    mm: MipmapMode,\n    paint?: SkPaint | null\n  ) {\n    this.ref.drawImageOptions(\n      JsiSkImage.fromValue(img),\n      left,\n      top,\n      getEnum(this.CanvasKit, \"FilterMode\", fm),\n      getEnum(this.CanvasKit, \"MipmapMode\", mm),\n      paint ? JsiSkPaint.fromValue(paint) : paint\n    );\n  }\n\n  drawImageNine(\n    img: SkImage,\n    center: SkRect,\n    dest: SkRect,\n    filter: FilterMode,\n    paint?: SkPaint | null\n  ) {\n    this.ref.drawImageNine(\n      JsiSkImage.fromValue(img),\n      Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),\n      JsiSkRect.fromValue(this.CanvasKit, dest),\n      getEnum(this.CanvasKit, \"FilterMode\", filter),\n      paint ? JsiSkPaint.fromValue(paint) : paint\n    );\n  }\n\n  drawImageRectCubic(\n    img: SkImage,\n    src: SkRect,\n    dest: SkRect,\n    B: number,\n    C: number,\n    paint?: SkPaint | null\n  ) {\n    this.ref.drawImageRectCubic(\n      JsiSkImage.fromValue(img),\n      JsiSkRect.fromValue(this.CanvasKit, src),\n      JsiSkRect.fromValue(this.CanvasKit, dest),\n      B,\n      C,\n      paint ? JsiSkPaint.fromValue(paint) : paint\n    );\n  }\n\n  drawImageRectOptions(\n    img: SkImage,\n    src: SkRect,\n    dest: SkRect,\n    fm: FilterMode,\n    mm: MipmapMode,\n    paint?: SkPaint | null\n  ) {\n    this.ref.drawImageRectOptions(\n      JsiSkImage.fromValue(img),\n      JsiSkRect.fromValue(this.CanvasKit, src),\n      JsiSkRect.fromValue(this.CanvasKit, dest),\n      getEnum(this.CanvasKit, \"FilterMode\", fm),\n      getEnum(this.CanvasKit, \"MipmapMode\", mm),\n      paint ? JsiSkPaint.fromValue(paint) : paint\n    );\n  }\n\n  drawPaint(paint: SkPaint) {\n    this.ref.drawPaint(JsiSkPaint.fromValue(paint));\n  }\n\n  drawLine(x0: number, y0: number, x1: number, y1: number, paint: SkPaint) {\n    this.ref.drawLine(x0, y0, x1, y1, JsiSkPaint.fromValue(paint));\n  }\n\n  drawCircle(cx: number, cy: number, radius: number, paint: SkPaint) {\n    this.ref.drawCircle(cx, cy, radius, JsiSkPaint.fromValue(paint));\n  }\n\n  drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {\n    this.ref.drawVertices(\n      JsiSkVertices.fromValue(verts),\n      getEnum(this.CanvasKit, \"BlendMode\", mode),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawPatch(\n    cubics: SkPoint[],\n    colors?: SkColor[] | null,\n    texs?: SkPoint[] | null,\n    mode?: BlendMode | null,\n    paint?: SkPaint\n  ) {\n    this.ref.drawPatch(\n      cubics.map(({ x, y }) => [x, y]).flat(),\n      colors,\n      texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,\n      mode ? getEnum(this.CanvasKit, \"BlendMode\", mode) : null,\n      paint ? JsiSkPaint.fromValue(paint) : undefined\n    );\n  }\n\n  restoreToCount(saveCount: number) {\n    this.ref.restoreToCount(saveCount);\n  }\n\n  drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {\n    this.ref.drawPoints(\n      getEnum(this.CanvasKit, \"PointMode\", mode),\n      points.map(({ x, y }) => [x, y]).flat(),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawArc(\n    oval: SkRect,\n    startAngle: number,\n    sweepAngle: number,\n    useCenter: boolean,\n    paint: SkPaint\n  ) {\n    this.ref.drawArc(\n      JsiSkRect.fromValue(this.CanvasKit, oval),\n      startAngle,\n      sweepAngle,\n      useCenter,\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawRRect(rrect: InputRRect, paint: SkPaint) {\n    this.ref.drawRRect(\n      JsiSkRRect.fromValue(this.CanvasKit, rrect),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawDRRect(outer: InputRRect, inner: InputRRect, paint: SkPaint) {\n    this.ref.drawDRRect(\n      JsiSkRRect.fromValue(this.CanvasKit, outer),\n      JsiSkRRect.fromValue(this.CanvasKit, inner),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawOval(oval: SkRect, paint: SkPaint) {\n    this.ref.drawOval(\n      JsiSkRect.fromValue(this.CanvasKit, oval),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawPath(path: SkPath, paint: SkPaint) {\n    this.ref.drawPath(JsiSkPath.fromValue(path), JsiSkPaint.fromValue(paint));\n  }\n\n  drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont) {\n    this.ref.drawText(\n      str,\n      x,\n      y,\n      JsiSkPaint.fromValue(paint),\n      JsiSkFont.fromValue(font)\n    );\n  }\n\n  drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint) {\n    this.ref.drawTextBlob(\n      JsiSkTextBlob.fromValue(blob),\n      x,\n      y,\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawGlyphs(\n    glyphs: number[],\n    positions: SkPoint[],\n    x: number,\n    y: number,\n    font: SkFont,\n    paint: SkPaint\n  ) {\n    this.ref.drawGlyphs(\n      glyphs,\n      positions.map((p) => [p.x, p.y]).flat(),\n      x,\n      y,\n      JsiSkFont.fromValue(font),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawSvg(svg: SkSVG, width?: number, height?: number) {\n    const ctm = this.ref.getLocalToDevice();\n    console.log({ ctm, width, height });\n    const image = this.CanvasKit.MakeImageFromCanvasImageSource(\n      (svg as JsiSkSVG).ref\n    );\n    this.ref.drawImage(image, 0, 0);\n  }\n\n  save() {\n    return this.ref.save();\n  }\n\n  saveLayer(\n    paint?: SkPaint,\n    bounds?: SkRect | null,\n    backdrop?: SkImageFilter | null,\n    flags?: SaveLayerFlag\n  ) {\n    return this.ref.saveLayer(\n      paint ? JsiSkPaint.fromValue(paint) : undefined,\n      bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : bounds,\n      backdrop ? JsiSkImageFilter.fromValue(backdrop) : backdrop,\n      flags\n    );\n  }\n\n  restore() {\n    this.ref.restore();\n  }\n\n  rotate(rotationInDegrees: number, rx: number, ry: number) {\n    this.ref.rotate(rotationInDegrees, rx, ry);\n  }\n\n  scale(sx: number, sy: number) {\n    this.ref.scale(sx, sy);\n  }\n\n  skew(sx: number, sy: number) {\n    this.ref.skew(sx, sy);\n  }\n\n  translate(dx: number, dy: number) {\n    this.ref.translate(dx, dy);\n  }\n\n  drawColor(color: SkColor, blendMode?: BlendMode) {\n    this.ref.drawColor(\n      color,\n      blendMode ? getEnum(this.CanvasKit, \"BlendMode\", blendMode) : undefined\n    );\n  }\n\n  clear(color: SkColor) {\n    this.ref.clear(color);\n  }\n\n  clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {\n    this.ref.clipPath(\n      JsiSkPath.fromValue(path),\n      getEnum(this.CanvasKit, \"PathOp\", op),\n      doAntiAlias\n    );\n  }\n\n  clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {\n    this.ref.clipRect(\n      JsiSkRect.fromValue(this.CanvasKit, rect),\n      getEnum(this.CanvasKit, \"PathOp\", op),\n      doAntiAlias\n    );\n  }\n\n  clipRRect(rrect: InputRRect, op: ClipOp, doAntiAlias: boolean) {\n    this.ref.clipRRect(\n      JsiSkRRect.fromValue(this.CanvasKit, rrect),\n      getEnum(this.CanvasKit, \"PathOp\", op),\n      doAntiAlias\n    );\n  }\n\n  concat(m: SkMatrix | number[]) {\n    this.ref.concat(Array.isArray(m) ? m : JsiSkMatrix.fromValue(m));\n  }\n\n  drawPicture(skp: SkPicture) {\n    this.ref.drawPicture(JsiSkPicture.fromValue(skp));\n  }\n\n  drawAtlas(\n    atlas: SkImage,\n    srcs: SkRect[],\n    dsts: SkRSXform[],\n    paint: SkPaint,\n    blendMode?: BlendMode,\n    colors?: SkColor[],\n    sampling?: CubicResampler | FilterOptions\n  ) {\n    const src = srcs.flatMap((s) =>\n      Array.from(JsiSkRect.fromValue(this.CanvasKit, s))\n    );\n    const dst = dsts.flatMap((s) => Array.from(JsiSkRSXform.fromValue(s)));\n    let cls: Uint32Array | undefined;\n    if (colors) {\n      cls = new Uint32Array(colors.length);\n      for (let i = 0; i < colors.length; i++) {\n        const [r, g, b, a] = colors[i];\n        cls[i] = this.CanvasKit.ColorAsInt(r * 255, g * 255, b * 255, a * 255);\n      }\n    }\n    let ckSampling: CKCubicResampler | CKFilterOptions = {\n      filter: this.CanvasKit.FilterMode.Linear,\n      mipmap: this.CanvasKit.MipmapMode.None,\n    };\n    if (sampling && isCubicSampling(sampling)) {\n      ckSampling = sampling;\n    } else if (sampling) {\n      ckSampling = {\n        filter: getEnum(this.CanvasKit, \"FilterMode\", sampling.filter),\n        mipmap: sampling.mipmap\n          ? getEnum(this.CanvasKit, \"MipmapMode\", sampling.mipmap)\n          : this.CanvasKit.MipmapMode.None,\n      };\n    }\n    this.ref.drawAtlas(\n      JsiSkImage.fromValue(atlas),\n      src,\n      dst,\n      JsiSkPaint.fromValue(paint),\n      blendMode\n        ? getEnum(this.CanvasKit, \"BlendMode\", blendMode)\n        : this.CanvasKit.BlendMode.DstOver,\n      cls,\n      ckSampling\n    );\n  }\n\n  readPixels(srcX: number, srcY: number, imageInfo: ImageInfo) {\n    const pxInfo = {\n      width: imageInfo.width,\n      height: imageInfo.height,\n      colorSpace: this.CanvasKit.ColorSpace.SRGB,\n      alphaType: getEnum(this.CanvasKit, \"AlphaType\", imageInfo.alphaType),\n      colorType: getEnum(this.CanvasKit, \"ColorType\", imageInfo.colorType),\n    };\n    return this.ref.readPixels(srcX, srcY, pxInfo);\n  }\n}\n"],"mappings":";;;;;;AAOA,IAAAA,MAAA,GAAAC,OAAA;AA6BA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AACA,IAAAY,iBAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AAGO,MAAMe,WAAW,SACdC,gBAAU,CAEpB;EACEC,WAAWA,CAACC,SAAoB,EAAEC,GAAW,EAAE;IAC7C,KAAK,CAACD,SAAS,EAAEC,GAAG,EAAE,QAAQ,CAAC;EACjC;EAEAC,QAAQA,CAACC,IAAY,EAAEC,KAAc,EAAE;IACrC,IAAI,CAACH,GAAG,CAACC,QAAQ,CACfG,oBAAS,CAACC,SAAS,CAAC,IAAI,CAACN,SAAS,EAAEG,IAAI,CAAC,EACzCI,sBA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EAAC,IAAI,CAAC1B,SAAS,EAAE,WAAW,EAAE+J,SAAS,CAACM,SAAS;IACrE,CAAC;IACD,OAAO,IAAI,CAACpK,GAAG,CAAC2J,UAAU,CAACC,IAAI,EAAEC,IAAI,EAAEE,MAAM,CAAC;EAChD;AACF;AAACM,OAAA,CAAAzK,WAAA,GAAAA,WAAA","ignoreList":[]}
         
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"names":["_types","require","_Host","_JsiSkPaint","_JsiSkRect","_JsiSkRRect","_JsiSkImage","_JsiSkVertices","_JsiSkPath","_JsiSkFont","_JsiSkTextBlob","_JsiSkPicture","_JsiSkMatrix","_JsiSkImageFilter","_JsiSkPoint","_JsiSkRSXform","JsiSkCanvas","HostObject","constructor","CanvasKit","ref","drawRect","rect","paint","JsiSkRect","fromValue","JsiSkPaint","drawImage","image","x","y","JsiSkImage","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","getEnum","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","JsiSkVertices","drawPatch","cubics","colors","texs","map","flat","flatMap","p","JsiSkPoint","undefined","restoreToCount","saveCount","getTotalMatrix","JsiSkMatrix","Float32Array","of","drawPoints","points","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","JsiSkRRect","drawDRRect","outer","inner","drawOval","drawPath","path","JsiSkPath","drawText","str","font","JsiSkFont","drawTextBlob","blob","JsiSkTextBlob","drawGlyphs","glyphs","positions","drawSvg","svg","width","height","ctm","getLocalToDevice","console","log","MakeImageFromCanvasImageSource","save","saveLayer","bounds","backdrop","flags","JsiSkImageFilter","restore","rotate","rotationInDegrees","rx","ry","scale","sx","sy","skew","translate","dx","dy","drawColor","color","blendMode","clear","clipPath","op","doAntiAlias","clipRect","clipRRect","concat","m","isArray","drawPicture","skp","JsiSkPicture","drawAtlas","atlas","srcs","dsts","sampling","s","dst","JsiSkRSXform","cls","Uint32Array","length","i","r","g","b","a","ColorAsInt","ckSampling","FilterMode","Linear","mipmap","MipmapMode","None","isCubicSampling","BlendMode","DstOver","readPixels","srcX","srcY","imageInfo","pxInfo","colorSpace","ColorSpace","SRGB","alphaType","colorType","exports"],"sources":["JsiSkCanvas.ts"],"sourcesContent":["import type {\n  Canvas,\n  CanvasKit,\n  CubicResampler as CKCubicResampler,\n  FilterOptions as CKFilterOptions,\n} from \"canvaskit-wasm\";\n\nimport {\n  type BlendMode,\n  type ClipOp,\n  type FilterMode,\n  type MipmapMode,\n  type PointMode,\n  type SaveLayerFlag,\n  type ImageInfo,\n  type SkCanvas,\n  type SkColor,\n  type SkFont,\n  type SkImage,\n  type SkImageFilter,\n  type SkMatrix,\n  type SkPaint,\n  type SkPath,\n  type SkPicture,\n  type SkPoint,\n  type SkRect,\n  type InputRRect,\n  type SkSVG,\n  type SkTextBlob,\n  type SkVertices,\n  type SkRSXform,\n  type CubicResampler,\n  type FilterOptions,\n  isCubicSampling,\n} from \"../types\";\n\nimport { getEnum, HostObject } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport type { JsiSkSVG } from \"./JsiSkSVG\";\n\nexport class JsiSkCanvas\n  extends HostObject<Canvas, \"Canvas\">\n  implements SkCanvas\n{\n  constructor(CanvasKit: CanvasKit, ref: Canvas) {\n    super(CanvasKit, ref, \"Canvas\");\n  }\n\n  drawRect(rect: SkRect, paint: SkPaint) {\n    this.ref.drawRect(\n      JsiSkRect.fromValue(this.CanvasKit, rect),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawImage(image: SkImage, x: number, y: number, paint?: SkPaint) {\n    this.ref.drawImage(\n      JsiSkImage.fromValue(image),\n      x,\n      y,\n      paint ? JsiSkPaint.fromValue(paint) : paint\n    );\n  }\n\n  drawImageRect(\n    img: SkImage,\n    src: SkRect,\n    dest: SkRect,\n    paint: SkPaint,\n    fastSample?: boolean\n  ) {\n    this.ref.drawImageRect(\n      JsiSkImage.fromValue(img),\n      JsiSkRect.fromValue(this.CanvasKit, src),\n      JsiSkRect.fromValue(this.CanvasKit, dest),\n      JsiSkPaint.fromValue(paint),\n      fastSample\n    );\n  }\n\n  drawImageCubic(\n    img: SkImage,\n    left: number,\n    top: number,\n    B: number,\n    C: number,\n    paint?: SkPaint | null\n  ) {\n    this.ref.drawImageCubic(\n      JsiSkImage.fromValue(img),\n      left,\n      top,\n      B,\n      C,\n      paint ? JsiSkPaint.fromValue(paint) : paint\n    );\n  }\n\n  drawImageOptions(\n    img: SkImage,\n    left: number,\n    top: number,\n    fm: FilterMode,\n    mm: MipmapMode,\n    paint?: SkPaint | null\n  ) {\n    this.ref.drawImageOptions(\n      JsiSkImage.fromValue(img),\n      left,\n      top,\n      getEnum(this.CanvasKit, \"FilterMode\", fm),\n      getEnum(this.CanvasKit, \"MipmapMode\", mm),\n      paint ? JsiSkPaint.fromValue(paint) : paint\n    );\n  }\n\n  drawImageNine(\n    img: SkImage,\n    center: SkRect,\n    dest: SkRect,\n    filter: FilterMode,\n    paint?: SkPaint | null\n  ) {\n    this.ref.drawImageNine(\n      JsiSkImage.fromValue(img),\n      Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),\n      JsiSkRect.fromValue(this.CanvasKit, dest),\n      getEnum(this.CanvasKit, \"FilterMode\", filter),\n      paint ? JsiSkPaint.fromValue(paint) : paint\n    );\n  }\n\n  drawImageRectCubic(\n    img: SkImage,\n    src: SkRect,\n    dest: SkRect,\n    B: number,\n    C: number,\n    paint?: SkPaint | null\n  ) {\n    this.ref.drawImageRectCubic(\n      JsiSkImage.fromValue(img),\n      JsiSkRect.fromValue(this.CanvasKit, src),\n      JsiSkRect.fromValue(this.CanvasKit, dest),\n      B,\n      C,\n      paint ? JsiSkPaint.fromValue(paint) : paint\n    );\n  }\n\n  drawImageRectOptions(\n    img: SkImage,\n    src: SkRect,\n    dest: SkRect,\n    fm: FilterMode,\n    mm: MipmapMode,\n    paint?: SkPaint | null\n  ) {\n    this.ref.drawImageRectOptions(\n      JsiSkImage.fromValue(img),\n      JsiSkRect.fromValue(this.CanvasKit, src),\n      JsiSkRect.fromValue(this.CanvasKit, dest),\n      getEnum(this.CanvasKit, \"FilterMode\", fm),\n      getEnum(this.CanvasKit, \"MipmapMode\", mm),\n      paint ? JsiSkPaint.fromValue(paint) : paint\n    );\n  }\n\n  drawPaint(paint: SkPaint) {\n    this.ref.drawPaint(JsiSkPaint.fromValue(paint));\n  }\n\n  drawLine(x0: number, y0: number, x1: number, y1: number, paint: SkPaint) {\n    this.ref.drawLine(x0, y0, x1, y1, JsiSkPaint.fromValue(paint));\n  }\n\n  drawCircle(cx: number, cy: number, radius: number, paint: SkPaint) {\n    this.ref.drawCircle(cx, cy, radius, JsiSkPaint.fromValue(paint));\n  }\n\n  drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {\n    this.ref.drawVertices(\n      JsiSkVertices.fromValue(verts),\n      getEnum(this.CanvasKit, \"BlendMode\", mode),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawPatch(\n    cubics: SkPoint[],\n    colors?: SkColor[] | null,\n    texs?: SkPoint[] | null,\n    mode?: BlendMode | null,\n    paint?: SkPaint\n  ) {\n    this.ref.drawPatch(\n      cubics.map(({ x, y }) => [x, y]).flat(),\n      colors,\n      texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,\n      mode ? getEnum(this.CanvasKit, \"BlendMode\", mode) : null,\n      paint ? JsiSkPaint.fromValue(paint) : undefined\n    );\n  }\n\n  restoreToCount(saveCount: number) {\n    this.ref.restoreToCount(saveCount);\n  }\n\n  getTotalMatrix(): SkMatrix {\n    return new JsiSkMatrix(\n      this.CanvasKit,\n      Float32Array.of(...this.ref.getTotalMatrix())\n    );\n  }\n\n  drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {\n    this.ref.drawPoints(\n      getEnum(this.CanvasKit, \"PointMode\", mode),\n      points.map(({ x, y }) => [x, y]).flat(),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawArc(\n    oval: SkRect,\n    startAngle: number,\n    sweepAngle: number,\n    useCenter: boolean,\n    paint: SkPaint\n  ) {\n    this.ref.drawArc(\n      JsiSkRect.fromValue(this.CanvasKit, oval),\n      startAngle,\n      sweepAngle,\n      useCenter,\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawRRect(rrect: InputRRect, paint: SkPaint) {\n    this.ref.drawRRect(\n      JsiSkRRect.fromValue(this.CanvasKit, rrect),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawDRRect(outer: InputRRect, inner: InputRRect, paint: SkPaint) {\n    this.ref.drawDRRect(\n      JsiSkRRect.fromValue(this.CanvasKit, outer),\n      JsiSkRRect.fromValue(this.CanvasKit, inner),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawOval(oval: SkRect, paint: SkPaint) {\n    this.ref.drawOval(\n      JsiSkRect.fromValue(this.CanvasKit, oval),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawPath(path: SkPath, paint: SkPaint) {\n    this.ref.drawPath(JsiSkPath.fromValue(path), JsiSkPaint.fromValue(paint));\n  }\n\n  drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont) {\n    this.ref.drawText(\n      str,\n      x,\n      y,\n      JsiSkPaint.fromValue(paint),\n      JsiSkFont.fromValue(font)\n    );\n  }\n\n  drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint) {\n    this.ref.drawTextBlob(\n      JsiSkTextBlob.fromValue(blob),\n      x,\n      y,\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawGlyphs(\n    glyphs: number[],\n    positions: SkPoint[],\n    x: number,\n    y: number,\n    font: SkFont,\n    paint: SkPaint\n  ) {\n    this.ref.drawGlyphs(\n      glyphs,\n      positions.map((p) => [p.x, p.y]).flat(),\n      x,\n      y,\n      JsiSkFont.fromValue(font),\n      JsiSkPaint.fromValue(paint)\n    );\n  }\n\n  drawSvg(svg: SkSVG, width?: number, height?: number) {\n    const ctm = this.ref.getLocalToDevice();\n    console.log({ ctm, width, height });\n    const image = this.CanvasKit.MakeImageFromCanvasImageSource(\n      (svg as JsiSkSVG).ref\n    );\n    this.ref.drawImage(image, 0, 0);\n  }\n\n  save() {\n    return this.ref.save();\n  }\n\n  saveLayer(\n    paint?: SkPaint,\n    bounds?: SkRect | null,\n    backdrop?: SkImageFilter | null,\n    flags?: SaveLayerFlag\n  ) {\n    return this.ref.saveLayer(\n      paint ? JsiSkPaint.fromValue(paint) : undefined,\n      bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : bounds,\n      backdrop ? JsiSkImageFilter.fromValue(backdrop) : backdrop,\n      flags\n    );\n  }\n\n  restore() {\n    this.ref.restore();\n  }\n\n  rotate(rotationInDegrees: number, rx: number, ry: number) {\n    this.ref.rotate(rotationInDegrees, rx, ry);\n  }\n\n  scale(sx: number, sy: number) {\n    this.ref.scale(sx, sy);\n  }\n\n  skew(sx: number, sy: number) {\n    this.ref.skew(sx, sy);\n  }\n\n  translate(dx: number, dy: number) {\n    this.ref.translate(dx, dy);\n  }\n\n  drawColor(color: SkColor, blendMode?: BlendMode) {\n    this.ref.drawColor(\n      color,\n      blendMode ? getEnum(this.CanvasKit, \"BlendMode\", blendMode) : undefined\n    );\n  }\n\n  clear(color: SkColor) {\n    this.ref.clear(color);\n  }\n\n  clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {\n    this.ref.clipPath(\n      JsiSkPath.fromValue(path),\n      getEnum(this.CanvasKit, \"PathOp\", op),\n      doAntiAlias\n    );\n  }\n\n  clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {\n    this.ref.clipRect(\n      JsiSkRect.fromValue(this.CanvasKit, rect),\n      getEnum(this.CanvasKit, \"PathOp\", op),\n      doAntiAlias\n    );\n  }\n\n  clipRRect(rrect: InputRRect, op: ClipOp, doAntiAlias: boolean) {\n    this.ref.clipRRect(\n      JsiSkRRect.fromValue(this.CanvasKit, rrect),\n      getEnum(this.CanvasKit, \"PathOp\", op),\n      doAntiAlias\n    );\n  }\n\n  concat(m: SkMatrix | number[]) {\n    this.ref.concat(Array.isArray(m) ? m : JsiSkMatrix.fromValue(m));\n  }\n\n  drawPicture(skp: SkPicture) {\n    this.ref.drawPicture(JsiSkPicture.fromValue(skp));\n  }\n\n  drawAtlas(\n    atlas: SkImage,\n    srcs: SkRect[],\n    dsts: SkRSXform[],\n    paint: SkPaint,\n    blendMode?: BlendMode,\n    colors?: SkColor[],\n    sampling?: CubicResampler | FilterOptions\n  ) {\n    const src = srcs.flatMap((s) =>\n      Array.from(JsiSkRect.fromValue(this.CanvasKit, s))\n    );\n    const dst = dsts.flatMap((s) => Array.from(JsiSkRSXform.fromValue(s)));\n    let cls: Uint32Array | undefined;\n    if (colors) {\n      cls = new Uint32Array(colors.length);\n      for (let i = 0; i < colors.length; i++) {\n        const [r, g, b, a] = colors[i];\n        cls[i] = this.CanvasKit.ColorAsInt(r * 255, g * 255, b * 255, a * 255);\n      }\n    }\n    let ckSampling: CKCubicResampler | CKFilterOptions = {\n      filter: this.CanvasKit.FilterMode.Linear,\n      mipmap: this.CanvasKit.MipmapMode.None,\n    };\n    if (sampling && isCubicSampling(sampling)) {\n      ckSampling = sampling;\n    } else if (sampling) {\n      ckSampling = {\n        filter: getEnum(this.CanvasKit, \"FilterMode\", sampling.filter),\n        mipmap: sampling.mipmap\n          ? getEnum(this.CanvasKit, \"MipmapMode\", sampling.mipmap)\n          : this.CanvasKit.MipmapMode.None,\n      };\n    }\n    this.ref.drawAtlas(\n      JsiSkImage.fromValue(atlas),\n      src,\n      dst,\n      JsiSkPaint.fromValue(paint),\n      blendMode\n        ? getEnum(this.CanvasKit, \"BlendMode\", blendMode)\n        : this.CanvasKit.BlendMode.DstOver,\n      cls,\n      ckSampling\n    );\n  }\n\n  readPixels(srcX: number, srcY: number, imageInfo: ImageInfo) {\n    const pxInfo = {\n      width: imageInfo.width,\n      height: imageInfo.height,\n      colorSpace: this.CanvasKit.ColorSpace.SRGB,\n      alphaType: getEnum(this.CanvasKit, \"AlphaType\", imageInfo.alphaType),\n      colorType: getEnum(this.CanvasKit, \"ColorType\", imageInfo.colorType),\n    };\n    return this.ref.readPixels(srcX, srcY, pxInfo);\n  }\n}\n"],"mappings":";;;;;;AAOA,IAAAA,MAAA,GAAAC,OAAA;AA6BA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AACA,IAAAY,iBAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AAGO,MAAMe,WAAW,SACdC,gBAAU,CAEpB;EACEC,WAAWA,CAACC,SAAoB,EAAEC,GAAW,EAAE;IAC7C,KAAK,CAACD,SAAS,EAAEC,GAA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AUA,CAACC,IAAY,EAAEC,IAAY,EAAEC,SAAoB,EAAE;IAC3D,MAAMC,MAAM,GAAG;MACbtE,KAAK,EAAEqE,SAAS,CAACrE,KAAK;MACtBC,MAAM,EAAEoE,SAAS,CAACpE,MAAM;MACxBsE,UAAU,EAAE,IAAI,CAACpK,SAAS,CAACqK,UAAU,CAACC,IAAI;MAC1CC,SAAS,EAAE,IAAA7I,aAAO,EAAC,IAAI,CAAC1B,SAAS,EAAE,WAAW,EAAEkK,SAAS,CAACK,SAAS,CAAC;MACpEC,SAAS,EAAE,IAAA9I,aAAO,EAAC,IAAI,CAAC1B,SAAS,EAAE,WAAW,EAAEkK,SAAS,CAACM,SAAS;IACrE,CAAC;IACD,OAAO,IAAI,CAACvK,GAAG,CAAC8J,UAAU,CAACC,IAAI,EAAEC,IAAI,EAAEE,MAAM,CAAC;EAChD;AACF;AAACM,OAAA,CAAA5K,WAAA,GAAAA,WAAA","ignoreList":[]}
         
     | 
| 
         @@ -8,7 +8,7 @@ import type { SkColor } from "./Color"; 
     | 
|
| 
       8 
8 
     | 
    
         
             
            import type { InputRRect } from "./RRect";
         
     | 
| 
       9 
9 
     | 
    
         
             
            import type { BlendMode } from "./Paint/BlendMode";
         
     | 
| 
       10 
10 
     | 
    
         
             
            import type { SkPoint, PointMode } from "./Point";
         
     | 
| 
       11 
     | 
    
         
            -
            import type { InputMatrix } from "./Matrix";
         
     | 
| 
      
 11 
     | 
    
         
            +
            import type { InputMatrix, SkMatrix } from "./Matrix";
         
     | 
| 
       12 
12 
     | 
    
         
             
            import type { SkImageFilter } from "./ImageFilter";
         
     | 
| 
       13 
13 
     | 
    
         
             
            import type { SkVertices } from "./Vertices";
         
     | 
| 
       14 
14 
     | 
    
         
             
            import type { SkTextBlob } from "./TextBlob";
         
     | 
| 
         @@ -167,6 +167,11 @@ export interface SkCanvas { 
     | 
|
| 
       167 
167 
     | 
    
         
             
                 * @param saveCount
         
     | 
| 
       168 
168 
     | 
    
         
             
                 */
         
     | 
| 
       169 
169 
     | 
    
         
             
                restoreToCount(saveCount: number): void;
         
     | 
| 
      
 170 
     | 
    
         
            +
                /**
         
     | 
| 
      
 171 
     | 
    
         
            +
                 * Legacy version of getLocalToDevice(), which strips away any Z information, and
         
     | 
| 
      
 172 
     | 
    
         
            +
                 * just returns a 3x3 version.
         
     | 
| 
      
 173 
     | 
    
         
            +
                 */
         
     | 
| 
      
 174 
     | 
    
         
            +
                getTotalMatrix(): SkMatrix;
         
     | 
| 
       170 
175 
     | 
    
         
             
                /**
         
     | 
| 
       171 
176 
     | 
    
         
             
                 * Draws the given points using the current clip, current matrix, and the provided paint.
         
     | 
| 
       172 
177 
     | 
    
         
             
                 *
         
     |