@shopify/react-native-skia 2.3.5 → 2.3.6
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/cpp/api/JsiSkCanvas.h +6 -0
 - 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 +249 -30
 - 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)
         
     | 
    
        package/cpp/api/JsiSkCanvas.h
    CHANGED
    
    | 
         @@ -241,6 +241,11 @@ public: 
     | 
|
| 
       241 
241 
     | 
    
         
             
                return static_cast<int>(_canvas->getSaveCount());
         
     | 
| 
       242 
242 
     | 
    
         
             
              }
         
     | 
| 
       243 
243 
     | 
    
         | 
| 
      
 244 
     | 
    
         
            +
              JSI_HOST_FUNCTION(getTotalMatrix) {
         
     | 
| 
      
 245 
     | 
    
         
            +
                auto matrix = std::make_shared<JsiSkMatrix>(getContext(), _canvas->getTotalMatrix());
         
     | 
| 
      
 246 
     | 
    
         
            +
                return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(runtime, matrix, getContext());
         
     | 
| 
      
 247 
     | 
    
         
            +
              }
         
     | 
| 
      
 248 
     | 
    
         
            +
             
     | 
| 
       244 
249 
     | 
    
         
             
              JSI_HOST_FUNCTION(drawPoints) {
         
     | 
| 
       245 
250 
     | 
    
         
             
                auto pointMode = arguments[0].asNumber();
         
     | 
| 
       246 
251 
     | 
    
         
             
                std::vector<SkPoint> points;
         
     | 
| 
         @@ -660,6 +665,7 @@ public: 
     | 
|
| 
       660 
665 
     | 
    
         
             
                                   JSI_EXPORT_FUNC(JsiSkCanvas, drawOval),
         
     | 
| 
       661 
666 
     | 
    
         
             
                                   JSI_EXPORT_FUNC(JsiSkCanvas, restoreToCount),
         
     | 
| 
       662 
667 
     | 
    
         
             
                                   JSI_EXPORT_FUNC(JsiSkCanvas, getSaveCount),
         
     | 
| 
      
 668 
     | 
    
         
            +
                                   JSI_EXPORT_FUNC(JsiSkCanvas, getTotalMatrix),
         
     | 
| 
       663 
669 
     | 
    
         
             
                                   JSI_EXPORT_FUNC(JsiSkCanvas, drawPoints),
         
     | 
| 
       664 
670 
     | 
    
         
             
                                   JSI_EXPORT_FUNC(JsiSkCanvas, drawPatch),
         
     | 
| 
       665 
671 
     | 
    
         
             
                                   JSI_EXPORT_FUNC(JsiSkCanvas, drawPath),
         
     | 
| 
         @@ -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"],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Q,CAACgB,MAAM,CAAC,GACtD,IAAI,CAACtJ,SAAS,CAACuJ,UAAU,CAACC;MAChC,CAAC;IACH;IACA,IAAI,CAACvJ,GAAG,CAACiI,SAAS,CAChBtH,sBAAU,CAACN,SAAS,CAAC6H,KAAK,CAAC,EAC3BpH,GAAG,EACHyH,GAAG,EACHjI,sBAAU,CAACD,SAAS,CAACF,KAAK,CAAC,EAC3BgH,SAAS,GACL,IAAA1F,aAAO,EAAC,IAAI,CAAC1B,SAAS,EAAE,WAAW,EAAEoH,SAAS,CAAC,GAC/C,IAAI,CAACpH,SAAS,CAAC0J,SAAS,CAACC,OAAO,EACpCjB,GAAG,EACHS,UACF,CAAC;EACH;EAEAS,UAAUA,CAACC,IAAY,EAAEC,IAAY,EAAEC,SAAoB,EAAE;IAC3D,MAAMC,MAAM,GAAG;MACbvE,KAAK,EAAEsE,SAAS,CAACtE,KAAK;MACtBC,MAAM,EAAEqE,SAAS,CAACrE,MAAM;MACxBuE,UAAU,EAAE,IAAI,CAACjK,SAAS,CAACkK,UAAU,CAACC,IAAI;MAC1CC,SAAS,EAAE,IAAA1I,aAAO,EAAC,IAAI,CAAC1B,SAAS,EAAE,WAAW,EAAE+J,SAAS,CAACK,SAAS,CAAC;MACpEC,SAAS,EAAE,IAAA3I,aAAO,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,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,sBAAU,CAACD,SAAS,CAACF,KAAK,CAC5B,CAAC;EACH;EAEAI,SAASA,CAACC,KAAc,EAAEC,CAAS,EAAEC,CAAS,EAAEP,KAAe,EAAE;IAC/D,IAAI,CAACH,GAAG,CAACO,SAAS,CAChBI,sBAAU,CAACN,SAAS,CAACG,KAAK,CAAC,EAC3BC,CAAC,EACDC,CAAC,EACDP,KAAK,GA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ACrE,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 
     | 
    
         
             
                 *
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"names":["ClipOp","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":"AAuBA,WAAYA,MAAM,0BAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAKlB,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA","ignoreList":[]}
         
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"names":["ClipOp","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":"AAuBA,WAAYA,MAAM,0BAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAKlB,WAAYC,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;
         
     | 
| 
         @@ -62,6 +62,9 @@ export class JsiSkCanvas extends HostObject { 
     | 
|
| 
       62 
62 
     | 
    
         
             
              restoreToCount(saveCount) {
         
     | 
| 
       63 
63 
     | 
    
         
             
                this.ref.restoreToCount(saveCount);
         
     | 
| 
       64 
64 
     | 
    
         
             
              }
         
     | 
| 
      
 65 
     | 
    
         
            +
              getTotalMatrix() {
         
     | 
| 
      
 66 
     | 
    
         
            +
                return new JsiSkMatrix(this.CanvasKit, Float32Array.of(...this.ref.getTotalMatrix()));
         
     | 
| 
      
 67 
     | 
    
         
            +
              }
         
     | 
| 
       65 
68 
     | 
    
         
             
              drawPoints(mode, points, paint) {
         
     | 
| 
       66 
69 
     | 
    
         
             
                this.ref.drawPoints(getEnum(this.CanvasKit, "PointMode", mode), points.map(({
         
     | 
| 
       67 
70 
     | 
    
         
             
                  x,
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"names":["isCubicSampling","getEnum","HostObject","JsiSkPaint","JsiSkRect","JsiSkRRect","JsiSkImage","JsiSkVertices","JsiSkPath","JsiSkFont","JsiSkTextBlob","JsiSkPicture","JsiSkMatrix","JsiSkImageFilter","JsiSkPoint","JsiSkRSXform","JsiSkCanvas","constructor","CanvasKit","ref","drawRect","rect","paint","fromValue","drawImage","image","x","y","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","drawPatch","cubics","colors","texs","map","flat","flatMap","p","undefined","restoreToCount","saveCount","drawPoints","points","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","drawDRRect","outer","inner","drawOval","drawPath","path","drawText","str","font","drawTextBlob","blob","drawGlyphs","glyphs","positions","drawSvg","svg","width","height","ctm","getLocalToDevice","console","log","MakeImageFromCanvasImageSource","save","saveLayer","bounds","backdrop","flags","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","drawAtlas","atlas","srcs","dsts","sampling","s","dst","cls","Uint32Array","length","i","r","g","b","a","ColorAsInt","ckSampling","FilterMode","Linear","mipmap","MipmapMode","None","BlendMode","DstOver","readPixels","srcX","srcY","imageInfo","pxInfo","colorSpace","ColorSpace","SRGB","alphaType","colorType"],"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,SA0BEA,eAAe,QACV,UAAU;AAEjB,SAASC,OAAO,EAAEC,UAAU,QAAQ,QAAQ;AAC5C,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,YAAY,QAAQ,gBAAgB;AAG7C,OAAO,MAAMC,WAAW,SACdd,UAAU,CAEpB;EACEe,WAAWA,CAACC,SAAoB,EAAEC,GAAW,EAAE;IAC7C,KAAK,CAACD,SAAS,EAAEC,GAAG,EAAE,QAAQ,CAAC;EACjC;EAEAC,QAAQA,CAACC,IAAY,EAAEC,KA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AEgJ,SAAS,CAACM,SAAS;IACrE,CAAC;IACD,OAAO,IAAI,CAACrJ,GAAG,CAAC4I,UAAU,CAACC,IAAI,EAAEC,IAAI,EAAEE,MAAM,CAAC;EAChD;AACF","ignoreList":[]}
         
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"names":["isCubicSampling","getEnum","HostObject","JsiSkPaint","JsiSkRect","JsiSkRRect","JsiSkImage","JsiSkVertices","JsiSkPath","JsiSkFont","JsiSkTextBlob","JsiSkPicture","JsiSkMatrix","JsiSkImageFilter","JsiSkPoint","JsiSkRSXform","JsiSkCanvas","constructor","CanvasKit","ref","drawRect","rect","paint","fromValue","drawImage","image","x","y","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","drawPatch","cubics","colors","texs","map","flat","flatMap","p","undefined","restoreToCount","saveCount","getTotalMatrix","Float32Array","of","drawPoints","points","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","drawDRRect","outer","inner","drawOval","drawPath","path","drawText","str","font","drawTextBlob","blob","drawGlyphs","glyphs","positions","drawSvg","svg","width","height","ctm","getLocalToDevice","console","log","MakeImageFromCanvasImageSource","save","saveLayer","bounds","backdrop","flags","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","drawAtlas","atlas","srcs","dsts","sampling","s","dst","cls","Uint32Array","length","i","r","g","b","a","ColorAsInt","ckSampling","FilterMode","Linear","mipmap","MipmapMode","None","BlendMode","DstOver","readPixels","srcX","srcY","imageInfo","pxInfo","colorSpace","ColorSpace","SRGB","alphaType","colorType"],"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,SA0BEA,eAAe,QACV,UAAU;AAEjB,SAASC,OAAO,EAAEC,UAAU,QAAQ,QAAQ;AAC5C,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,YAAY,QAAQ,gBAAgB;AAG7C,OAAO,MAAMC,WAAW,SACdd,UAAU,CAEpB;EACEe,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,CACfhB,SAAS,CAACmB,SAAS,CAAC,IAAI,CAACL,SAAS,EAAEG,IAAI,CAAC,EACzClB,UAAU,CAACoB,SAAS,CAACD,KAAK,CAC5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S,EAAE,WAAW,EAAEmJ,SAAS,CAACM,SAAS;IACrE,CAAC;IACD,OAAO,IAAI,CAACxJ,GAAG,CAAC+I,UAAU,CAACC,IAAI,EAAEC,IAAI,EAAEE,MAAM,CAAC;EAChD;AACF","ignoreList":[]}
         
     | 
| 
         @@ -15,6 +15,7 @@ export class JsiSkCanvas extends _Host.HostObject { 
     | 
|
| 
       15 
15 
     | 
    
         
             
                drawVertices(verts: any, mode: any, paint: any): void;
         
     | 
| 
       16 
16 
     | 
    
         
             
                drawPatch(cubics: any, colors: any, texs: any, mode: any, paint: any): void;
         
     | 
| 
       17 
17 
     | 
    
         
             
                restoreToCount(saveCount: any): void;
         
     | 
| 
      
 18 
     | 
    
         
            +
                getTotalMatrix(): _JsiSkMatrix.JsiSkMatrix;
         
     | 
| 
       18 
19 
     | 
    
         
             
                drawPoints(mode: any, points: any, paint: any): void;
         
     | 
| 
       19 
20 
     | 
    
         
             
                drawArc(oval: any, startAngle: any, sweepAngle: any, useCenter: any, paint: any): void;
         
     | 
| 
       20 
21 
     | 
    
         
             
                drawRRect(rrect: any, paint: any): void;
         
     | 
| 
         @@ -43,3 +44,4 @@ export class JsiSkCanvas extends _Host.HostObject { 
     | 
|
| 
       43 
44 
     | 
    
         
             
                readPixels(srcX: any, srcY: any, imageInfo: any): any;
         
     | 
| 
       44 
45 
     | 
    
         
             
            }
         
     | 
| 
       45 
46 
     | 
    
         
             
            import _Host = require("./Host");
         
     | 
| 
      
 47 
     | 
    
         
            +
            import _JsiSkMatrix = require("./JsiSkMatrix");
         
     | 
| 
         @@ -14,6 +14,7 @@ export class JsiSkCanvas extends HostObject { 
     | 
|
| 
       14 
14 
     | 
    
         
             
                drawVertices(verts: any, mode: any, paint: any): void;
         
     | 
| 
       15 
15 
     | 
    
         
             
                drawPatch(cubics: any, colors: any, texs: any, mode: any, paint: any): void;
         
     | 
| 
       16 
16 
     | 
    
         
             
                restoreToCount(saveCount: any): void;
         
     | 
| 
      
 17 
     | 
    
         
            +
                getTotalMatrix(): JsiSkMatrix;
         
     | 
| 
       17 
18 
     | 
    
         
             
                drawPoints(mode: any, points: any, paint: any): void;
         
     | 
| 
       18 
19 
     | 
    
         
             
                drawArc(oval: any, startAngle: any, sweepAngle: any, useCenter: any, paint: any): void;
         
     | 
| 
       19 
20 
     | 
    
         
             
                drawRRect(rrect: any, paint: any): void;
         
     | 
| 
         @@ -42,3 +43,4 @@ export class JsiSkCanvas extends HostObject { 
     | 
|
| 
       42 
43 
     | 
    
         
             
                readPixels(srcX: any, srcY: any, imageInfo: any): any;
         
     | 
| 
       43 
44 
     | 
    
         
             
            }
         
     | 
| 
       44 
45 
     | 
    
         
             
            import { HostObject } from "./Host";
         
     | 
| 
      
 46 
     | 
    
         
            +
            import { JsiSkMatrix } from "./JsiSkMatrix";
         
     | 
| 
         @@ -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 
     | 
    
         
             
                 *
         
     | 
| 
         @@ -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;
         
     | 
    
        package/package.json
    CHANGED
    
    | 
         @@ -8,8 +8,27 @@ 
     | 
|
| 
       8 
8 
     | 
    
         
             
                "setup-skia-web": "scripts/setup-canvaskit.js"
         
     | 
| 
       9 
9 
     | 
    
         
             
              },
         
     | 
| 
       10 
10 
     | 
    
         
             
              "title": "React Native Skia",
         
     | 
| 
       11 
     | 
    
         
            -
              "version": "2.3. 
     | 
| 
       12 
     | 
    
         
            -
              " 
     | 
| 
      
 11 
     | 
    
         
            +
              "version": "2.3.6",
         
     | 
| 
      
 12 
     | 
    
         
            +
              "skia": {
         
     | 
| 
      
 13 
     | 
    
         
            +
                "version": "m142",
         
     | 
| 
      
 14 
     | 
    
         
            +
                "checksums": {
         
     | 
| 
      
 15 
     | 
    
         
            +
                  "android-armeabi-v7a": "5ae357eb26d9ec93797bacbc865b86eff6ac54b3a9466a1b0c41c27018cc3150",
         
     | 
| 
      
 16 
     | 
    
         
            +
                  "android-arm64-v8a": "c310bd5261de1ab5f4afdb05aa51bf0f56d625f6285617e149af517a2d375e52",
         
     | 
| 
      
 17 
     | 
    
         
            +
                  "android-x86": "26a18ade07de8318be2ec82bd82a1d7f2709893462229d70f0d353c6c8691cc3",
         
     | 
| 
      
 18 
     | 
    
         
            +
                  "android-x86_64": "46a5576b6f8e7d1372c27576ad750384c2d6f892bfe3fc0ee260c68d08ebd844",
         
     | 
| 
      
 19 
     | 
    
         
            +
                  "apple-xcframeworks": "343fad71c01e1f8331d4421c7efe0ae6dff3a7d25361c466dcda7dc3737cdd5c"
         
     | 
| 
      
 20 
     | 
    
         
            +
                }
         
     | 
| 
      
 21 
     | 
    
         
            +
              },
         
     | 
| 
      
 22 
     | 
    
         
            +
              "skia-graphite": {
         
     | 
| 
      
 23 
     | 
    
         
            +
                "version": "m142",
         
     | 
| 
      
 24 
     | 
    
         
            +
                "checksums": {
         
     | 
| 
      
 25 
     | 
    
         
            +
                  "android-armeabi-v7a": "8ea6fc4e64dfba9afd74aebde114819fecf05924a8209839482d7dca38203f85",
         
     | 
| 
      
 26 
     | 
    
         
            +
                  "android-arm64-v8a": "6be2711ca4c31523d381420e98cabfe7e7939e246975c7b427968d5dd3b62be9",
         
     | 
| 
      
 27 
     | 
    
         
            +
                  "android-x86": "888934ddc34f431c7fac5628f633dc11a4e84d68c41adb33307ae7586cc7b0b5",
         
     | 
| 
      
 28 
     | 
    
         
            +
                  "android-x86_64": "2180a5be52d51bbf1dabaf95051ed0ce422b047157bcda6e486657c2c7b87ceb",
         
     | 
| 
      
 29 
     | 
    
         
            +
                  "apple-xcframeworks": "cb50d9c85c9f02389ecc433912145e4a7ce2277bfe26a69dd7f7a9db74c9e276"
         
     | 
| 
      
 30 
     | 
    
         
            +
                }
         
     | 
| 
      
 31 
     | 
    
         
            +
              },
         
     | 
| 
       13 
32 
     | 
    
         
             
              "description": "High-performance React Native Graphics using Skia",
         
     | 
| 
       14 
33 
     | 
    
         
             
              "main": "lib/module/index.js",
         
     | 
| 
       15 
34 
     | 
    
         
             
              "react-native": "src/index.ts",
         
     | 
| 
         @@ -46,7 +65,7 @@ 
     | 
|
| 
       46 
65 
     | 
    
         
             
                "clean-skia": "yarn rimraf ./libs && yarn rimraf ../../externals/skia/out",
         
     | 
| 
       47 
66 
     | 
    
         
             
                "build-skia": "tsx ./scripts/build-skia.ts",
         
     | 
| 
       48 
67 
     | 
    
         
             
                "copy-skia-headers": "tsx ./scripts/copy-skia-headers.ts",
         
     | 
| 
       49 
     | 
    
         
            -
                "install-skia": "node ./scripts/install-skia.mjs && yarn copy-skia-headers",
         
     | 
| 
      
 68 
     | 
    
         
            +
                "install-skia": "node ./scripts/install-skia.mjs --force && yarn copy-skia-headers",
         
     | 
| 
       50 
69 
     | 
    
         
             
                "clang-format": "yarn clang-format-ios && yarn clang-format-android && yarn clang-format-common",
         
     | 
| 
       51 
70 
     | 
    
         
             
                "clang-format-ios": "find apple/ -iname '*.h' -o -iname '*.mm' -o -iname '*.cpp' | xargs clang-format -i",
         
     | 
| 
       52 
71 
     | 
    
         
             
                "clang-format-android": "find android/cpp/ -iname '*.h' -o -iname '*.m' -o -iname '*.cpp' | xargs clang-format -i",
         
     | 
    
        package/scripts/install-skia.mjs
    CHANGED
    
    | 
         @@ -2,6 +2,7 @@ import fs from "fs"; 
     | 
|
| 
       2 
2 
     | 
    
         
             
            import https from "https";
         
     | 
| 
       3 
3 
     | 
    
         
             
            import path from "path";
         
     | 
| 
       4 
4 
     | 
    
         
             
            import os from "os";
         
     | 
| 
      
 5 
     | 
    
         
            +
            import crypto from "crypto";
         
     | 
| 
       5 
6 
     | 
    
         
             
            import { spawn } from "child_process";
         
     | 
| 
       6 
7 
     | 
    
         
             
            import { fileURLToPath } from "url";
         
     | 
| 
       7 
8 
     | 
    
         | 
| 
         @@ -9,10 +10,34 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); 
     | 
|
| 
       9 
10 
     | 
    
         | 
| 
       10 
11 
     | 
    
         
             
            const repo = "shopify/react-native-skia";
         
     | 
| 
       11 
12 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
            const  
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
              return  
     | 
| 
      
 13 
     | 
    
         
            +
            const packageJsonPath = path.join(__dirname, "..", "package.json");
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            const getPackageJson = () => {
         
     | 
| 
      
 16 
     | 
    
         
            +
              return JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
         
     | 
| 
      
 17 
     | 
    
         
            +
            };
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            const getSkiaConfig = (graphite = false) => {
         
     | 
| 
      
 20 
     | 
    
         
            +
              const packageJson = getPackageJson();
         
     | 
| 
      
 21 
     | 
    
         
            +
              return graphite ? packageJson["skia-graphite"] : packageJson.skia;
         
     | 
| 
      
 22 
     | 
    
         
            +
            };
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
            const getSkiaVersion = (graphite = false) => {
         
     | 
| 
      
 25 
     | 
    
         
            +
              const packageJson = getPackageJson();
         
     | 
| 
      
 26 
     | 
    
         
            +
              const skiaConfig = getSkiaConfig(graphite);
         
     | 
| 
      
 27 
     | 
    
         
            +
              return skiaConfig?.version || packageJson.skiaVersion;
         
     | 
| 
      
 28 
     | 
    
         
            +
            };
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
            const updateSkiaChecksums = (checksums, graphite = false) => {
         
     | 
| 
      
 31 
     | 
    
         
            +
              const packageJson = getPackageJson();
         
     | 
| 
      
 32 
     | 
    
         
            +
              const field = graphite ? "skia-graphite" : "skia";
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
              if (!packageJson[field]) {
         
     | 
| 
      
 35 
     | 
    
         
            +
                packageJson[field] = { version: packageJson[field]?.version || "m142", checksums: {} };
         
     | 
| 
      
 36 
     | 
    
         
            +
              }
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
              packageJson[field].checksums = checksums;
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
              fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + "\n", "utf8");
         
     | 
| 
       16 
41 
     | 
    
         
             
            };
         
     | 
| 
       17 
42 
     | 
    
         | 
| 
       18 
43 
     | 
    
         
             
            const GRAPHITE = !!process.env.SK_GRAPHITE;
         
     | 
| 
         @@ -25,13 +50,13 @@ const names = [ 
     | 
|
| 
       25 
50 
     | 
    
         
             
              `${prefix}-apple-xcframeworks`,
         
     | 
| 
       26 
51 
     | 
    
         
             
            ];
         
     | 
| 
       27 
52 
     | 
    
         
             
            if (GRAPHITE) {
         
     | 
| 
       28 
     | 
    
         
            -
              names.push( 
     | 
| 
      
 53 
     | 
    
         
            +
              names.push(`${prefix}-headers`);
         
     | 
| 
       29 
54 
     | 
    
         
             
            }
         
     | 
| 
       30 
55 
     | 
    
         | 
| 
       31 
     | 
    
         
            -
            const skiaVersion = getSkiaVersion();
         
     | 
| 
       32 
     | 
    
         
            -
            const releaseTag = `skia-${skiaVersion}`;
         
     | 
| 
      
 56 
     | 
    
         
            +
            const skiaVersion = getSkiaVersion(GRAPHITE);
         
     | 
| 
      
 57 
     | 
    
         
            +
            const releaseTag = GRAPHITE ? `skia-graphite-${skiaVersion}` : `skia-${skiaVersion}`;
         
     | 
| 
       33 
58 
     | 
    
         
             
            console.log(
         
     | 
| 
       34 
     | 
    
         
            -
              `📦 Downloading Skia prebuilt binaries for  
     | 
| 
      
 59 
     | 
    
         
            +
              `📦 Downloading Skia prebuilt binaries for ${releaseTag}`
         
     | 
| 
       35 
60 
     | 
    
         
             
            );
         
     | 
| 
       36 
61 
     | 
    
         | 
| 
       37 
62 
     | 
    
         
             
            const runCommand = (command, args) => {
         
     | 
| 
         @@ -178,6 +203,92 @@ const artifactsDir = path.resolve( 
     | 
|
| 
       178 
203 
     | 
    
         | 
| 
       179 
204 
     | 
    
         
             
            const libsDir = path.resolve(__dirname, "../libs");
         
     | 
| 
       180 
205 
     | 
    
         | 
| 
      
 206 
     | 
    
         
            +
            // Function to calculate the checksum of a directory
         
     | 
| 
      
 207 
     | 
    
         
            +
            const calculateDirectoryChecksum = (directory) => {
         
     | 
| 
      
 208 
     | 
    
         
            +
              if (!fs.existsSync(directory)) {
         
     | 
| 
      
 209 
     | 
    
         
            +
                return null;
         
     | 
| 
      
 210 
     | 
    
         
            +
              }
         
     | 
| 
      
 211 
     | 
    
         
            +
             
     | 
| 
      
 212 
     | 
    
         
            +
              const hash = crypto.createHash("sha256");
         
     | 
| 
      
 213 
     | 
    
         
            +
              const files = [];
         
     | 
| 
      
 214 
     | 
    
         
            +
             
     | 
| 
      
 215 
     | 
    
         
            +
              const collectFiles = (dir) => {
         
     | 
| 
      
 216 
     | 
    
         
            +
                const entries = fs.readdirSync(dir, { withFileTypes: true });
         
     | 
| 
      
 217 
     | 
    
         
            +
                for (const entry of entries) {
         
     | 
| 
      
 218 
     | 
    
         
            +
                  const fullPath = path.join(dir, entry.name);
         
     | 
| 
      
 219 
     | 
    
         
            +
                  if (entry.isDirectory()) {
         
     | 
| 
      
 220 
     | 
    
         
            +
                    collectFiles(fullPath);
         
     | 
| 
      
 221 
     | 
    
         
            +
                  } else if (entry.isFile()) {
         
     | 
| 
      
 222 
     | 
    
         
            +
                    files.push(fullPath);
         
     | 
| 
      
 223 
     | 
    
         
            +
                  }
         
     | 
| 
      
 224 
     | 
    
         
            +
                }
         
     | 
| 
      
 225 
     | 
    
         
            +
              };
         
     | 
| 
      
 226 
     | 
    
         
            +
             
     | 
| 
      
 227 
     | 
    
         
            +
              collectFiles(directory);
         
     | 
| 
      
 228 
     | 
    
         
            +
              files.sort();
         
     | 
| 
      
 229 
     | 
    
         
            +
             
     | 
| 
      
 230 
     | 
    
         
            +
              for (const file of files) {
         
     | 
| 
      
 231 
     | 
    
         
            +
                const relativePath = path.relative(directory, file);
         
     | 
| 
      
 232 
     | 
    
         
            +
                hash.update(relativePath);
         
     | 
| 
      
 233 
     | 
    
         
            +
                hash.update(fs.readFileSync(file));
         
     | 
| 
      
 234 
     | 
    
         
            +
              }
         
     | 
| 
      
 235 
     | 
    
         
            +
             
     | 
| 
      
 236 
     | 
    
         
            +
              return hash.digest("hex");
         
     | 
| 
      
 237 
     | 
    
         
            +
            };
         
     | 
| 
      
 238 
     | 
    
         
            +
             
     | 
| 
      
 239 
     | 
    
         
            +
            // Function to calculate all library checksums
         
     | 
| 
      
 240 
     | 
    
         
            +
            const calculateLibraryChecksums = () => {
         
     | 
| 
      
 241 
     | 
    
         
            +
              const checksums = {};
         
     | 
| 
      
 242 
     | 
    
         
            +
             
     | 
| 
      
 243 
     | 
    
         
            +
              // Android architectures
         
     | 
| 
      
 244 
     | 
    
         
            +
              const androidArchs = ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"];
         
     | 
| 
      
 245 
     | 
    
         
            +
              for (const arch of androidArchs) {
         
     | 
| 
      
 246 
     | 
    
         
            +
                const archDir = path.join(libsDir, "android", arch);
         
     | 
| 
      
 247 
     | 
    
         
            +
                const checksum = calculateDirectoryChecksum(archDir);
         
     | 
| 
      
 248 
     | 
    
         
            +
                if (checksum) {
         
     | 
| 
      
 249 
     | 
    
         
            +
                  const checksumKey = `android-${arch}`;
         
     | 
| 
      
 250 
     | 
    
         
            +
                  checksums[checksumKey] = checksum;
         
     | 
| 
      
 251 
     | 
    
         
            +
                }
         
     | 
| 
      
 252 
     | 
    
         
            +
              }
         
     | 
| 
      
 253 
     | 
    
         
            +
             
     | 
| 
      
 254 
     | 
    
         
            +
              // Apple frameworks
         
     | 
| 
      
 255 
     | 
    
         
            +
              const appleDir = path.join(libsDir, "apple");
         
     | 
| 
      
 256 
     | 
    
         
            +
              const appleChecksum = calculateDirectoryChecksum(appleDir);
         
     | 
| 
      
 257 
     | 
    
         
            +
              if (appleChecksum) {
         
     | 
| 
      
 258 
     | 
    
         
            +
                checksums["apple-xcframeworks"] = appleChecksum;
         
     | 
| 
      
 259 
     | 
    
         
            +
              }
         
     | 
| 
      
 260 
     | 
    
         
            +
             
     | 
| 
      
 261 
     | 
    
         
            +
              return checksums;
         
     | 
| 
      
 262 
     | 
    
         
            +
            };
         
     | 
| 
      
 263 
     | 
    
         
            +
             
     | 
| 
      
 264 
     | 
    
         
            +
            // Function to verify if checksums match
         
     | 
| 
      
 265 
     | 
    
         
            +
            const verifyChecksums = () => {
         
     | 
| 
      
 266 
     | 
    
         
            +
              const skiaConfig = getSkiaConfig(GRAPHITE);
         
     | 
| 
      
 267 
     | 
    
         
            +
              const expectedChecksums = skiaConfig?.checksums || {};
         
     | 
| 
      
 268 
     | 
    
         
            +
             
     | 
| 
      
 269 
     | 
    
         
            +
              // If no checksums in package.json, we need to download
         
     | 
| 
      
 270 
     | 
    
         
            +
              if (Object.keys(expectedChecksums).length === 0) {
         
     | 
| 
      
 271 
     | 
    
         
            +
                console.log("⚠️  No checksums found in package.json");
         
     | 
| 
      
 272 
     | 
    
         
            +
                return false;
         
     | 
| 
      
 273 
     | 
    
         
            +
              }
         
     | 
| 
      
 274 
     | 
    
         
            +
             
     | 
| 
      
 275 
     | 
    
         
            +
              const actualChecksums = calculateLibraryChecksums();
         
     | 
| 
      
 276 
     | 
    
         
            +
             
     | 
| 
      
 277 
     | 
    
         
            +
              // Check if all expected checksums match
         
     | 
| 
      
 278 
     | 
    
         
            +
              for (const [key, expectedChecksum] of Object.entries(expectedChecksums)) {
         
     | 
| 
      
 279 
     | 
    
         
            +
                const actualChecksum = actualChecksums[key];
         
     | 
| 
      
 280 
     | 
    
         
            +
                if (actualChecksum !== expectedChecksum) {
         
     | 
| 
      
 281 
     | 
    
         
            +
                  console.log(`⚠️  Checksum mismatch for ${key}`);
         
     | 
| 
      
 282 
     | 
    
         
            +
                  console.log(`   Expected: ${expectedChecksum}`);
         
     | 
| 
      
 283 
     | 
    
         
            +
                  console.log(`   Actual: ${actualChecksum || "missing"}`);
         
     | 
| 
      
 284 
     | 
    
         
            +
                  return false;
         
     | 
| 
      
 285 
     | 
    
         
            +
                }
         
     | 
| 
      
 286 
     | 
    
         
            +
              }
         
     | 
| 
      
 287 
     | 
    
         
            +
             
     | 
| 
      
 288 
     | 
    
         
            +
              console.log("✅ All checksums match");
         
     | 
| 
      
 289 
     | 
    
         
            +
              return true;
         
     | 
| 
      
 290 
     | 
    
         
            +
            };
         
     | 
| 
      
 291 
     | 
    
         
            +
             
     | 
| 
       181 
292 
     | 
    
         
             
            // Function to check if prebuilt binaries are already installed
         
     | 
| 
       182 
293 
     | 
    
         
             
            const areBinariesInstalled = () => {
         
     | 
| 
       183 
294 
     | 
    
         
             
              if (!fs.existsSync(libsDir)) {
         
     | 
| 
         @@ -223,17 +334,14 @@ const clearDirectory = (directory) => { 
     | 
|
| 
       223 
334 
     | 
    
         
             
            };
         
     | 
| 
       224 
335 
     | 
    
         | 
| 
       225 
336 
     | 
    
         
             
            const main = async () => {
         
     | 
| 
       226 
     | 
    
         
            -
               
     | 
| 
       227 
     | 
    
         
            -
             
     | 
| 
       228 
     | 
    
         
            -
             
     | 
| 
       229 
     | 
    
         
            -
              if (!forceReinstall && areBinariesInstalled()) {
         
     | 
| 
       230 
     | 
    
         
            -
                console.log("✅ Prebuilt binaries already installed, skipping download");
         
     | 
| 
       231 
     | 
    
         
            -
                console.log("   Use --force to reinstall");
         
     | 
| 
      
 337 
     | 
    
         
            +
              // Check if binaries are installed and checksums match
         
     | 
| 
      
 338 
     | 
    
         
            +
              if (areBinariesInstalled() && verifyChecksums()) {
         
     | 
| 
      
 339 
     | 
    
         
            +
                console.log("✅ Prebuilt binaries already installed with matching checksums, skipping download");
         
     | 
| 
       232 
340 
     | 
    
         
             
                return;
         
     | 
| 
       233 
341 
     | 
    
         
             
              }
         
     | 
| 
       234 
342 
     | 
    
         | 
| 
       235 
     | 
    
         
            -
              if ( 
     | 
| 
       236 
     | 
    
         
            -
                console.log(" 
     | 
| 
      
 343 
     | 
    
         
            +
              if (areBinariesInstalled()) {
         
     | 
| 
      
 344 
     | 
    
         
            +
                console.log("⚠️  Binaries installed but checksums don't match, re-downloading...");
         
     | 
| 
       237 
345 
     | 
    
         
             
              }
         
     | 
| 
       238 
346 
     | 
    
         | 
| 
       239 
347 
     | 
    
         
             
              console.log("🧹 Clearing existing artifacts...");
         
     | 
| 
         @@ -270,22 +378,50 @@ const main = async () => { 
     | 
|
| 
       270 
378 
     | 
    
         
             
              fs.mkdirSync(androidDir, { recursive: true });
         
     | 
| 
       271 
379 
     | 
    
         | 
| 
       272 
380 
     | 
    
         
             
              // Copy android artifacts
         
     | 
| 
       273 
     | 
    
         
            -
              const androidArchs = [
         
     | 
| 
       274 
     | 
    
         
            -
                {  
     | 
| 
       275 
     | 
    
         
            -
                {  
     | 
| 
       276 
     | 
    
         
            -
                {  
     | 
| 
       277 
     | 
    
         
            -
                {  
     | 
| 
      
 381 
     | 
    
         
            +
              const androidArchs = GRAPHITE ? [
         
     | 
| 
      
 382 
     | 
    
         
            +
                { artifact: `${prefix}-android-arm`, srcSubdir: "arm", dest: "armeabi-v7a" },
         
     | 
| 
      
 383 
     | 
    
         
            +
                { artifact: `${prefix}-android-arm-64`, srcSubdir: "arm64", dest: "arm64-v8a" },
         
     | 
| 
      
 384 
     | 
    
         
            +
                { artifact: `${prefix}-android-arm-x86`, srcSubdir: "x86", dest: "x86" },
         
     | 
| 
      
 385 
     | 
    
         
            +
                { artifact: `${prefix}-android-arm-x64`, srcSubdir: "x64", dest: "x86_64" },
         
     | 
| 
      
 386 
     | 
    
         
            +
              ] : [
         
     | 
| 
      
 387 
     | 
    
         
            +
                { artifact: `${prefix}-android-arm`, srcSubdir: "armeabi-v7a", dest: "armeabi-v7a" },
         
     | 
| 
      
 388 
     | 
    
         
            +
                { artifact: `${prefix}-android-arm-64`, srcSubdir: "arm64-v8a", dest: "arm64-v8a" },
         
     | 
| 
      
 389 
     | 
    
         
            +
                { artifact: `${prefix}-android-arm-x86`, srcSubdir: "x86", dest: "x86" },
         
     | 
| 
      
 390 
     | 
    
         
            +
                { artifact: `${prefix}-android-arm-x64`, srcSubdir: "x86_64", dest: "x86_64" },
         
     | 
| 
       278 
391 
     | 
    
         
             
              ];
         
     | 
| 
       279 
392 
     | 
    
         | 
| 
       280 
     | 
    
         
            -
              androidArchs.forEach(({  
     | 
| 
       281 
     | 
    
         
            -
                // The tar file extracts to artifactName/ 
     | 
| 
       282 
     | 
    
         
            -
                const srcDir = path.join(artifactsDir,  
     | 
| 
      
 393 
     | 
    
         
            +
              androidArchs.forEach(({ artifact, srcSubdir, dest }) => {
         
     | 
| 
      
 394 
     | 
    
         
            +
                // The tar file extracts to artifactName/srcSubdir
         
     | 
| 
      
 395 
     | 
    
         
            +
                const srcDir = path.join(artifactsDir, artifact, srcSubdir);
         
     | 
| 
       283 
396 
     | 
    
         
             
                const destDir = path.join(androidDir, dest);
         
     | 
| 
      
 397 
     | 
    
         
            +
                console.log(`   Checking ${srcDir} -> ${destDir}`);
         
     | 
| 
       284 
398 
     | 
    
         
             
                if (fs.existsSync(srcDir)) {
         
     | 
| 
      
 399 
     | 
    
         
            +
                  console.log(`   ✓ Copying ${artifact}/${srcSubdir}`);
         
     | 
| 
       285 
400 
     | 
    
         
             
                  fs.mkdirSync(destDir, { recursive: true });
         
     | 
| 
       286 
     | 
    
         
            -
             
     | 
| 
       287 
     | 
    
         
            -
             
     | 
| 
       288 
     | 
    
         
            -
             
     | 
| 
      
 401 
     | 
    
         
            +
             
     | 
| 
      
 402 
     | 
    
         
            +
                  const copyDir = (srcPath, destPath) => {
         
     | 
| 
      
 403 
     | 
    
         
            +
                    fs.mkdirSync(destPath, { recursive: true });
         
     | 
| 
      
 404 
     | 
    
         
            +
                    fs.readdirSync(srcPath).forEach((file) => {
         
     | 
| 
      
 405 
     | 
    
         
            +
                      const srcFile = path.join(srcPath, file);
         
     | 
| 
      
 406 
     | 
    
         
            +
                      const destFile = path.join(destPath, file);
         
     | 
| 
      
 407 
     | 
    
         
            +
                      const stat = fs.lstatSync(srcFile);
         
     | 
| 
      
 408 
     | 
    
         
            +
             
     | 
| 
      
 409 
     | 
    
         
            +
                      // Skip sockets and other special files
         
     | 
| 
      
 410 
     | 
    
         
            +
                      if (stat.isSocket() || stat.isFIFO() || stat.isCharacterDevice() || stat.isBlockDevice()) {
         
     | 
| 
      
 411 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 412 
     | 
    
         
            +
                      }
         
     | 
| 
      
 413 
     | 
    
         
            +
             
     | 
| 
      
 414 
     | 
    
         
            +
                      if (stat.isDirectory()) {
         
     | 
| 
      
 415 
     | 
    
         
            +
                        copyDir(srcFile, destFile);
         
     | 
| 
      
 416 
     | 
    
         
            +
                      } else {
         
     | 
| 
      
 417 
     | 
    
         
            +
                        fs.copyFileSync(srcFile, destFile);
         
     | 
| 
      
 418 
     | 
    
         
            +
                      }
         
     | 
| 
      
 419 
     | 
    
         
            +
                    });
         
     | 
| 
      
 420 
     | 
    
         
            +
                  };
         
     | 
| 
      
 421 
     | 
    
         
            +
             
     | 
| 
      
 422 
     | 
    
         
            +
                  copyDir(srcDir, destDir);
         
     | 
| 
      
 423 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 424 
     | 
    
         
            +
                  console.log(`   ✗ Source directory not found: ${srcDir}`);
         
     | 
| 
       289 
425 
     | 
    
         
             
                }
         
     | 
| 
       290 
426 
     | 
    
         
             
              });
         
     | 
| 
       291 
427 
     | 
    
         | 
| 
         @@ -294,7 +430,7 @@ const main = async () => { 
     | 
|
| 
       294 
430 
     | 
    
         
             
              // The tar file extracts to skia-apple-xcframeworks/apple
         
     | 
| 
       295 
431 
     | 
    
         
             
              const appleSrcDir = path.join(
         
     | 
| 
       296 
432 
     | 
    
         
             
                artifactsDir,
         
     | 
| 
       297 
     | 
    
         
            -
                 
     | 
| 
      
 433 
     | 
    
         
            +
                `${prefix}-apple-xcframeworks`,
         
     | 
| 
       298 
434 
     | 
    
         
             
                "apple"
         
     | 
| 
       299 
435 
     | 
    
         
             
              );
         
     | 
| 
       300 
436 
     | 
    
         
             
              if (fs.existsSync(appleSrcDir)) {
         
     | 
| 
         @@ -326,7 +462,90 @@ const main = async () => { 
     | 
|
| 
       326 
462 
     | 
    
         
             
                });
         
     | 
| 
       327 
463 
     | 
    
         
             
              }
         
     | 
| 
       328 
464 
     | 
    
         | 
| 
       329 
     | 
    
         
            -
               
     | 
| 
      
 465 
     | 
    
         
            +
              // Copy Graphite headers if using Graphite
         
     | 
| 
      
 466 
     | 
    
         
            +
              if (GRAPHITE) {
         
     | 
| 
      
 467 
     | 
    
         
            +
                console.log("📦 Copying Graphite headers...");
         
     | 
| 
      
 468 
     | 
    
         
            +
                const cppDir = path.resolve(__dirname, "../cpp");
         
     | 
| 
      
 469 
     | 
    
         
            +
                const headersSrcDir = path.join(artifactsDir, `${prefix}-headers`);
         
     | 
| 
      
 470 
     | 
    
         
            +
             
     | 
| 
      
 471 
     | 
    
         
            +
                console.log(`   Looking for headers in: ${headersSrcDir}`);
         
     | 
| 
      
 472 
     | 
    
         
            +
                console.log(`   Headers dir exists: ${fs.existsSync(headersSrcDir)}`);
         
     | 
| 
      
 473 
     | 
    
         
            +
             
     | 
| 
      
 474 
     | 
    
         
            +
                if (fs.existsSync(headersSrcDir)) {
         
     | 
| 
      
 475 
     | 
    
         
            +
                  console.log(`   Contents: ${fs.readdirSync(headersSrcDir).join(", ")}`);
         
     | 
| 
      
 476 
     | 
    
         
            +
             
     | 
| 
      
 477 
     | 
    
         
            +
                  // The asset contains packages/skia/cpp structure, so we need to navigate into it
         
     | 
| 
      
 478 
     | 
    
         
            +
                  const packagesDir = path.join(headersSrcDir, "packages", "skia", "cpp");
         
     | 
| 
      
 479 
     | 
    
         
            +
                  console.log(`   Looking for packages dir: ${packagesDir}`);
         
     | 
| 
      
 480 
     | 
    
         
            +
                  console.log(`   Packages dir exists: ${fs.existsSync(packagesDir)}`);
         
     | 
| 
      
 481 
     | 
    
         
            +
             
     | 
| 
      
 482 
     | 
    
         
            +
                  if (fs.existsSync(packagesDir)) {
         
     | 
| 
      
 483 
     | 
    
         
            +
                    console.log(`   Packages contents: ${fs.readdirSync(packagesDir).join(", ")}`);
         
     | 
| 
      
 484 
     | 
    
         
            +
             
     | 
| 
      
 485 
     | 
    
         
            +
                    // Copy dawn/include
         
     | 
| 
      
 486 
     | 
    
         
            +
                    const dawnIncludeSrc = path.join(packagesDir, "dawn", "include");
         
     | 
| 
      
 487 
     | 
    
         
            +
                    const dawnIncludeDest = path.join(cppDir, "dawn", "include");
         
     | 
| 
      
 488 
     | 
    
         
            +
                    console.log(`   Dawn source: ${dawnIncludeSrc}`);
         
     | 
| 
      
 489 
     | 
    
         
            +
                    console.log(`   Dawn source exists: ${fs.existsSync(dawnIncludeSrc)}`);
         
     | 
| 
      
 490 
     | 
    
         
            +
             
     | 
| 
      
 491 
     | 
    
         
            +
                    if (fs.existsSync(dawnIncludeSrc)) {
         
     | 
| 
      
 492 
     | 
    
         
            +
                      const copyDir = (src, dest) => {
         
     | 
| 
      
 493 
     | 
    
         
            +
                        fs.mkdirSync(dest, { recursive: true });
         
     | 
| 
      
 494 
     | 
    
         
            +
                        fs.readdirSync(src).forEach((file) => {
         
     | 
| 
      
 495 
     | 
    
         
            +
                          const srcFile = path.join(src, file);
         
     | 
| 
      
 496 
     | 
    
         
            +
                          const destFile = path.join(dest, file);
         
     | 
| 
      
 497 
     | 
    
         
            +
                          if (fs.lstatSync(srcFile).isDirectory()) {
         
     | 
| 
      
 498 
     | 
    
         
            +
                            copyDir(srcFile, destFile);
         
     | 
| 
      
 499 
     | 
    
         
            +
                          } else {
         
     | 
| 
      
 500 
     | 
    
         
            +
                            fs.copyFileSync(srcFile, destFile);
         
     | 
| 
      
 501 
     | 
    
         
            +
                          }
         
     | 
| 
      
 502 
     | 
    
         
            +
                        });
         
     | 
| 
      
 503 
     | 
    
         
            +
                      };
         
     | 
| 
      
 504 
     | 
    
         
            +
                      copyDir(dawnIncludeSrc, dawnIncludeDest);
         
     | 
| 
      
 505 
     | 
    
         
            +
                      console.log("   ✓ Dawn headers copied");
         
     | 
| 
      
 506 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 507 
     | 
    
         
            +
                      console.log("   ✗ Dawn headers not found");
         
     | 
| 
      
 508 
     | 
    
         
            +
                    }
         
     | 
| 
      
 509 
     | 
    
         
            +
             
     | 
| 
      
 510 
     | 
    
         
            +
                    // Copy graphite headers
         
     | 
| 
      
 511 
     | 
    
         
            +
                    const graphiteSrc = path.join(packagesDir, "skia", "src", "gpu", "graphite");
         
     | 
| 
      
 512 
     | 
    
         
            +
                    const graphiteDest = path.join(cppDir, "skia", "src", "gpu", "graphite");
         
     | 
| 
      
 513 
     | 
    
         
            +
                    console.log(`   Graphite source: ${graphiteSrc}`);
         
     | 
| 
      
 514 
     | 
    
         
            +
                    console.log(`   Graphite source exists: ${fs.existsSync(graphiteSrc)}`);
         
     | 
| 
      
 515 
     | 
    
         
            +
             
     | 
| 
      
 516 
     | 
    
         
            +
                    if (fs.existsSync(graphiteSrc)) {
         
     | 
| 
      
 517 
     | 
    
         
            +
                      const copyDir = (src, dest) => {
         
     | 
| 
      
 518 
     | 
    
         
            +
                        fs.mkdirSync(dest, { recursive: true });
         
     | 
| 
      
 519 
     | 
    
         
            +
                        fs.readdirSync(src).forEach((file) => {
         
     | 
| 
      
 520 
     | 
    
         
            +
                          const srcFile = path.join(src, file);
         
     | 
| 
      
 521 
     | 
    
         
            +
                          const destFile = path.join(dest, file);
         
     | 
| 
      
 522 
     | 
    
         
            +
                          if (fs.lstatSync(srcFile).isDirectory()) {
         
     | 
| 
      
 523 
     | 
    
         
            +
                            copyDir(srcFile, destFile);
         
     | 
| 
      
 524 
     | 
    
         
            +
                          } else {
         
     | 
| 
      
 525 
     | 
    
         
            +
                            fs.copyFileSync(srcFile, destFile);
         
     | 
| 
      
 526 
     | 
    
         
            +
                          }
         
     | 
| 
      
 527 
     | 
    
         
            +
                        });
         
     | 
| 
      
 528 
     | 
    
         
            +
                      };
         
     | 
| 
      
 529 
     | 
    
         
            +
                      copyDir(graphiteSrc, graphiteDest);
         
     | 
| 
      
 530 
     | 
    
         
            +
                      console.log("   ✓ Graphite headers copied");
         
     | 
| 
      
 531 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 532 
     | 
    
         
            +
                      console.log("   ✗ Graphite headers not found");
         
     | 
| 
      
 533 
     | 
    
         
            +
                    }
         
     | 
| 
      
 534 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 535 
     | 
    
         
            +
                    console.log("   ✗ Packages directory not found in headers asset");
         
     | 
| 
      
 536 
     | 
    
         
            +
                  }
         
     | 
| 
      
 537 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 538 
     | 
    
         
            +
                  console.log("   ✗ Headers directory not found");
         
     | 
| 
      
 539 
     | 
    
         
            +
                }
         
     | 
| 
      
 540 
     | 
    
         
            +
              }
         
     | 
| 
      
 541 
     | 
    
         
            +
             
     | 
| 
      
 542 
     | 
    
         
            +
              console.log("✅ Completed installation of Skia prebuilt binaries.");
         
     | 
| 
      
 543 
     | 
    
         
            +
             
     | 
| 
      
 544 
     | 
    
         
            +
              // Calculate and update checksums in package.json
         
     | 
| 
      
 545 
     | 
    
         
            +
              console.log("🔐 Calculating and updating checksums...");
         
     | 
| 
      
 546 
     | 
    
         
            +
              const newChecksums = calculateLibraryChecksums();
         
     | 
| 
      
 547 
     | 
    
         
            +
              updateSkiaChecksums(newChecksums, GRAPHITE);
         
     | 
| 
      
 548 
     | 
    
         
            +
              console.log("✅ Checksums updated in package.json");
         
     | 
| 
       330 
549 
     | 
    
         | 
| 
       331 
550 
     | 
    
         
             
              // Clean up artifacts directory
         
     | 
| 
       332 
551 
     | 
    
         
             
              console.log("🗑️  Cleaning up artifacts directory...");
         
     | 
| 
         @@ -338,4 +557,4 @@ const main = async () => { 
     | 
|
| 
       338 
557 
     | 
    
         
             
            main().catch((error) => {
         
     | 
| 
       339 
558 
     | 
    
         
             
              console.error("❌ Error:", error);
         
     | 
| 
       340 
559 
     | 
    
         
             
              process.exit(1);
         
     | 
| 
       341 
     | 
    
         
            -
            });
         
     | 
| 
      
 560 
     | 
    
         
            +
            });
         
     | 
    
        package/src/skia/types/Canvas.ts
    CHANGED
    
    | 
         @@ -14,7 +14,7 @@ import type { SkColor } from "./Color"; 
     | 
|
| 
       14 
14 
     | 
    
         
             
            import type { InputRRect } from "./RRect";
         
     | 
| 
       15 
15 
     | 
    
         
             
            import type { BlendMode } from "./Paint/BlendMode";
         
     | 
| 
       16 
16 
     | 
    
         
             
            import type { SkPoint, PointMode } from "./Point";
         
     | 
| 
       17 
     | 
    
         
            -
            import type { InputMatrix } from "./Matrix";
         
     | 
| 
      
 17 
     | 
    
         
            +
            import type { InputMatrix, SkMatrix } from "./Matrix";
         
     | 
| 
       18 
18 
     | 
    
         
             
            import type { SkImageFilter } from "./ImageFilter";
         
     | 
| 
       19 
19 
     | 
    
         
             
            import type { SkVertices } from "./Vertices";
         
     | 
| 
       20 
20 
     | 
    
         
             
            import type { SkTextBlob } from "./TextBlob";
         
     | 
| 
         @@ -241,6 +241,12 @@ export interface SkCanvas { 
     | 
|
| 
       241 
241 
     | 
    
         
             
               */
         
     | 
| 
       242 
242 
     | 
    
         
             
              restoreToCount(saveCount: number): void;
         
     | 
| 
       243 
243 
     | 
    
         | 
| 
      
 244 
     | 
    
         
            +
              /**
         
     | 
| 
      
 245 
     | 
    
         
            +
               * Legacy version of getLocalToDevice(), which strips away any Z information, and
         
     | 
| 
      
 246 
     | 
    
         
            +
               * just returns a 3x3 version.
         
     | 
| 
      
 247 
     | 
    
         
            +
               */
         
     | 
| 
      
 248 
     | 
    
         
            +
              getTotalMatrix(): SkMatrix;
         
     | 
| 
      
 249 
     | 
    
         
            +
             
     | 
| 
       244 
250 
     | 
    
         
             
              /**
         
     | 
| 
       245 
251 
     | 
    
         
             
               * Draws the given points using the current clip, current matrix, and the provided paint.
         
     | 
| 
       246 
252 
     | 
    
         
             
               *
         
     | 
| 
         @@ -218,6 +218,13 @@ export class JsiSkCanvas 
     | 
|
| 
       218 
218 
     | 
    
         
             
                this.ref.restoreToCount(saveCount);
         
     | 
| 
       219 
219 
     | 
    
         
             
              }
         
     | 
| 
       220 
220 
     | 
    
         | 
| 
      
 221 
     | 
    
         
            +
              getTotalMatrix(): SkMatrix {
         
     | 
| 
      
 222 
     | 
    
         
            +
                return new JsiSkMatrix(
         
     | 
| 
      
 223 
     | 
    
         
            +
                  this.CanvasKit,
         
     | 
| 
      
 224 
     | 
    
         
            +
                  Float32Array.of(...this.ref.getTotalMatrix())
         
     | 
| 
      
 225 
     | 
    
         
            +
                );
         
     | 
| 
      
 226 
     | 
    
         
            +
              }
         
     | 
| 
      
 227 
     | 
    
         
            +
             
     | 
| 
       221 
228 
     | 
    
         
             
              drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {
         
     | 
| 
       222 
229 
     | 
    
         
             
                this.ref.drawPoints(
         
     | 
| 
       223 
230 
     | 
    
         
             
                  getEnum(this.CanvasKit, "PointMode", mode),
         
     |