@shopify/react-native-skia 2.0.2 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/apple/SkiaManager.mm +0 -3
  2. package/cpp/api/recorder/DrawingCtx.h +3 -3
  3. package/cpp/api/recorder/JsiRecorder.h +2 -1
  4. package/cpp/api/recorder/Paint.h +8 -3
  5. package/cpp/api/recorder/RNRecorder.h +4 -3
  6. package/cpp/rnskia/RNSkJsiViewApi.h +95 -73
  7. package/cpp/rnskia/RNSkManager.cpp +3 -18
  8. package/cpp/rnskia/RNSkManager.h +0 -6
  9. package/lib/commonjs/skia/types/Recorder.d.ts +1 -1
  10. package/lib/commonjs/skia/types/Recorder.js.map +1 -1
  11. package/lib/commonjs/sksg/Recorder/Player.js +3 -1
  12. package/lib/commonjs/sksg/Recorder/Player.js.map +1 -1
  13. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +1 -1
  14. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js +2 -2
  15. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  16. package/lib/commonjs/sksg/Recorder/Recorder.d.ts +1 -1
  17. package/lib/commonjs/sksg/Recorder/Recorder.js +3 -2
  18. package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -1
  19. package/lib/commonjs/sksg/Recorder/Visitor.js +2 -2
  20. package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -1
  21. package/lib/commonjs/sksg/Recorder/commands/Paint.d.ts +1 -1
  22. package/lib/commonjs/sksg/Recorder/commands/Paint.js +6 -2
  23. package/lib/commonjs/sksg/Recorder/commands/Paint.js.map +1 -1
  24. package/lib/module/skia/types/Recorder.d.ts +1 -1
  25. package/lib/module/skia/types/Recorder.js.map +1 -1
  26. package/lib/module/sksg/Recorder/Player.js +3 -1
  27. package/lib/module/sksg/Recorder/Player.js.map +1 -1
  28. package/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +1 -1
  29. package/lib/module/sksg/Recorder/ReanimatedRecorder.js +2 -2
  30. package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  31. package/lib/module/sksg/Recorder/Recorder.d.ts +1 -1
  32. package/lib/module/sksg/Recorder/Recorder.js +3 -2
  33. package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
  34. package/lib/module/sksg/Recorder/Visitor.js +2 -2
  35. package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
  36. package/lib/module/sksg/Recorder/commands/Paint.d.ts +1 -1
  37. package/lib/module/sksg/Recorder/commands/Paint.js +6 -2
  38. package/lib/module/sksg/Recorder/commands/Paint.js.map +1 -1
  39. package/lib/typescript/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +1 -1
  40. package/lib/typescript/lib/commonjs/sksg/Recorder/Recorder.d.ts +1 -1
  41. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Paint.d.ts +1 -1
  42. package/lib/typescript/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +1 -1
  43. package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +1 -1
  44. package/lib/typescript/lib/module/sksg/Recorder/commands/Paint.d.ts +1 -1
  45. package/lib/typescript/src/skia/types/Recorder.d.ts +1 -1
  46. package/lib/typescript/src/sksg/Recorder/ReanimatedRecorder.d.ts +1 -1
  47. package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +1 -1
  48. package/lib/typescript/src/sksg/Recorder/commands/Paint.d.ts +1 -1
  49. package/package.json +1 -1
  50. package/src/__tests__/snapshots/drawings/semi-transparent-layer.png +0 -0
  51. package/src/__tests__/snapshots/drawings/transparent-layer.png +0 -0
  52. package/src/renderer/__tests__/e2e/Opacity.spec.tsx +23 -0
  53. package/src/skia/types/Recorder.ts +1 -1
  54. package/src/sksg/Recorder/Player.ts +7 -1
  55. package/src/sksg/Recorder/ReanimatedRecorder.ts +2 -2
  56. package/src/sksg/Recorder/Recorder.ts +2 -2
  57. package/src/sksg/Recorder/Visitor.ts +2 -2
  58. package/src/sksg/Recorder/commands/Paint.ts +7 -2
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","_utils","_Node","_Core","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","Recorder","constructor","Set","cursors","push","commands","getRecording","paintPool","animationValues","processProps","props","animatedProps","hasAnimatedProps","key","prop","isSharedValue","add","undefined","command","length","saveGroup","children","type","CommandType","Group","restoreGroup","pop","savePaint","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","isPathEffect","Error","PushPathEffect","pushImageFilter","imageFilterType","isImageFilter","PushImageFilter","pushColorFilter","colorFilterType","isColorFilter","PushColorFilter","pushShader","shaderType","isShader","NodeType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","forEach","shadow","DrawBox","drawImage","DrawImage","drawCircle","DrawCircle","drawPoints","DrawPoints","drawPath","DrawPath","drawRect","DrawRect","drawRRect","DrawRRect","drawOval","DrawOval","drawLine","DrawLine","drawPatch","DrawPatch","drawVertices","DrawVertices","drawDiffRect","DrawDiffRect","drawText","DrawText","drawTextPath","DrawTextPath","drawTextBlob","DrawTextBlob","drawGlyphs","DrawGlyphs","drawPicture","DrawPicture","drawImageSVG","DrawImageSVG","drawParagraph","DrawParagraph","drawAtlas","DrawAtlas","exports"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\nimport type { SkPaint, BaseRecorder } from \"../../skia/types\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n}\n\ninterface AnimationValues {\n animationValues: Set<SharedValue<unknown>>;\n}\n\nexport class Recorder implements BaseRecorder {\n commands: Command[] = [];\n cursors: Command[][] = [];\n animationValues: Set<SharedValue<unknown>> = new Set();\n\n constructor() {\n this.cursors.push(this.commands);\n }\n\n getRecording(): Recording & AnimationValues {\n return {\n commands: this.commands,\n paintPool: [],\n animationValues: this.animationValues,\n };\n }\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, SharedValue<unknown>> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n this.animationValues.add(prop);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.cursors[this.cursors.length - 1].push(command);\n }\n\n saveGroup() {\n const children: Command[] = [];\n this.add({ type: CommandType.Group, children });\n this.cursors.push(children);\n }\n\n restoreGroup() {\n this.cursors.pop();\n }\n\n savePaint(props: AnimatedProps<PaintProps>) {\n this.add({ type: CommandType.SavePaint, props });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AA4BA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAGA,IAAAG,KAAA,GAAAH,OAAA;AAAqC,SAAAI,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAY9B,MAAMgB,QAAQ,CAAyB;EAK5CC,WA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C,iBAAW,CAAC4F,SAAS;MAAEzG;IAAM,CAAC,CAAC;EAClD;AACF;AAAC0G,OAAA,CAAApH,QAAA,GAAAA,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["_types","require","_utils","_Node","_Core","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","Recorder","constructor","Set","cursors","push","commands","getRecording","paintPool","animationValues","processProps","props","animatedProps","hasAnimatedProps","key","prop","isSharedValue","add","undefined","command","length","saveGroup","children","type","CommandType","Group","restoreGroup","pop","savePaint","standalone","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","isPathEffect","Error","PushPathEffect","pushImageFilter","imageFilterType","isImageFilter","PushImageFilter","pushColorFilter","colorFilterType","isColorFilter","PushColorFilter","pushShader","shaderType","isShader","NodeType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","forEach","shadow","DrawBox","drawImage","DrawImage","drawCircle","DrawCircle","drawPoints","DrawPoints","drawPath","DrawPath","drawRect","DrawRect","drawRRect","DrawRRect","drawOval","DrawOval","drawLine","DrawLine","drawPatch","DrawPatch","drawVertices","DrawVertices","drawDiffRect","DrawDiffRect","drawText","DrawText","drawTextPath","DrawTextPath","drawTextBlob","DrawTextBlob","drawGlyphs","DrawGlyphs","drawPicture","DrawPicture","drawImageSVG","DrawImageSVG","drawParagraph","DrawParagraph","drawAtlas","DrawAtlas","exports"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\nimport type { SkPaint, BaseRecorder } from \"../../skia/types\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n}\n\ninterface AnimationValues {\n animationValues: Set<SharedValue<unknown>>;\n}\n\nexport class Recorder implements BaseRecorder {\n commands: Command[] = [];\n cursors: Command[][] = [];\n animationValues: Set<SharedValue<unknown>> = new Set();\n\n constructor() {\n this.cursors.push(this.commands);\n }\n\n getRecording(): Recording & AnimationValues {\n return {\n commands: this.commands,\n paintPool: [],\n animationValues: this.animationValues,\n };\n }\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, SharedValue<unknown>> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n this.animationValues.add(prop);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.cursors[this.cursors.length - 1].push(command);\n }\n\n saveGroup() {\n const children: Command[] = [];\n this.add({ type: CommandType.Group, children });\n this.cursors.push(children);\n }\n\n restoreGroup() {\n this.cursors.pop();\n }\n\n savePaint(props: AnimatedProps<PaintProps>, standalone: boolean) {\n this.add({ type: CommandType.SavePaint, props, standalone });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AA4BA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAGA,IAAAG,KAAA,GAAAH,OAAA;AAAqC,SAAAI,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,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G,SAASA,CAACzG,KAAgC,EAAE;IAC1C,IAAI,CAACM,GAAG,CAAC;MAAEM,IAAI,EAAEC,iBAAW,CAAC6F,SAAS;MAAE1G;IAAM,CAAC,CAAC;EAClD;AACF;AAAC2G,OAAA,CAAArH,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -148,7 +148,7 @@ const pushMaskFilters = (recorder, maskFilters) => {
148
148
  };
149
149
  const pushPaints = (recorder, paints) => {
150
150
  paints.forEach(paint => {
151
- recorder.savePaint(paint.props);
151
+ recorder.savePaint(paint.props, true);
152
152
  const {
153
153
  colorFilters,
154
154
  maskFilters,
@@ -183,7 +183,7 @@ const visitNode = (recorder, node) => {
183
183
  const paint = processPaint(props);
184
184
  const shouldPushPaint = paint || colorFilters.length > 0 || maskFilters.length > 0 || imageFilters.length > 0 || pathEffects.length > 0 || shaders.length > 0;
185
185
  if (shouldPushPaint) {
186
- recorder.savePaint(paint !== null && paint !== void 0 ? paint : {});
186
+ recorder.savePaint(paint !== null && paint !== void 0 ? paint : {}, false);
187
187
  pushColorFilters(recorder, colorFilters);
188
188
  pushImageFilters(recorder, imageFilters);
189
189
  pushMaskFilters(recorder, maskFilters);
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","_Node","processPaint","opacity","color","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","antiAlias","dither","paint","paintRef","undefined","exports","processCTM","clip","invertClip","transform","origin","matrix","layer","ctm","pushColorFilters","recorder","colorFilters","forEach","colorFilter","children","length","pushColorFilter","type","props","needsComposition","NodeType","LerpColorFilter","composeColorFilter","pushPathEffects","pathEffects","pathEffect","pushPathEffect","SumPathEffect","composePathEffect","pushImageFilters","imageFilters","imageFilter","isImageFilter","pushImageFilter","isShader","pushShader","BlendImageFilter","composeImageFilter","pushShaders","shaders","shader","pushMaskFilters","maskFilters","pushBlurMaskFilter","pushPaints","paints","savePaint","sortNodeChildren","restorePaintDeclaration","visitNode","node","Group","saveGroup","drawings","shouldPushPaint","BackdropFilter","saveBackdropFilter","materializePaint","Layer","saveLayer","shouldRestore","saveCTM","Box","shadows","filter","n","BoxShadow","map","drawBox","Fill","drawPaint","Image","drawImage","Circle","drawCircle","Points","drawPoints","Path","drawPath","Rect","drawRect","RRect","drawRRect","Oval","drawOval","Line","drawLine","Patch","drawPatch","Vertices","drawVertices","DiffRect","drawDiffRect","Text","drawText","TextPath","drawTextPath","TextBlob","drawTextBlob","Glyphs","drawGlyphs","Picture","drawPicture","ImageSVG","drawImageSVG","Paragraph","drawParagraph","Atlas","drawAtlas","drawing","restorePaint","restoreCTM","restoreGroup","visit","root"],"sources":["Visitor.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type {\n CTMProps,\n DrawingNodeProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport { NodeType } from \"../../dom/types\";\nimport type { BaseRecorder } from \"../../skia/types/Recorder\";\nimport type { Node } from \"../Node\";\nimport { isImageFilter, isShader, sortNodeChildren } from \"../Node\";\n\nexport const processPaint = ({\n opacity,\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n antiAlias,\n dither,\n paint: paintRef,\n}: DrawingNodeProps) => {\n const paint: DrawingNodeProps = {};\n if (opacity !== undefined) {\n paint.opacity = opacity;\n }\n if (color !== undefined) {\n paint.color = color;\n }\n if (strokeWidth !== undefined) {\n paint.strokeWidth = strokeWidth;\n }\n if (blendMode !== undefined) {\n paint.blendMode = blendMode;\n }\n if (style !== undefined) {\n paint.style = style;\n }\n if (strokeJoin !== undefined) {\n paint.strokeJoin = strokeJoin;\n }\n if (strokeCap !== undefined) {\n paint.strokeCap = strokeCap;\n }\n if (strokeMiter !== undefined) {\n paint.strokeMiter = strokeMiter;\n }\n if (antiAlias !== undefined) {\n paint.antiAlias = antiAlias;\n }\n if (dither !== undefined) {\n paint.dither = dither;\n }\n\n if (paintRef !== undefined) {\n paint.paint = paintRef;\n }\n\n if (\n opacity !== undefined ||\n color !== undefined ||\n strokeWidth !== undefined ||\n blendMode !== undefined ||\n style !== undefined ||\n strokeJoin !== undefined ||\n strokeCap !== undefined ||\n strokeMiter !== undefined ||\n antiAlias !== undefined ||\n dither !== undefined ||\n paintRef !== undefined\n ) {\n return paint;\n }\n return null;\n};\n\nconst processCTM = ({\n clip,\n invertClip,\n transform,\n origin,\n matrix,\n layer,\n}: CTMProps) => {\n const ctm: CTMProps = {};\n if (clip) {\n ctm.clip = clip;\n }\n if (invertClip) {\n ctm.invertClip = invertClip;\n }\n if (transform) {\n ctm.transform = transform;\n }\n if (origin) {\n ctm.origin = origin;\n }\n if (matrix) {\n ctm.matrix = matrix;\n }\n if (layer) {\n ctm.layer = layer;\n }\n if (\n clip !== undefined ||\n invertClip !== undefined ||\n transform !== undefined ||\n origin !== undefined ||\n matrix !== undefined ||\n layer !== undefined\n ) {\n return ctm;\n }\n return null;\n};\n\nconst pushColorFilters = (\n recorder: BaseRecorder,\n colorFilters: Node<any>[]\n) => {\n colorFilters.forEach((colorFilter) => {\n if (colorFilter.children.length > 0) {\n pushColorFilters(recorder, colorFilter.children);\n }\n recorder.pushColorFilter(colorFilter.type, colorFilter.props);\n const needsComposition =\n colorFilter.type !== NodeType.LerpColorFilter &&\n colorFilter.children.length > 0;\n if (needsComposition) {\n recorder.composeColorFilter();\n }\n });\n};\n\nconst pushPathEffects = (recorder: BaseRecorder, pathEffects: Node<any>[]) => {\n pathEffects.forEach((pathEffect) => {\n if (pathEffect.children.length > 0) {\n pushPathEffects(recorder, pathEffect.children);\n }\n recorder.pushPathEffect(pathEffect.type, pathEffect.props);\n const needsComposition =\n pathEffect.type !== NodeType.SumPathEffect &&\n pathEffect.children.length > 0;\n if (needsComposition) {\n recorder.composePathEffect();\n }\n });\n};\n\nconst pushImageFilters = (\n recorder: BaseRecorder,\n imageFilters: Node<any>[]\n) => {\n imageFilters.forEach((imageFilter) => {\n if (imageFilter.children.length > 0) {\n pushImageFilters(recorder, imageFilter.children);\n }\n if (isImageFilter(imageFilter.type)) {\n recorder.pushImageFilter(imageFilter.type, imageFilter.props);\n } else if (isShader(imageFilter.type)) {\n recorder.pushShader(imageFilter.type, imageFilter.props);\n }\n const needsComposition =\n imageFilter.type !== NodeType.BlendImageFilter &&\n imageFilter.children.length > 0;\n if (needsComposition) {\n recorder.composeImageFilter();\n }\n });\n};\n\nconst pushShaders = (recorder: BaseRecorder, shaders: Node<any>[]) => {\n shaders.forEach((shader) => {\n if (shader.children.length > 0) {\n pushShaders(recorder, shader.children);\n }\n recorder.pushShader(shader.type, shader.props);\n });\n};\n\nconst pushMaskFilters = (recorder: BaseRecorder, maskFilters: Node<any>[]) => {\n if (maskFilters.length > 0) {\n recorder.pushBlurMaskFilter(maskFilters[maskFilters.length - 1].props);\n }\n};\n\nconst pushPaints = (recorder: BaseRecorder, paints: Node<any>[]) => {\n paints.forEach((paint) => {\n recorder.savePaint(paint.props);\n const { colorFilters, maskFilters, shaders, imageFilters, pathEffects } =\n sortNodeChildren(paint);\n pushColorFilters(recorder, colorFilters);\n pushImageFilters(recorder, imageFilters);\n pushMaskFilters(recorder, maskFilters);\n pushShaders(recorder, shaders);\n pushPathEffects(recorder, pathEffects);\n recorder.restorePaintDeclaration();\n });\n};\n\nconst visitNode = (recorder: BaseRecorder, node: Node<any>) => {\n if (node.type === NodeType.Group) {\n recorder.saveGroup();\n }\n const { props } = node;\n const {\n colorFilters,\n maskFilters,\n drawings,\n shaders,\n imageFilters,\n pathEffects,\n paints,\n } = sortNodeChildren(node);\n const paint = processPaint(props);\n const shouldPushPaint =\n paint ||\n colorFilters.length > 0 ||\n maskFilters.length > 0 ||\n imageFilters.length > 0 ||\n pathEffects.length > 0 ||\n shaders.length > 0;\n if (shouldPushPaint) {\n recorder.savePaint(paint ?? {});\n pushColorFilters(recorder, colorFilters);\n pushImageFilters(recorder, imageFilters);\n pushMaskFilters(recorder, maskFilters);\n pushShaders(recorder, shaders);\n pushPathEffects(recorder, pathEffects);\n // For mixed nodes like BackdropFilters we don't materialize the paint\n if (node.type === NodeType.BackdropFilter) {\n recorder.saveBackdropFilter();\n } else {\n recorder.materializePaint();\n }\n }\n pushPaints(recorder, paints);\n if (node.type === NodeType.Layer) {\n recorder.saveLayer();\n }\n const ctm = processCTM(props);\n const shouldRestore = !!ctm || node.type === NodeType.Layer;\n if (ctm) {\n recorder.saveCTM(ctm);\n }\n switch (node.type) {\n case NodeType.Box:\n const shadows = node.children\n .filter((n) => n.type === NodeType.BoxShadow)\n // eslint-disable-next-line @typescript-eslint/no-shadow\n .map(({ props }) => ({ props } as { props: BoxShadowProps }));\n recorder.drawBox(props, shadows);\n break;\n case NodeType.Fill:\n recorder.drawPaint();\n break;\n case NodeType.Image:\n recorder.drawImage(props);\n break;\n case NodeType.Circle:\n recorder.drawCircle(props);\n break;\n case NodeType.Points:\n recorder.drawPoints(props);\n break;\n case NodeType.Path:\n recorder.drawPath(props);\n break;\n case NodeType.Rect:\n recorder.drawRect(props);\n break;\n case NodeType.RRect:\n recorder.drawRRect(props);\n break;\n case NodeType.Oval:\n recorder.drawOval(props);\n break;\n case NodeType.Line:\n recorder.drawLine(props);\n break;\n case NodeType.Patch:\n recorder.drawPatch(props);\n break;\n case NodeType.Vertices:\n recorder.drawVertices(props);\n break;\n case NodeType.DiffRect:\n recorder.drawDiffRect(props);\n break;\n case NodeType.Text:\n recorder.drawText(props);\n break;\n case NodeType.TextPath:\n recorder.drawTextPath(props);\n break;\n case NodeType.TextBlob:\n recorder.drawTextBlob(props);\n break;\n case NodeType.Glyphs:\n recorder.drawGlyphs(props);\n break;\n case NodeType.Picture:\n recorder.drawPicture(props);\n break;\n case NodeType.ImageSVG:\n recorder.drawImageSVG(props);\n break;\n case NodeType.Paragraph:\n recorder.drawParagraph(props);\n break;\n case NodeType.Atlas:\n recorder.drawAtlas(props);\n break;\n }\n drawings.forEach((drawing) => {\n visitNode(recorder, drawing);\n });\n if (shouldPushPaint) {\n recorder.restorePaint();\n }\n if (shouldRestore) {\n recorder.restoreCTM();\n }\n if (node.type === NodeType.Group) {\n recorder.restoreGroup();\n }\n};\n\nexport const visit = (recorder: BaseRecorder, root: Node[]) => {\n root.forEach((node) => {\n visitNode(recorder, node);\n });\n};\n"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,KAAA,GAAAD,OAAA;AATA;;AAWO,MAAME,YAAY,GAAGA,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,WAAW;EACXC,SAAS;EACTC,KAAK;EACLC,UAAU;EACVC,SAAS;EACTC,WAAW;EACXC,SAAS;EACTC,MAAM;EACNC,KAAK,EAAEC;AACS,CAAC,KAAK;EACtB,MAAMD,KAAuB,GAAG,CAAC,CAAC;EAClC,IAAIV,OAAO,KAAKY,SAAS,EAAE;IACzBF,KAAK,CAACV,OAAO,GAAGA,OAAO;EACzB;EACA,IAAIC,KAAK,KAAKW,SAAS,EAAE;IACvBF,KAAK,CAACT,KAAK,GAAGA,KAAK;EACrB;EACA,IAAIC,WAAW,KAAKU,SAAS,EAAE;IAC7BF,KAAK,CAACR,WAAW,GAAGA,WAAW;EACjC;EACA,IAAIC,SAAS,KAAKS,SAAS,EAAE;IAC3BF,KAAK,CAACP,SAAS,GAAGA,SAAS;EAC7B;EACA,IAAIC,KAAK,KAAKQ,SAAS,EAAE;IACvBF,KAAK,CAACN,KAAK,GAAGA,KAAK;EACrB;EACA,IAAIC,UAAU,KAAKO,SAAS,EAAE;IAC5BF,KAAK,CAACL,UAAU,GAAGA,UAAU;EAC/B;EACA,IAAIC,SAAS,KAAKM,SAAS,EAAE;IAC3BF,KAAK,CAACJ,SAAS,GAAGA,SAAS;EAC7B;EACA,IAAIC,WAAW,KAAKK,SAAS,EAAE;IAC7BF,KAAK,CAACH,WAAW,GAAGA,WAAW;EACjC;EACA,IAAIC,SAAS,KAAKI,SAAS,EAAE;IAC3BF,KAAK,CAACF,SAAS,GAAGA,SAAS;EAC7B;EACA,IAAIC,MAAM,KAAKG,SAAS,EAAE;IACxBF,K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I,CAACtG,OAAO,CAAEsC,IAAI,IAAK;IACrBD,SAAS,CAACvC,QAAQ,EAAEwC,IAAI,CAAC;EAC3B,CAAC,CAAC;AACJ,CAAC;AAAClD,OAAA,CAAAiH,KAAA,GAAAA,KAAA","ignoreList":[]}
1
+ {"version":3,"names":["_types","require","_Node","processPaint","opacity","color","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","antiAlias","dither","paint","paintRef","undefined","exports","processCTM","clip","invertClip","transform","origin","matrix","layer","ctm","pushColorFilters","recorder","colorFilters","forEach","colorFilter","children","length","pushColorFilter","type","props","needsComposition","NodeType","LerpColorFilter","composeColorFilter","pushPathEffects","pathEffects","pathEffect","pushPathEffect","SumPathEffect","composePathEffect","pushImageFilters","imageFilters","imageFilter","isImageFilter","pushImageFilter","isShader","pushShader","BlendImageFilter","composeImageFilter","pushShaders","shaders","shader","pushMaskFilters","maskFilters","pushBlurMaskFilter","pushPaints","paints","savePaint","sortNodeChildren","restorePaintDeclaration","visitNode","node","Group","saveGroup","drawings","shouldPushPaint","BackdropFilter","saveBackdropFilter","materializePaint","Layer","saveLayer","shouldRestore","saveCTM","Box","shadows","filter","n","BoxShadow","map","drawBox","Fill","drawPaint","Image","drawImage","Circle","drawCircle","Points","drawPoints","Path","drawPath","Rect","drawRect","RRect","drawRRect","Oval","drawOval","Line","drawLine","Patch","drawPatch","Vertices","drawVertices","DiffRect","drawDiffRect","Text","drawText","TextPath","drawTextPath","TextBlob","drawTextBlob","Glyphs","drawGlyphs","Picture","drawPicture","ImageSVG","drawImageSVG","Paragraph","drawParagraph","Atlas","drawAtlas","drawing","restorePaint","restoreCTM","restoreGroup","visit","root"],"sources":["Visitor.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type {\n CTMProps,\n DrawingNodeProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport { NodeType } from \"../../dom/types\";\nimport type { BaseRecorder } from \"../../skia/types/Recorder\";\nimport type { Node } from \"../Node\";\nimport { isImageFilter, isShader, sortNodeChildren } from \"../Node\";\n\nexport const processPaint = ({\n opacity,\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n antiAlias,\n dither,\n paint: paintRef,\n}: DrawingNodeProps) => {\n const paint: DrawingNodeProps = {};\n if (opacity !== undefined) {\n paint.opacity = opacity;\n }\n if (color !== undefined) {\n paint.color = color;\n }\n if (strokeWidth !== undefined) {\n paint.strokeWidth = strokeWidth;\n }\n if (blendMode !== undefined) {\n paint.blendMode = blendMode;\n }\n if (style !== undefined) {\n paint.style = style;\n }\n if (strokeJoin !== undefined) {\n paint.strokeJoin = strokeJoin;\n }\n if (strokeCap !== undefined) {\n paint.strokeCap = strokeCap;\n }\n if (strokeMiter !== undefined) {\n paint.strokeMiter = strokeMiter;\n }\n if (antiAlias !== undefined) {\n paint.antiAlias = antiAlias;\n }\n if (dither !== undefined) {\n paint.dither = dither;\n }\n\n if (paintRef !== undefined) {\n paint.paint = paintRef;\n }\n\n if (\n opacity !== undefined ||\n color !== undefined ||\n strokeWidth !== undefined ||\n blendMode !== undefined ||\n style !== undefined ||\n strokeJoin !== undefined ||\n strokeCap !== undefined ||\n strokeMiter !== undefined ||\n antiAlias !== undefined ||\n dither !== undefined ||\n paintRef !== undefined\n ) {\n return paint;\n }\n return null;\n};\n\nconst processCTM = ({\n clip,\n invertClip,\n transform,\n origin,\n matrix,\n layer,\n}: CTMProps) => {\n const ctm: CTMProps = {};\n if (clip) {\n ctm.clip = clip;\n }\n if (invertClip) {\n ctm.invertClip = invertClip;\n }\n if (transform) {\n ctm.transform = transform;\n }\n if (origin) {\n ctm.origin = origin;\n }\n if (matrix) {\n ctm.matrix = matrix;\n }\n if (layer) {\n ctm.layer = layer;\n }\n if (\n clip !== undefined ||\n invertClip !== undefined ||\n transform !== undefined ||\n origin !== undefined ||\n matrix !== undefined ||\n layer !== undefined\n ) {\n return ctm;\n }\n return null;\n};\n\nconst pushColorFilters = (\n recorder: BaseRecorder,\n colorFilters: Node<any>[]\n) => {\n colorFilters.forEach((colorFilter) => {\n if (colorFilter.children.length > 0) {\n pushColorFilters(recorder, colorFilter.children);\n }\n recorder.pushColorFilter(colorFilter.type, colorFilter.props);\n const needsComposition =\n colorFilter.type !== NodeType.LerpColorFilter &&\n colorFilter.children.length > 0;\n if (needsComposition) {\n recorder.composeColorFilter();\n }\n });\n};\n\nconst pushPathEffects = (recorder: BaseRecorder, pathEffects: Node<any>[]) => {\n pathEffects.forEach((pathEffect) => {\n if (pathEffect.children.length > 0) {\n pushPathEffects(recorder, pathEffect.children);\n }\n recorder.pushPathEffect(pathEffect.type, pathEffect.props);\n const needsComposition =\n pathEffect.type !== NodeType.SumPathEffect &&\n pathEffect.children.length > 0;\n if (needsComposition) {\n recorder.composePathEffect();\n }\n });\n};\n\nconst pushImageFilters = (\n recorder: BaseRecorder,\n imageFilters: Node<any>[]\n) => {\n imageFilters.forEach((imageFilter) => {\n if (imageFilter.children.length > 0) {\n pushImageFilters(recorder, imageFilter.children);\n }\n if (isImageFilter(imageFilter.type)) {\n recorder.pushImageFilter(imageFilter.type, imageFilter.props);\n } else if (isShader(imageFilter.type)) {\n recorder.pushShader(imageFilter.type, imageFilter.props);\n }\n const needsComposition =\n imageFilter.type !== NodeType.BlendImageFilter &&\n imageFilter.children.length > 0;\n if (needsComposition) {\n recorder.composeImageFilter();\n }\n });\n};\n\nconst pushShaders = (recorder: BaseRecorder, shaders: Node<any>[]) => {\n shaders.forEach((shader) => {\n if (shader.children.length > 0) {\n pushShaders(recorder, shader.children);\n }\n recorder.pushShader(shader.type, shader.props);\n });\n};\n\nconst pushMaskFilters = (recorder: BaseRecorder, maskFilters: Node<any>[]) => {\n if (maskFilters.length > 0) {\n recorder.pushBlurMaskFilter(maskFilters[maskFilters.length - 1].props);\n }\n};\n\nconst pushPaints = (recorder: BaseRecorder, paints: Node<any>[]) => {\n paints.forEach((paint) => {\n recorder.savePaint(paint.props, true);\n const { colorFilters, maskFilters, shaders, imageFilters, pathEffects } =\n sortNodeChildren(paint);\n pushColorFilters(recorder, colorFilters);\n pushImageFilters(recorder, imageFilters);\n pushMaskFilters(recorder, maskFilters);\n pushShaders(recorder, shaders);\n pushPathEffects(recorder, pathEffects);\n recorder.restorePaintDeclaration();\n });\n};\n\nconst visitNode = (recorder: BaseRecorder, node: Node<any>) => {\n if (node.type === NodeType.Group) {\n recorder.saveGroup();\n }\n const { props } = node;\n const {\n colorFilters,\n maskFilters,\n drawings,\n shaders,\n imageFilters,\n pathEffects,\n paints,\n } = sortNodeChildren(node);\n const paint = processPaint(props);\n const shouldPushPaint =\n paint ||\n colorFilters.length > 0 ||\n maskFilters.length > 0 ||\n imageFilters.length > 0 ||\n pathEffects.length > 0 ||\n shaders.length > 0;\n if (shouldPushPaint) {\n recorder.savePaint(paint ?? {}, false);\n pushColorFilters(recorder, colorFilters);\n pushImageFilters(recorder, imageFilters);\n pushMaskFilters(recorder, maskFilters);\n pushShaders(recorder, shaders);\n pushPathEffects(recorder, pathEffects);\n // For mixed nodes like BackdropFilters we don't materialize the paint\n if (node.type === NodeType.BackdropFilter) {\n recorder.saveBackdropFilter();\n } else {\n recorder.materializePaint();\n }\n }\n pushPaints(recorder, paints);\n if (node.type === NodeType.Layer) {\n recorder.saveLayer();\n }\n const ctm = processCTM(props);\n const shouldRestore = !!ctm || node.type === NodeType.Layer;\n if (ctm) {\n recorder.saveCTM(ctm);\n }\n switch (node.type) {\n case NodeType.Box:\n const shadows = node.children\n .filter((n) => n.type === NodeType.BoxShadow)\n // eslint-disable-next-line @typescript-eslint/no-shadow\n .map(({ props }) => ({ props } as { props: BoxShadowProps }));\n recorder.drawBox(props, shadows);\n break;\n case NodeType.Fill:\n recorder.drawPaint();\n break;\n case NodeType.Image:\n recorder.drawImage(props);\n break;\n case NodeType.Circle:\n recorder.drawCircle(props);\n break;\n case NodeType.Points:\n recorder.drawPoints(props);\n break;\n case NodeType.Path:\n recorder.drawPath(props);\n break;\n case NodeType.Rect:\n recorder.drawRect(props);\n break;\n case NodeType.RRect:\n recorder.drawRRect(props);\n break;\n case NodeType.Oval:\n recorder.drawOval(props);\n break;\n case NodeType.Line:\n recorder.drawLine(props);\n break;\n case NodeType.Patch:\n recorder.drawPatch(props);\n break;\n case NodeType.Vertices:\n recorder.drawVertices(props);\n break;\n case NodeType.DiffRect:\n recorder.drawDiffRect(props);\n break;\n case NodeType.Text:\n recorder.drawText(props);\n break;\n case NodeType.TextPath:\n recorder.drawTextPath(props);\n break;\n case NodeType.TextBlob:\n recorder.drawTextBlob(props);\n break;\n case NodeType.Glyphs:\n recorder.drawGlyphs(props);\n break;\n case NodeType.Picture:\n recorder.drawPicture(props);\n break;\n case NodeType.ImageSVG:\n recorder.drawImageSVG(props);\n break;\n case NodeType.Paragraph:\n recorder.drawParagraph(props);\n break;\n case NodeType.Atlas:\n recorder.drawAtlas(props);\n break;\n }\n drawings.forEach((drawing) => {\n visitNode(recorder, drawing);\n });\n if (shouldPushPaint) {\n recorder.restorePaint();\n }\n if (shouldRestore) {\n recorder.restoreCTM();\n }\n if (node.type === NodeType.Group) {\n recorder.restoreGroup();\n }\n};\n\nexport const visit = (recorder: BaseRecorder, root: Node[]) => {\n root.forEach((node) => {\n visitNode(recorder, node);\n });\n};\n"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,KAAA,GAAAD,OAAA;AATA;;AAWO,MAAME,YAAY,GAAGA,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,WAAW;EACXC,SAAS;EACTC,KAAK;EACLC,UAAU;EACVC,SAAS;EACTC,WAAW;EACXC,SAAS;EACTC,MAAM;EACNC,KAAK,EAAEC;AACS,CAAC,KAAK;EACtB,MAAMD,KAAuB,GAAG,CAAC,CAAC;EAClC,IAAIV,OAAO,KAAKY,SAAS,EAAE;IACzBF,KAAK,CAACV,OAAO,GAAGA,OAAO;EACzB;EACA,IAAIC,KAAK,KAAKW,SAAS,EAAE;IACvBF,KAAK,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,CAAC8F,YAAY,CAACtF,KAAK,CAAC;MAC5B;IACF,KAAKE,eAAQ,CAACqF,SAAS;MACrB/F,QAAQ,CAACgG,aAAa,CAACxF,KAAK,CAAC;MAC7B;IACF,KAAKE,eAAQ,CAACuF,KAAK;MACjBjG,QAAQ,CAACkG,SAAS,CAAC1F,KAAK,CAAC;MACzB;EACJ;EACAmC,QAAQ,CAACzC,OAAO,CAAEiG,OAAO,IAAK;IAC5B5D,SAAS,CAACvC,QAAQ,EAAEmG,OAAO,CAAC;EAC9B,CAAC,CAAC;EACF,IAAIvD,eAAe,EAAE;IACnB5C,QAAQ,CAACoG,YAAY,CAAC,CAAC;EACzB;EACA,IAAIlD,aAAa,EAAE;IACjBlD,QAAQ,CAACqG,UAAU,CAAC,CAAC;EACvB;EACA,IAAI7D,IAAI,CAACjC,IAAI,KAAKG,eAAQ,CAAC+B,KAAK,EAAE;IAChCzC,QAAQ,CAACsG,YAAY,CAAC,CAAC;EACzB;AACF,CAAC;AAEM,MAAMC,KAAK,GAAGA,CAACvG,QAAsB,EAAEwG,IAAY,KAAK;EAC7DA,IAAI,CAACtG,OAAO,CAAEsC,IAAI,IAAK;IACrBD,SAAS,CAACvC,QAAQ,EAAEwC,IAAI,CAAC;EAC3B,CAAC,CAAC;AACJ,CAAC;AAAClD,OAAA,CAAAiH,KAAA,GAAAA,KAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
1
  import type { PaintProps } from "../../../dom/types";
2
2
  import type { Skia } from "../../../skia/types";
3
3
  import type { DrawingContext } from "../DrawingContext";
4
- export declare const setPaintProperties: (Skia: Skia, ctx: DrawingContext, { opacity, color, blendMode, strokeWidth, style, strokeJoin, strokeCap, strokeMiter, antiAlias, dither, }: PaintProps) => void;
4
+ export declare const setPaintProperties: (Skia: Skia, ctx: DrawingContext, { opacity, color, blendMode, strokeWidth, style, strokeJoin, strokeCap, strokeMiter, antiAlias, dither, }: PaintProps, standalone: boolean) => void;
@@ -17,14 +17,18 @@ const setPaintProperties = (Skia, ctx, {
17
17
  strokeMiter,
18
18
  antiAlias,
19
19
  dither
20
- }) => {
20
+ }, standalone) => {
21
21
  "worklet";
22
22
 
23
23
  const {
24
24
  paint
25
25
  } = ctx;
26
26
  if (opacity !== undefined) {
27
- ctx.setOpacity(ctx.getOpacity() * opacity);
27
+ if (standalone) {
28
+ paint.setAlphaf(paint.getAlphaf() * opacity);
29
+ } else {
30
+ ctx.setOpacity(ctx.getOpacity() * opacity);
31
+ }
28
32
  }
29
33
  if (color !== undefined) {
30
34
  paint.setShader(null);
@@ -1 +1 @@
1
- {"version":3,"names":["_nodes","require","_types","setPaintProperties","Skia","ctx","opacity","color","blendMode","strokeWidth","style","strokeJoin","strokeCap","strokeMiter","antiAlias","dither","paint","undefined","setOpacity","getOpacity","setShader","setColor","processColor","setBlendMode","BlendMode","enumKey","setStrokeWidth","setStyle","PaintStyle","setStrokeJoin","StrokeJoin","setStrokeCap","StrokeCap","setStrokeMiter","setAntiAlias","setDither","exports"],"sources":["Paint.ts"],"sourcesContent":["import { enumKey, processColor } from \"../../../dom/nodes\";\nimport type { PaintProps } from \"../../../dom/types\";\nimport {\n BlendMode,\n PaintStyle,\n StrokeCap,\n StrokeJoin,\n} from \"../../../skia/types\";\nimport type { Skia } from \"../../../skia/types\";\nimport type { DrawingContext } from \"../DrawingContext\";\n\nexport const setPaintProperties = (\n Skia: Skia,\n ctx: DrawingContext,\n {\n opacity,\n color,\n blendMode,\n strokeWidth,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n antiAlias,\n dither,\n }: PaintProps\n) => {\n \"worklet\";\n const { paint } = ctx;\n\n if (opacity !== undefined) {\n ctx.setOpacity(ctx.getOpacity() * opacity);\n }\n if (color !== undefined) {\n paint.setShader(null);\n paint.setColor(processColor(Skia, color));\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(BlendMode[enumKey(blendMode)]);\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (style !== undefined) {\n paint.setStyle(PaintStyle[enumKey(style)]);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n if (dither !== undefined) {\n paint.setDither(dither);\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AASO,MAAME,kBAAkB,GAAGA,CAChCC,IAAU,EACVC,GAAmB,EACnB;EACEC,OAAO;EACPC,KAAK;EACLC,SAAS;EACTC,WAAW;EACXC,KAAK;EACLC,UAAU;EACVC,SAAS;EACTC,WAAW;EACXC,SAAS;EACTC;AACU,CAAC,KACV;EACH,SAAS;;EACT,MAAM;IAAEC;EAAM,CAAC,GAAGX,GAAG;EAErB,IAAIC,OAAO,KAAKW,SAAS,EAAE;IACzBZ,GAAG,CAACa,UAAU,CAACb,GAAG,CAACc,UAAU,CAAC,CAAC,GAAGb,OAAO,CAAC;EAC5C;EACA,IAAIC,KAAK,KAAKU,SAAS,EAAE;IACvBD,KAAK,CAACI,SAAS,CAAC,IAAI,CAAC;IACrBJ,KAAK,CAACK,QAAQ,CAAC,IAAAC,mBAAY,EAAClB,IAAI,EAAEG,KAAK,CAAC,CAAC;EAC3C;EACA,IAAIC,SAAS,KAAKS,SAAS,EAAE;IAC3BD,KAAK,CAACO,YAAY,CAACC,gBAAS,CAAC,IAAAC,cAAO,EAACjB,SAAS,CAAC,CAAC,CAAC;EACnD;EACA,IAAIC,WAAW,KAAKQ,SAAS,EAAE;IAC7BD,KAAK,CAACU,cAAc,CAACjB,WAAW,CAAC;EACnC;EACA,IAAIC,KAAK,KAAKO,SAAS,EAAE;IACvBD,KAAK,CAACW,QAAQ,CAACC,iBAAU,CAAC,IAAAH,cAAO,EAACf,KAAK,CAAC,CAAC,CAAC;EAC5C;EACA,IAAIC,UAAU,KAAKM,SAAS,EAAE;IAC5BD,KAAK,CAACa,aAAa,CAACC,iBAAU,CAAC,IAAAL,cAAO,EAACd,UAAU,CAAC,CAAC,CAAC;EACtD;EACA,IAAIC,SAAS,KAAKK,SAAS,EAAE;IAC3BD,KAAK,CAACe,YAAY,CAACC,gBAAS,CAAC,IAAAP,cAAO,EAACb,SAAS,CAAC,CAAC,CAAC;EACnD;EACA,IAAIC,WAAW,KAAKI,SAAS,EAAE;IAC7BD,KAAK,CAACiB,cAAc,CAACpB,WAAW,CAAC;EACnC;EACA,IAAIC,SAAS,KAAKG,SAAS,EAAE;IAC3BD,KAAK,CAACkB,YAAY,CAACpB,SAAS,CAAC;EAC/B;EACA,IAAIC,MAAM,KAAKE,SAAS,EAAE;IACxBD,KAAK,CAACmB,SAAS,CAACpB,MAAM,CAAC;EACzB;AACF,CAAC;AAACqB,OAAA,CAAAjC,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_nodes","require","_types","setPaintProperties","Skia","ctx","opacity","color","blendMode","strokeWidth","style","strokeJoin","strokeCap","strokeMiter","antiAlias","dither","standalone","paint","undefined","setAlphaf","getAlphaf","setOpacity","getOpacity","setShader","setColor","processColor","setBlendMode","BlendMode","enumKey","setStrokeWidth","setStyle","PaintStyle","setStrokeJoin","StrokeJoin","setStrokeCap","StrokeCap","setStrokeMiter","setAntiAlias","setDither","exports"],"sources":["Paint.ts"],"sourcesContent":["import { enumKey, processColor } from \"../../../dom/nodes\";\nimport type { PaintProps } from \"../../../dom/types\";\nimport {\n BlendMode,\n PaintStyle,\n StrokeCap,\n StrokeJoin,\n} from \"../../../skia/types\";\nimport type { Skia } from \"../../../skia/types\";\nimport type { DrawingContext } from \"../DrawingContext\";\n\nexport const setPaintProperties = (\n Skia: Skia,\n ctx: DrawingContext,\n {\n opacity,\n color,\n blendMode,\n strokeWidth,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n antiAlias,\n dither,\n }: PaintProps,\n standalone: boolean\n) => {\n \"worklet\";\n const { paint } = ctx;\n\n if (opacity !== undefined) {\n if (standalone) {\n paint.setAlphaf(paint.getAlphaf() * opacity);\n } else {\n ctx.setOpacity(ctx.getOpacity() * opacity);\n }\n }\n if (color !== undefined) {\n paint.setShader(null);\n paint.setColor(processColor(Skia, color));\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(BlendMode[enumKey(blendMode)]);\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (style !== undefined) {\n paint.setStyle(PaintStyle[enumKey(style)]);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n if (dither !== undefined) {\n paint.setDither(dither);\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AASO,MAAME,kBAAkB,GAAGA,CAChCC,IAAU,EACVC,GAAmB,EACnB;EACEC,OAAO;EACPC,KAAK;EACLC,SAAS;EACTC,WAAW;EACXC,KAAK;EACLC,UAAU;EACVC,SAAS;EACTC,WAAW;EACXC,SAAS;EACTC;AACU,CAAC,EACbC,UAAmB,KAChB;EACH,SAAS;;EACT,MAAM;IAAEC;EAAM,CAAC,GAAGZ,GAAG;EAErB,IAAIC,OAAO,KAAKY,SAAS,EAAE;IACzB,IAAIF,UAAU,EAAE;MACdC,KAAK,CAACE,SAAS,CAACF,KAAK,CAACG,SAAS,CAAC,CAAC,GAAGd,OAAO,CAAC;IAC9C,CAAC,MAAM;MACLD,GAAG,CAACgB,UAAU,CAAChB,GAAG,CAACiB,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export interface BaseRecorder {
6
6
  saveGroup(): void;
7
7
  restoreGroup(): void;
8
- savePaint(props: AnimatedProps<PaintProps>): void;
8
+ savePaint(props: AnimatedProps<PaintProps>, standalone: boolean): void;
9
9
  restorePaint(): void;
10
10
  restorePaintDeclaration(): void;
11
11
  materializePaint(): void;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport type {\n TextProps,\n AtlasProps,\n BlurMaskFilterProps,\n BoxProps,\n BoxShadowProps,\n CircleProps,\n CTMProps,\n DiffRectProps,\n GlyphsProps,\n ImageProps,\n ImageSVGProps,\n LineProps,\n NodeType,\n OvalProps,\n PaintProps,\n ParagraphProps,\n PatchProps,\n PathProps,\n PictureProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextBlobProps,\n TextPathProps,\n VerticesProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer/processors/Animations/Animations\";\n\nimport type { SkPicture } from \"./Picture\";\n\nexport interface BaseRecorder {\n saveGroup(): void;\n restoreGroup(): void;\n savePaint(props: AnimatedProps<PaintProps>): void;\n restorePaint(): void;\n restorePaintDeclaration(): void;\n materializePaint(): void;\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>): void;\n pushImageFilter(\n imageFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void;\n pushColorFilter(\n colorFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void;\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>): void;\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>): void;\n composePathEffect(): void;\n composeColorFilter(): void;\n composeImageFilter(): void;\n saveCTM(props: AnimatedProps<CTMProps>): void;\n restoreCTM(): void;\n drawPaint(): void;\n saveLayer(): void;\n saveBackdropFilter(): void;\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ): void;\n drawImage(props: AnimatedProps<ImageProps>): void;\n drawCircle(props: AnimatedProps<CircleProps>): void;\n drawPoints(props: AnimatedProps<PointsProps>): void;\n drawPath(props: AnimatedProps<PathProps>): void;\n drawRect(props: AnimatedProps<RectProps>): void;\n drawRRect(props: AnimatedProps<RoundedRectProps>): void;\n drawOval(props: AnimatedProps<OvalProps>): void;\n drawLine(props: AnimatedProps<LineProps>): void;\n drawPatch(props: AnimatedProps<PatchProps>): void;\n drawVertices(props: AnimatedProps<VerticesProps>): void;\n drawDiffRect(props: AnimatedProps<DiffRectProps>): void;\n drawText(props: AnimatedProps<TextProps>): void;\n drawTextPath(props: AnimatedProps<TextPathProps>): void;\n drawTextBlob(props: AnimatedProps<TextBlobProps>): void;\n drawGlyphs(props: AnimatedProps<GlyphsProps>): void;\n drawPicture(props: AnimatedProps<PictureProps>): void;\n drawImageSVG(props: AnimatedProps<ImageSVGProps>): void;\n drawParagraph(props: AnimatedProps<ParagraphProps>): void;\n drawAtlas(props: AnimatedProps<AtlasProps>): void;\n}\n\nexport interface JsiRecorder extends BaseRecorder {\n play(): SkPicture;\n applyUpdates(variables: SharedValue<unknown>[]): void;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport type {\n TextProps,\n AtlasProps,\n BlurMaskFilterProps,\n BoxProps,\n BoxShadowProps,\n CircleProps,\n CTMProps,\n DiffRectProps,\n GlyphsProps,\n ImageProps,\n ImageSVGProps,\n LineProps,\n NodeType,\n OvalProps,\n PaintProps,\n ParagraphProps,\n PatchProps,\n PathProps,\n PictureProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextBlobProps,\n TextPathProps,\n VerticesProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer/processors/Animations/Animations\";\n\nimport type { SkPicture } from \"./Picture\";\n\nexport interface BaseRecorder {\n saveGroup(): void;\n restoreGroup(): void;\n savePaint(props: AnimatedProps<PaintProps>, standalone: boolean): void;\n restorePaint(): void;\n restorePaintDeclaration(): void;\n materializePaint(): void;\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>): void;\n pushImageFilter(\n imageFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void;\n pushColorFilter(\n colorFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void;\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>): void;\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>): void;\n composePathEffect(): void;\n composeColorFilter(): void;\n composeImageFilter(): void;\n saveCTM(props: AnimatedProps<CTMProps>): void;\n restoreCTM(): void;\n drawPaint(): void;\n saveLayer(): void;\n saveBackdropFilter(): void;\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ): void;\n drawImage(props: AnimatedProps<ImageProps>): void;\n drawCircle(props: AnimatedProps<CircleProps>): void;\n drawPoints(props: AnimatedProps<PointsProps>): void;\n drawPath(props: AnimatedProps<PathProps>): void;\n drawRect(props: AnimatedProps<RectProps>): void;\n drawRRect(props: AnimatedProps<RoundedRectProps>): void;\n drawOval(props: AnimatedProps<OvalProps>): void;\n drawLine(props: AnimatedProps<LineProps>): void;\n drawPatch(props: AnimatedProps<PatchProps>): void;\n drawVertices(props: AnimatedProps<VerticesProps>): void;\n drawDiffRect(props: AnimatedProps<DiffRectProps>): void;\n drawText(props: AnimatedProps<TextProps>): void;\n drawTextPath(props: AnimatedProps<TextPathProps>): void;\n drawTextBlob(props: AnimatedProps<TextBlobProps>): void;\n drawGlyphs(props: AnimatedProps<GlyphsProps>): void;\n drawPicture(props: AnimatedProps<PictureProps>): void;\n drawImageSVG(props: AnimatedProps<ImageSVGProps>): void;\n drawParagraph(props: AnimatedProps<ParagraphProps>): void;\n drawAtlas(props: AnimatedProps<AtlasProps>): void;\n}\n\nexport interface JsiRecorder extends BaseRecorder {\n play(): SkPicture;\n applyUpdates(variables: SharedValue<unknown>[]): void;\n}\n"],"mappings":"","ignoreList":[]}
@@ -26,7 +26,9 @@ function play(ctx, _command) {
26
26
  ctx.paints.push(command.props.paint);
27
27
  } else {
28
28
  ctx.savePaint();
29
- setPaintProperties(ctx.Skia, ctx, command.props);
29
+ setPaintProperties(ctx.Skia, ctx, command.props,
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+ command.standalone);
30
32
  }
31
33
  } else if (isCommand(command, CommandType.RestorePaint)) {
32
34
  ctx.restorePaint();
@@ -1 +1 @@
1
- {"version":3,"names":["drawCircle","drawImage","drawOval","drawPath","drawPoints","drawRect","drawRRect","drawLine","drawAtlas","drawParagraph","drawImageSVG","drawPicture","drawGlyphs","drawTextBlob","drawTextPath","drawText","drawDiffRect","drawVertices","drawPatch","drawBox","isBoxCommand","composeColorFilters","isPushColorFilter","pushColorFilter","saveCTM","setBlurMaskFilter","isPushImageFilter","pushImageFilter","composeImageFilters","setPaintProperties","composePathEffects","isPushPathEffect","pushPathEffect","isPushShader","pushShader","CommandType","isCommand","isDrawCommand","isGroup","materializeCommand","play","ctx","_command","children","forEach","child","command","SaveBackdropFilter","saveBackdropFilter","SaveLayer","materializePaint","paint","paintDeclarations","pop","canvas","saveLayer","SavePaint","props","paints","push","savePaint","Skia","RestorePaint","restorePaint","ComposeColorFilter","RestorePaintDeclaration","Error","MaterializePaint","ComposePathEffect","ComposeImageFilter","PushBlurMaskFilter","SaveCTM","RestoreCTM","restore","copy","setAlphaf","getAlphaf","getOpacity","p","DrawPaint","drawPaint","DrawImage","DrawCircle","DrawPoints","DrawPath","DrawRect","DrawRRect","DrawOval","DrawLine","DrawPatch","DrawVertices","DrawDiffRect","DrawText","DrawTextPath","DrawTextBlob","DrawGlyphs","DrawPicture","DrawImageSVG","DrawParagraph","DrawAtlas","console","warn","type","replay","commands"],"sources":["Player.ts"],"sourcesContent":["import {\n drawCircle,\n drawImage,\n drawOval,\n drawPath,\n drawPoints,\n drawRect,\n drawRRect,\n drawLine,\n drawAtlas,\n drawParagraph,\n drawImageSVG,\n drawPicture,\n drawGlyphs,\n drawTextBlob,\n drawTextPath,\n drawText,\n drawDiffRect,\n drawVertices,\n drawPatch,\n} from \"./commands/Drawing\";\nimport { drawBox, isBoxCommand } from \"./commands/Box\";\nimport {\n composeColorFilters,\n isPushColorFilter,\n pushColorFilter,\n} from \"./commands/ColorFilters\";\nimport { saveCTM } from \"./commands/CTM\";\nimport {\n setBlurMaskFilter,\n isPushImageFilter,\n pushImageFilter,\n composeImageFilters,\n} from \"./commands/ImageFilters\";\nimport { setPaintProperties } from \"./commands/Paint\";\nimport {\n composePathEffects,\n isPushPathEffect,\n pushPathEffect,\n} from \"./commands/PathEffects\";\nimport { isPushShader, pushShader } from \"./commands/Shaders\";\nimport {\n CommandType,\n isCommand,\n isDrawCommand,\n isGroup,\n materializeCommand,\n} from \"./Core\";\nimport type { Command } from \"./Core\";\nimport type { DrawingContext } from \"./DrawingContext\";\n\nfunction play(ctx: DrawingContext, _command: Command) {\n \"worklet\";\n if (isGroup(_command)) {\n _command.children.forEach((child) => play(ctx, child));\n return;\n }\n const command = materializeCommand(_command);\n if (isCommand(command, CommandType.SaveBackdropFilter)) {\n ctx.saveBackdropFilter();\n } else if (isCommand(command, CommandType.SaveLayer)) {\n ctx.materializePaint();\n const paint = ctx.paintDeclarations.pop();\n ctx.canvas.saveLayer(paint);\n } else if (isDrawCommand(command, CommandType.SavePaint)) {\n if (command.props.paint) {\n ctx.paints.push(command.props.paint);\n } else {\n ctx.savePaint();\n setPaintProperties(ctx.Skia, ctx, command.props);\n }\n } else if (isCommand(command, CommandType.RestorePaint)) {\n ctx.restorePaint();\n } else if (isCommand(command, CommandType.ComposeColorFilter)) {\n composeColorFilters(ctx);\n } else if (isCommand(command, CommandType.RestorePaintDeclaration)) {\n ctx.materializePaint();\n const paint = ctx.restorePaint();\n if (!paint) {\n throw new Error(\"No paint declaration to push\");\n }\n ctx.paintDeclarations.push(paint);\n } else if (isCommand(command, CommandType.MaterializePaint)) {\n ctx.materializePaint();\n } else if (isPushColorFilter(command)) {\n pushColorFilter(ctx, command);\n } else if (isPushShader(command)) {\n pushShader(ctx, command);\n } else if (isPushImageFilter(command)) {\n pushImageFilter(ctx, command);\n } else if (isPushPathEffect(command)) {\n pushPathEffect(ctx, command);\n } else if (isCommand(command, CommandType.ComposePathEffect)) {\n composePathEffects(ctx);\n } else if (isCommand(command, CommandType.ComposeImageFilter)) {\n composeImageFilters(ctx);\n } else if (isDrawCommand(command, CommandType.PushBlurMaskFilter)) {\n setBlurMaskFilter(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.SaveCTM)) {\n saveCTM(ctx, command.props);\n } else if (isCommand(command, CommandType.RestoreCTM)) {\n ctx.canvas.restore();\n } else {\n // TODO: is a copy needed here?\n // apply opacity to the current paint.\n const paint = ctx.paint.copy();\n paint.setAlphaf(paint.getAlphaf() * ctx.getOpacity());\n const paints = [paint, ...ctx.paintDeclarations];\n ctx.paintDeclarations = [];\n paints.forEach((p) => {\n ctx.paints.push(p);\n if (isBoxCommand(command)) {\n drawBox(ctx, command);\n } else if (isCommand(command, CommandType.DrawPaint)) {\n ctx.canvas.drawPaint(ctx.paint);\n } else if (isDrawCommand(command, CommandType.DrawImage)) {\n drawImage(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawCircle)) {\n drawCircle(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPoints)) {\n drawPoints(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPath)) {\n drawPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRect)) {\n drawRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRRect)) {\n drawRRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawOval)) {\n drawOval(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawLine)) {\n drawLine(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPatch)) {\n drawPatch(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawVertices)) {\n drawVertices(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawDiffRect)) {\n drawDiffRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawText)) {\n drawText(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextPath)) {\n drawTextPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextBlob)) {\n drawTextBlob(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawGlyphs)) {\n drawGlyphs(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPicture)) {\n drawPicture(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawImageSVG)) {\n drawImageSVG(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawParagraph)) {\n drawParagraph(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawAtlas)) {\n drawAtlas(ctx, command.props);\n } else {\n console.warn(`Unknown command: ${command.type}`);\n }\n ctx.paints.pop();\n });\n }\n}\n\nexport const replay = (ctx: DrawingContext, commands: Command[]) => {\n \"worklet\";\n commands.forEach((command) => {\n play(ctx, command);\n });\n};\n"],"mappings":"AAAA,SACEA,UAAU,EACVC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,SAAS,EACTC,aAAa,EACbC,YAAY,EACZC,WAAW,EACXC,UAAU,EACVC,YAAY,EACZC,YAAY,EACZC,QAAQ,EACRC,YAAY,EACZC,YAAY,EACZC,SAAS,QACJ,oBAAoB;AAC3B,SAASC,OAAO,EAAEC,YAAY,QAAQ,gBAAgB;AACtD,SACEC,mBAAmB,EACnBC,iBAAiB,EACjBC,eAAe,QACV,yBAAyB;AAChC,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SACEC,iBAAiB,EACjBC,iBAAiB,EACjBC,eAAe,EACf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AACW,KAAK,CAAC;MAClC,CAAC,MAAM,IAAIpB,aAAa,CAACS,OAAO,EAAEX,WAAW,CAAC+D,aAAa,CAAC,EAAE;QAC5DzF,aAAa,CAACgC,GAAG,EAAEK,OAAO,CAACW,KAAK,CAAC;MACnC,CAAC,MAAM,IAAIpB,aAAa,CAACS,OAAO,EAAEX,WAAW,CAACgE,SAAS,CAAC,EAAE;QACxD3F,SAAS,CAACiC,GAAG,EAAEK,OAAO,CAACW,KAAK,CAAC;MAC/B,CAAC,MAAM;QACL2C,OAAO,CAACC,IAAI,CAAC,oBAAoBvD,OAAO,CAACwD,IAAI,EAAE,CAAC;MAClD;MACA7D,GAAG,CAACiB,MAAM,CAACL,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC;EACJ;AACF;AAEA,OAAO,MAAMkD,MAAM,GAAGA,CAAC9D,GAAmB,EAAE+D,QAAmB,KAAK;EAClE,SAAS;;EACTA,QAAQ,CAAC5D,OAAO,CAAEE,OAAO,IAAK;IAC5BN,IAAI,CAACC,GAAG,EAAEK,OAAO,CAAC;EACpB,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["drawCircle","drawImage","drawOval","drawPath","drawPoints","drawRect","drawRRect","drawLine","drawAtlas","drawParagraph","drawImageSVG","drawPicture","drawGlyphs","drawTextBlob","drawTextPath","drawText","drawDiffRect","drawVertices","drawPatch","drawBox","isBoxCommand","composeColorFilters","isPushColorFilter","pushColorFilter","saveCTM","setBlurMaskFilter","isPushImageFilter","pushImageFilter","composeImageFilters","setPaintProperties","composePathEffects","isPushPathEffect","pushPathEffect","isPushShader","pushShader","CommandType","isCommand","isDrawCommand","isGroup","materializeCommand","play","ctx","_command","children","forEach","child","command","SaveBackdropFilter","saveBackdropFilter","SaveLayer","materializePaint","paint","paintDeclarations","pop","canvas","saveLayer","SavePaint","props","paints","push","savePaint","Skia","standalone","RestorePaint","restorePaint","ComposeColorFilter","RestorePaintDeclaration","Error","MaterializePaint","ComposePathEffect","ComposeImageFilter","PushBlurMaskFilter","SaveCTM","RestoreCTM","restore","copy","setAlphaf","getAlphaf","getOpacity","p","DrawPaint","drawPaint","DrawImage","DrawCircle","DrawPoints","DrawPath","DrawRect","DrawRRect","DrawOval","DrawLine","DrawPatch","DrawVertices","DrawDiffRect","DrawText","DrawTextPath","DrawTextBlob","DrawGlyphs","DrawPicture","DrawImageSVG","DrawParagraph","DrawAtlas","console","warn","type","replay","commands"],"sources":["Player.ts"],"sourcesContent":["import {\n drawCircle,\n drawImage,\n drawOval,\n drawPath,\n drawPoints,\n drawRect,\n drawRRect,\n drawLine,\n drawAtlas,\n drawParagraph,\n drawImageSVG,\n drawPicture,\n drawGlyphs,\n drawTextBlob,\n drawTextPath,\n drawText,\n drawDiffRect,\n drawVertices,\n drawPatch,\n} from \"./commands/Drawing\";\nimport { drawBox, isBoxCommand } from \"./commands/Box\";\nimport {\n composeColorFilters,\n isPushColorFilter,\n pushColorFilter,\n} from \"./commands/ColorFilters\";\nimport { saveCTM } from \"./commands/CTM\";\nimport {\n setBlurMaskFilter,\n isPushImageFilter,\n pushImageFilter,\n composeImageFilters,\n} from \"./commands/ImageFilters\";\nimport { setPaintProperties } from \"./commands/Paint\";\nimport {\n composePathEffects,\n isPushPathEffect,\n pushPathEffect,\n} from \"./commands/PathEffects\";\nimport { isPushShader, pushShader } from \"./commands/Shaders\";\nimport {\n CommandType,\n isCommand,\n isDrawCommand,\n isGroup,\n materializeCommand,\n} from \"./Core\";\nimport type { Command } from \"./Core\";\nimport type { DrawingContext } from \"./DrawingContext\";\n\nfunction play(ctx: DrawingContext, _command: Command) {\n \"worklet\";\n if (isGroup(_command)) {\n _command.children.forEach((child) => play(ctx, child));\n return;\n }\n const command = materializeCommand(_command);\n if (isCommand(command, CommandType.SaveBackdropFilter)) {\n ctx.saveBackdropFilter();\n } else if (isCommand(command, CommandType.SaveLayer)) {\n ctx.materializePaint();\n const paint = ctx.paintDeclarations.pop();\n ctx.canvas.saveLayer(paint);\n } else if (isDrawCommand(command, CommandType.SavePaint)) {\n if (command.props.paint) {\n ctx.paints.push(command.props.paint);\n } else {\n ctx.savePaint();\n setPaintProperties(\n ctx.Skia,\n ctx,\n command.props,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (command as any).standalone\n );\n }\n } else if (isCommand(command, CommandType.RestorePaint)) {\n ctx.restorePaint();\n } else if (isCommand(command, CommandType.ComposeColorFilter)) {\n composeColorFilters(ctx);\n } else if (isCommand(command, CommandType.RestorePaintDeclaration)) {\n ctx.materializePaint();\n const paint = ctx.restorePaint();\n if (!paint) {\n throw new Error(\"No paint declaration to push\");\n }\n ctx.paintDeclarations.push(paint);\n } else if (isCommand(command, CommandType.MaterializePaint)) {\n ctx.materializePaint();\n } else if (isPushColorFilter(command)) {\n pushColorFilter(ctx, command);\n } else if (isPushShader(command)) {\n pushShader(ctx, command);\n } else if (isPushImageFilter(command)) {\n pushImageFilter(ctx, command);\n } else if (isPushPathEffect(command)) {\n pushPathEffect(ctx, command);\n } else if (isCommand(command, CommandType.ComposePathEffect)) {\n composePathEffects(ctx);\n } else if (isCommand(command, CommandType.ComposeImageFilter)) {\n composeImageFilters(ctx);\n } else if (isDrawCommand(command, CommandType.PushBlurMaskFilter)) {\n setBlurMaskFilter(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.SaveCTM)) {\n saveCTM(ctx, command.props);\n } else if (isCommand(command, CommandType.RestoreCTM)) {\n ctx.canvas.restore();\n } else {\n // TODO: is a copy needed here?\n // apply opacity to the current paint.\n const paint = ctx.paint.copy();\n paint.setAlphaf(paint.getAlphaf() * ctx.getOpacity());\n const paints = [paint, ...ctx.paintDeclarations];\n ctx.paintDeclarations = [];\n paints.forEach((p) => {\n ctx.paints.push(p);\n if (isBoxCommand(command)) {\n drawBox(ctx, command);\n } else if (isCommand(command, CommandType.DrawPaint)) {\n ctx.canvas.drawPaint(ctx.paint);\n } else if (isDrawCommand(command, CommandType.DrawImage)) {\n drawImage(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawCircle)) {\n drawCircle(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPoints)) {\n drawPoints(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPath)) {\n drawPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRect)) {\n drawRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRRect)) {\n drawRRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawOval)) {\n drawOval(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawLine)) {\n drawLine(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPatch)) {\n drawPatch(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawVertices)) {\n drawVertices(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawDiffRect)) {\n drawDiffRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawText)) {\n drawText(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextPath)) {\n drawTextPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextBlob)) {\n drawTextBlob(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawGlyphs)) {\n drawGlyphs(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPicture)) {\n drawPicture(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawImageSVG)) {\n drawImageSVG(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawParagraph)) {\n drawParagraph(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawAtlas)) {\n drawAtlas(ctx, command.props);\n } else {\n console.warn(`Unknown command: ${command.type}`);\n }\n ctx.paints.pop();\n });\n }\n}\n\nexport const replay = (ctx: DrawingContext, commands: Command[]) => {\n \"worklet\";\n commands.forEach((command) => {\n play(ctx, command);\n });\n};\n"],"mappings":"AAAA,SACEA,UAAU,EACVC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,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,MAAM,IAAIpB,aAAa,CAACS,OAAO,EAAEX,WAAW,CAAC6D,UAAU,CAAC,EAAE;QACzDpF,UAAU,CAAC6B,GAAG,EAAEK,OAAO,CAACW,KAAK,CAAC;MAChC,CAAC,MAAM,IAAIpB,aAAa,CAACS,OAAO,EAAEX,WAAW,CAAC8D,WAAW,CAAC,EAAE;QAC1DtF,WAAW,CAAC8B,GAAG,EAAEK,OAAO,CAACW,KAAK,CAAC;MACjC,CAAC,MAAM,IAAIpB,aAAa,CAACS,OAAO,EAAEX,WAAW,CAAC+D,YAAY,CAAC,EAAE;QAC3DxF,YAAY,CAAC+B,GAAG,EAAEK,OAAO,CAACW,KAAK,CAAC;MAClC,CAAC,MAAM,IAAIpB,aAAa,CAACS,OAAO,EAAEX,WAAW,CAACgE,aAAa,CAAC,EAAE;QAC5D1F,aAAa,CAACgC,GAAG,EAAEK,OAAO,CAACW,KAAK,CAAC;MACnC,CAAC,MAAM,IAAIpB,aAAa,CAACS,OAAO,EAAEX,WAAW,CAACiE,SAAS,CAAC,EAAE;QACxD5F,SAAS,CAACiC,GAAG,EAAEK,OAAO,CAACW,KAAK,CAAC;MAC/B,CAAC,MAAM;QACL4C,OAAO,CAACC,IAAI,CAAC,oBAAoBxD,OAAO,CAACyD,IAAI,EAAE,CAAC;MAClD;MACA9D,GAAG,CAACiB,MAAM,CAACL,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC;EACJ;AACF;AAEA,OAAO,MAAMmD,MAAM,GAAGA,CAAC/D,GAAmB,EAAEgE,QAAmB,KAAK;EAClE,SAAS;;EACTA,QAAQ,CAAC7D,OAAO,CAAEE,OAAO,IAAK;IAC5BN,IAAI,CAACC,GAAG,EAAEK,OAAO,CAAC;EACpB,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -11,7 +11,7 @@ export declare class ReanimatedRecorder implements BaseRecorder {
11
11
  getSharedValues(): SharedValue<unknown>[];
12
12
  saveGroup(): void;
13
13
  restoreGroup(): void;
14
- savePaint(props: AnimatedProps<PaintProps>): void;
14
+ savePaint(props: AnimatedProps<PaintProps>, standalone: boolean): void;
15
15
  restorePaint(): void;
16
16
  restorePaintDeclaration(): void;
17
17
  materializePaint(): void;
@@ -33,9 +33,9 @@ export class ReanimatedRecorder {
33
33
  restoreGroup() {
34
34
  this.recorder.restoreGroup();
35
35
  }
36
- savePaint(props) {
36
+ savePaint(props, standalone) {
37
37
  this.processAnimationValues(props);
38
- this.recorder.savePaint(props);
38
+ this.recorder.savePaint(props, standalone);
39
39
  }
40
40
  restorePaint() {
41
41
  this.recorder.restorePaint();
@@ -1 +1 @@
1
- {"version":3,"names":["isSharedValue","ReanimatedRecorder","constructor","Skia","_defineProperty","Set","recorder","Recorder","processAnimationValues","props","Object","values","forEach","value","has","name","size","add","getRecorder","getSharedValues","Array","from","saveGroup","restoreGroup","savePaint","restorePaint","restorePaintDeclaration","materializePaint","pushPathEffect","pathEffectType","pushImageFilter","imageFilterType","pushColorFilter","colorFilterType","pushShader","shaderType","pushBlurMaskFilter","composePathEffect","composeColorFilter","composeImageFilter","saveCTM","restoreCTM","drawPaint","saveLayer","saveBackdropFilter","drawBox","boxProps","shadows","shadow","map","s","drawImage","drawCircle","drawPoints","drawPath","drawRect","drawRRect","drawOval","drawLine","drawPatch","drawVertices","drawDiffRect","drawText","drawTextPath","drawTextBlob","drawGlyphs","drawPicture","drawImageSVG","drawParagraph","drawAtlas"],"sources":["ReanimatedRecorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport type { BaseRecorder, JsiRecorder, Skia } from \"../../skia/types\";\nimport type {\n PaintProps,\n NodeType,\n BlurMaskFilterProps,\n CTMProps,\n BoxProps,\n BoxShadowProps,\n ImageProps,\n CircleProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\n\nexport class ReanimatedRecorder implements BaseRecorder {\n private values = new Set<SharedValue<unknown>>();\n private recorder: JsiRecorder;\n\n constructor(Skia: Skia) {\n this.recorder = Skia.Recorder();\n }\n\n private processAnimationValues(props?: Record<string, unknown>) {\n if (!props) {\n return;\n }\n Object.values(props).forEach((value) => {\n if (isSharedValue(value) && !this.values.has(value)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n value.name = `variable${this.values.size}`;\n this.values.add(value as SharedValue<unknown>);\n }\n });\n }\n\n getRecorder() {\n return this.recorder;\n }\n\n getSharedValues() {\n return Array.from(this.values);\n }\n\n saveGroup(): void {\n this.recorder.saveGroup();\n }\n\n restoreGroup(): void {\n this.recorder.restoreGroup();\n }\n\n savePaint(props: AnimatedProps<PaintProps>): void {\n this.processAnimationValues(props);\n this.recorder.savePaint(props);\n }\n\n restorePaint(): void {\n this.recorder.restorePaint();\n }\n\n restorePaintDeclaration(): void {\n this.recorder.restorePaintDeclaration();\n }\n\n materializePaint(): void {\n this.recorder.materializePaint();\n }\n\n pushPathEffect(\n pathEffectType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushPathEffect(pathEffectType, props);\n }\n\n pushImageFilter(\n imageFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushImageFilter(imageFilterType, props);\n }\n\n pushColorFilter(\n colorFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushColorFilter(colorFilterType, props);\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>): void {\n this.processAnimationValues(props);\n this.recorder.pushShader(shaderType, props);\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>): void {\n this.processAnimationValues(props);\n this.recorder.pushBlurMaskFilter(props);\n }\n\n composePathEffect(): void {\n this.recorder.composePathEffect();\n }\n\n composeColorFilter(): void {\n this.recorder.composeColorFilter();\n }\n\n composeImageFilter(): void {\n this.recorder.composeImageFilter();\n }\n\n saveCTM(props: AnimatedProps<CTMProps>): void {\n this.processAnimationValues(props);\n this.recorder.saveCTM(props);\n }\n\n restoreCTM(): void {\n this.recorder.restoreCTM();\n }\n\n drawPaint(): void {\n this.recorder.drawPaint();\n }\n\n saveLayer(): void {\n this.recorder.saveLayer();\n }\n\n saveBackdropFilter(): void {\n this.recorder.saveBackdropFilter();\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n }[]\n ): void {\n this.processAnimationValues(boxProps);\n shadows.forEach((shadow) => {\n this.processAnimationValues(\n shadow.props as AnimatedProps<BoxShadowProps>\n );\n });\n this.recorder.drawBox(\n boxProps,\n // TODO: Fix this type BaseRecorder.drawBox()\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n shadows.map((s) => s.props)\n );\n }\n\n drawImage(props: AnimatedProps<ImageProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawImage(props);\n }\n\n drawCircle(props: AnimatedProps<CircleProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawCircle(props);\n }\n\n drawPoints(props: AnimatedProps<PointsProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPoints(props);\n }\n\n drawPath(props: AnimatedProps<PathProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPath(props);\n }\n\n drawRect(props: AnimatedProps<RectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawRect(props);\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawRRect(props);\n }\n\n drawOval(props: AnimatedProps<OvalProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawOval(props);\n }\n\n drawLine(props: AnimatedProps<LineProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawLine(props);\n }\n\n drawPatch(props: AnimatedProps<PatchProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPatch(props);\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawVertices(props);\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawDiffRect(props);\n }\n\n drawText(props: AnimatedProps<TextProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawText(props);\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawTextPath(props);\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawTextBlob(props);\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawGlyphs(props);\n }\n\n drawPicture(props: AnimatedProps<PictureProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPicture(props);\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawImageSVG(props);\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawParagraph(props);\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawAtlas(props);\n }\n}\n"],"mappings":";;;AA+BA,SAASA,aAAa,QAAQ,UAAU;AAExC,OAAO,MAAMC,kBAAkB,CAAyB;EAItDC,WAAWA,CAACC,IAAU,EAAE;IAAAC,eAAA,iBAHP,IAAIC,GAAG,CAAuB,CAAC;IAAAD,eAAA;IAI9C,IAAI,CAACE,QAAQ,GAAGH,IAAI,CAACI,QAAQ,CAAC,CAAC;EACjC;EAEQC,sBAAsBA,CAACC,KAA+B,EAAE;IAC9D,IAAI,CAACA,KAAK,EAAE;MACV;IACF;IACAC,MAAM,CAACC,MAAM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Y,CAACtD,KAAK,CAAC;EACnC;EAEAuD,YAAYA,CAACvD,KAAmC,EAAQ;IACtD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC0D,YAAY,CAACvD,KAAK,CAAC;EACnC;EAEAwD,UAAUA,CAACxD,KAAiC,EAAQ;IAClD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC2D,UAAU,CAACxD,KAAK,CAAC;EACjC;EAEAyD,WAAWA,CAACzD,KAAkC,EAAQ;IACpD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC4D,WAAW,CAACzD,KAAK,CAAC;EAClC;EAEA0D,YAAYA,CAAC1D,KAAmC,EAAQ;IACtD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC6D,YAAY,CAAC1D,KAAK,CAAC;EACnC;EAEA2D,aAAaA,CAAC3D,KAAoC,EAAQ;IACxD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC8D,aAAa,CAAC3D,KAAK,CAAC;EACpC;EAEA4D,SAASA,CAAC5D,KAAgC,EAAQ;IAChD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC+D,SAAS,CAAC5D,KAAK,CAAC;EAChC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["isSharedValue","ReanimatedRecorder","constructor","Skia","_defineProperty","Set","recorder","Recorder","processAnimationValues","props","Object","values","forEach","value","has","name","size","add","getRecorder","getSharedValues","Array","from","saveGroup","restoreGroup","savePaint","standalone","restorePaint","restorePaintDeclaration","materializePaint","pushPathEffect","pathEffectType","pushImageFilter","imageFilterType","pushColorFilter","colorFilterType","pushShader","shaderType","pushBlurMaskFilter","composePathEffect","composeColorFilter","composeImageFilter","saveCTM","restoreCTM","drawPaint","saveLayer","saveBackdropFilter","drawBox","boxProps","shadows","shadow","map","s","drawImage","drawCircle","drawPoints","drawPath","drawRect","drawRRect","drawOval","drawLine","drawPatch","drawVertices","drawDiffRect","drawText","drawTextPath","drawTextBlob","drawGlyphs","drawPicture","drawImageSVG","drawParagraph","drawAtlas"],"sources":["ReanimatedRecorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport type { BaseRecorder, JsiRecorder, Skia } from \"../../skia/types\";\nimport type {\n PaintProps,\n NodeType,\n BlurMaskFilterProps,\n CTMProps,\n BoxProps,\n BoxShadowProps,\n ImageProps,\n CircleProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\n\nexport class ReanimatedRecorder implements BaseRecorder {\n private values = new Set<SharedValue<unknown>>();\n private recorder: JsiRecorder;\n\n constructor(Skia: Skia) {\n this.recorder = Skia.Recorder();\n }\n\n private processAnimationValues(props?: Record<string, unknown>) {\n if (!props) {\n return;\n }\n Object.values(props).forEach((value) => {\n if (isSharedValue(value) && !this.values.has(value)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n value.name = `variable${this.values.size}`;\n this.values.add(value as SharedValue<unknown>);\n }\n });\n }\n\n getRecorder() {\n return this.recorder;\n }\n\n getSharedValues() {\n return Array.from(this.values);\n }\n\n saveGroup(): void {\n this.recorder.saveGroup();\n }\n\n restoreGroup(): void {\n this.recorder.restoreGroup();\n }\n\n savePaint(props: AnimatedProps<PaintProps>, standalone: boolean): void {\n this.processAnimationValues(props);\n this.recorder.savePaint(props, standalone);\n }\n\n restorePaint(): void {\n this.recorder.restorePaint();\n }\n\n restorePaintDeclaration(): void {\n this.recorder.restorePaintDeclaration();\n }\n\n materializePaint(): void {\n this.recorder.materializePaint();\n }\n\n pushPathEffect(\n pathEffectType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushPathEffect(pathEffectType, props);\n }\n\n pushImageFilter(\n imageFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushImageFilter(imageFilterType, props);\n }\n\n pushColorFilter(\n colorFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushColorFilter(colorFilterType, props);\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>): void {\n this.processAnimationValues(props);\n this.recorder.pushShader(shaderType, props);\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>): void {\n this.processAnimationValues(props);\n this.recorder.pushBlurMaskFilter(props);\n }\n\n composePathEffect(): void {\n this.recorder.composePathEffect();\n }\n\n composeColorFilter(): void {\n this.recorder.composeColorFilter();\n }\n\n composeImageFilter(): void {\n this.recorder.composeImageFilter();\n }\n\n saveCTM(props: AnimatedProps<CTMProps>): void {\n this.processAnimationValues(props);\n this.recorder.saveCTM(props);\n }\n\n restoreCTM(): void {\n this.recorder.restoreCTM();\n }\n\n drawPaint(): void {\n this.recorder.drawPaint();\n }\n\n saveLayer(): void {\n this.recorder.saveLayer();\n }\n\n saveBackdropFilter(): void {\n this.recorder.saveBackdropFilter();\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n }[]\n ): void {\n this.processAnimationValues(boxProps);\n shadows.forEach((shadow) => {\n this.processAnimationValues(\n shadow.props as AnimatedProps<BoxShadowProps>\n );\n });\n this.recorder.drawBox(\n boxProps,\n // TODO: Fix this type BaseRecorder.drawBox()\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n shadows.map((s) => s.props)\n );\n }\n\n drawImage(props: AnimatedProps<ImageProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawImage(props);\n }\n\n drawCircle(props: AnimatedProps<CircleProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawCircle(props);\n }\n\n drawPoints(props: AnimatedProps<PointsProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPoints(props);\n }\n\n drawPath(props: AnimatedProps<PathProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPath(props);\n }\n\n drawRect(props: AnimatedProps<RectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawRect(props);\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawRRect(props);\n }\n\n drawOval(props: AnimatedProps<OvalProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawOval(props);\n }\n\n drawLine(props: AnimatedProps<LineProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawLine(props);\n }\n\n drawPatch(props: AnimatedProps<PatchProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPatch(props);\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawVertices(props);\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawDiffRect(props);\n }\n\n drawText(props: AnimatedProps<TextProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawText(props);\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawTextPath(props);\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawTextBlob(props);\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawGlyphs(props);\n }\n\n drawPicture(props: AnimatedProps<PictureProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPicture(props);\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawImageSVG(props);\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawParagraph(props);\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawAtlas(props);\n }\n}\n"],"mappings":";;;AA+BA,SAASA,aAAa,QAAQ,UAAU;AAExC,OAAO,MAAMC,kBAAkB,CAAyB;EAItDC,WAAWA,CAACC,IAAU,EAAE;IAAAC,eAAA,iBAHP,IAAIC,GAAG,CAAuB,CAAC;IAAAD,eAAA;IAI9C,IAAI,CAACE,QAAQ,GAAGH,IAAI,CAACI,QAAQ,CAAC,CAAC;EACjC;EAEQC,sBAAsBA,CAACC,KAA+B,EAAE;IAC9D,IAAI,CAACA,KAAK,EAAE;MACV;IACF;IACAC,MAAM,CAACC,MAAM,CAACF,KAAK,CAAC,CAACG,OAAO,CAAEC,KAAK,IAAK;MACtC,IAAIb,aAAa,CAACa,KAAK,CAAC,IAAI,CAAC,IAAI,CAACF,MAAM,CAACG,GAAG,CAACD,KAAK,CAAC,EAAE;QACnD;QACA;QACAA,KAAK,CAACE,IAAI,GAAG,WAAW,IAAI,CAACJ,MAAM,CAACK,IAAI,EAAE;QAC1C,IAAI,CAACL,MAAM,CAACM,GAAG,CAACJ,KAA6B,CAAC;MAChD;IACF,CAAC,CAAC;EACJ;EAEAK,WAAWA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACZ,QAAQ;EACtB;EAEAa,eAAeA,CAAA,EAAG;IAChB,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACV,MAAM,CAAC;EAChC;EAEAW,SAASA,CAAA,EAAS;IAChB,IAAI,CAAChB,QAAQ,CAACgB,SAAS,CAAC,CAAC;EAC3B;EAEAC,YAAYA,CAAA,EAAS;IACnB,IAAI,CAACjB,QAAQ,CAACiB,YAAY,CAAC,CAAC;EAC9B;EAEAC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CAAC5D,KAAoC,EAAQ;IACxD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC+D,aAAa,CAAC5D,KAAK,CAAC;EACpC;EAEA6D,SAASA,CAAC7D,KAAgC,EAAQ;IAChD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAACgE,SAAS,CAAC7D,KAAK,CAAC;EAChC;AACF","ignoreList":[]}
@@ -21,7 +21,7 @@ export declare class Recorder implements BaseRecorder {
21
21
  private add;
22
22
  saveGroup(): void;
23
23
  restoreGroup(): void;
24
- savePaint(props: AnimatedProps<PaintProps>): void;
24
+ savePaint(props: AnimatedProps<PaintProps>, standalone: boolean): void;
25
25
  restorePaint(): void;
26
26
  restorePaintDeclaration(): void;
27
27
  materializePaint(): void;
@@ -57,10 +57,11 @@ export class Recorder {
57
57
  restoreGroup() {
58
58
  this.cursors.pop();
59
59
  }
60
- savePaint(props) {
60
+ savePaint(props, standalone) {
61
61
  this.add({
62
62
  type: CommandType.SavePaint,
63
- props
63
+ props,
64
+ standalone
64
65
  });
65
66
  }
66
67
  restorePaint() {
@@ -1 +1 @@
1
- {"version":3,"names":["NodeType","isSharedValue","isColorFilter","isImageFilter","isPathEffect","isShader","CommandType","Recorder","constructor","_defineProperty","Set","cursors","push","commands","getRecording","paintPool","animationValues","processProps","props","animatedProps","hasAnimatedProps","key","prop","add","undefined","command","length","saveGroup","children","type","Group","restoreGroup","pop","savePaint","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","Error","PushPathEffect","pushImageFilter","imageFilterType","PushImageFilter","pushColorFilter","colorFilterType","PushColorFilter","pushShader","shaderType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","forEach","shadow","DrawBox","drawImage","DrawImage","drawCircle","DrawCircle","drawPoints","DrawPoints","drawPath","DrawPath","drawRect","DrawRect","drawRRect","DrawRRect","drawOval","DrawOval","drawLine","DrawLine","drawPatch","DrawPatch","drawVertices","DrawVertices","drawDiffRect","DrawDiffRect","drawText","DrawText","drawTextPath","DrawTextPath","drawTextBlob","DrawTextBlob","drawGlyphs","DrawGlyphs","drawPicture","DrawPicture","drawImageSVG","DrawImageSVG","drawParagraph","DrawParagraph","drawAtlas","DrawAtlas"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\nimport type { SkPaint, BaseRecorder } from \"../../skia/types\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n}\n\ninterface AnimationValues {\n animationValues: Set<SharedValue<unknown>>;\n}\n\nexport class Recorder implements BaseRecorder {\n commands: Command[] = [];\n cursors: Command[][] = [];\n animationValues: Set<SharedValue<unknown>> = new Set();\n\n constructor() {\n this.cursors.push(this.commands);\n }\n\n getRecording(): Recording & AnimationValues {\n return {\n commands: this.commands,\n paintPool: [],\n animationValues: this.animationValues,\n };\n }\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, SharedValue<unknown>> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n this.animationValues.add(prop);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.cursors[this.cursors.length - 1].push(command);\n }\n\n saveGroup() {\n const children: Command[] = [];\n this.add({ type: CommandType.Group, children });\n this.cursors.push(children);\n }\n\n restoreGroup() {\n this.cursors.pop();\n }\n\n savePaint(props: AnimatedProps<PaintProps>) {\n this.add({ type: CommandType.SavePaint, props });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n}\n"],"mappings":";;;AAEA,SAASA,QAAQ,QAAQ,iBAAiB;AA4B1C,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,aAAa,EAAEC,aAAa,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,SAAS;AAG9E,SAASC,WAAW,QAAQ,QAAQ;AAYpC,OAAO,MAAMC,QAAQ,CAAyB;EAK5CC,WAAWA,CAAA,EAAG;IAAAC,eAAA,mBAJQ,EAAE;IAAAA,eAAA,kBACD,EAAE;IAAAA,eAAA,0BACoB,IAAIC,GAAG,CAAC,CAAC;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ader","CommandType","Recorder","constructor","_defineProperty","Set","cursors","push","commands","getRecording","paintPool","animationValues","processProps","props","animatedProps","hasAnimatedProps","key","prop","add","undefined","command","length","saveGroup","children","type","Group","restoreGroup","pop","savePaint","standalone","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","Error","PushPathEffect","pushImageFilter","imageFilterType","PushImageFilter","pushColorFilter","colorFilterType","PushColorFilter","pushShader","shaderType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","forEach","shadow","DrawBox","drawImage","DrawImage","drawCircle","DrawCircle","drawPoints","DrawPoints","drawPath","DrawPath","drawRect","DrawRect","drawRRect","DrawRRect","drawOval","DrawOval","drawLine","DrawLine","drawPatch","DrawPatch","drawVertices","DrawVertices","drawDiffRect","DrawDiffRect","drawText","DrawText","drawTextPath","DrawTextPath","drawTextBlob","DrawTextBlob","drawGlyphs","DrawGlyphs","drawPicture","DrawPicture","drawImageSVG","DrawImageSVG","drawParagraph","DrawParagraph","drawAtlas","DrawAtlas"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\nimport type { SkPaint, BaseRecorder } from \"../../skia/types\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n}\n\ninterface AnimationValues {\n animationValues: Set<SharedValue<unknown>>;\n}\n\nexport class Recorder implements BaseRecorder {\n commands: Command[] = [];\n cursors: Command[][] = [];\n animationValues: Set<SharedValue<unknown>> = new Set();\n\n constructor() {\n this.cursors.push(this.commands);\n }\n\n getRecording(): Recording & AnimationValues {\n return {\n commands: this.commands,\n paintPool: [],\n animationValues: this.animationValues,\n };\n }\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, SharedValue<unknown>> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n this.animationValues.add(prop);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.cursors[this.cursors.length - 1].push(command);\n }\n\n saveGroup() {\n const children: Command[] = [];\n this.add({ type: CommandType.Group, children });\n this.cursors.push(children);\n }\n\n restoreGroup() {\n this.cursors.pop();\n }\n\n savePaint(props: AnimatedProps<PaintProps>, standalone: boolean) {\n this.add({ type: CommandType.SavePaint, props, standalone });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n}\n"],"mappings":";;;AAEA,SAASA,QAAQ,QAAQ,iBAAiB;AA4B1C,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,aAAa,EAAEC,aAAa,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,SAAS;AAG9E,SAASC,WAAW,QAAQ,QAAQ;AAYpC,OAAO,MAAMC,QAAQ,CAAyB;EAK5CC,WAAWA,CAAA,EAAG;IAAAC,eAAA,mBAJQ,EAAE;IAAAA,eAAA,kBACD,EAAE;IAAAA,eAAA,0BACoB,IAAIC,GAAG,CAAC,CAAC;IAGpD,IAAI,CAACC,OAAO,CAACC,IAAI,CAAC,IAAI,CAACC,QAAQ,CAAC;EAClC;EAEAC,YAAYA,CAAA,EAAgC;IAC1C,OAAO;MACLD,QAAQ,EAAE,IAAI,CAACA,QAAQ;MACvBE,SAAS,EAAE,EAAE;MACbC,eAAe,EAAE,IAAI,CAACA;IACxB,CAAC;EACH;EAEQC,YAAYA,CAACC,KAA8B,EAAE;IACnD,MAAMC,aAAmD,GAAG,CAAC,CAAC;IAC9D,IAAIC,gBAAgB,GAAG,KAAK;IAE5B,KAAK,MAAMC,GAAG,IAAIH,KAAK,EAAE;MACvB,MAAMI,IAAI,GAAGJ,KAAK,CAACG,GAAG,CAAC;MACvB,IAAIpB,aAAa,CAACqB,IAAI,CAAC,EAAE;QACvB,IAAI,CAACN,eAAe,CAACO,GAAG,CAACD,IAAI,CAAC;QAC9BH,aAAa,CAACE,GAAG,CAAC,GAAGC,IAAI;QACzBF,gBAAgB,GAAG,IAAI;MACzB;IACF;IAEA,OAAO;MACLF,KAAK;MACLC,aAAa,EAAEC,gBAAgB,GAAGD,aAAa,GAAGK;IACpD,CAAC;EACH;EAEQD,GAAGA,CAACE,OAAgB,EAAE;IAC5B,IAAIA,OAAO,CAACP,KAAK,EAAE;M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AYA,CAAC9F,KAAmC,EAAE;IAChD,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAAC2G,YAAY;MAAE/F;IAAM,CAAC,CAAC;EACrD;EAEAgG,aAAaA,CAAChG,KAAoC,EAAE;IAClD,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAAC6G,aAAa;MAAEjG;IAAM,CAAC,CAAC;EACtD;EAEAkG,SAASA,CAAClG,KAAgC,EAAE;IAC1C,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAAC+G,SAAS;MAAEnG;IAAM,CAAC,CAAC;EAClD;AACF","ignoreList":[]}
@@ -141,7 +141,7 @@ const pushMaskFilters = (recorder, maskFilters) => {
141
141
  };
142
142
  const pushPaints = (recorder, paints) => {
143
143
  paints.forEach(paint => {
144
- recorder.savePaint(paint.props);
144
+ recorder.savePaint(paint.props, true);
145
145
  const {
146
146
  colorFilters,
147
147
  maskFilters,
@@ -176,7 +176,7 @@ const visitNode = (recorder, node) => {
176
176
  const paint = processPaint(props);
177
177
  const shouldPushPaint = paint || colorFilters.length > 0 || maskFilters.length > 0 || imageFilters.length > 0 || pathEffects.length > 0 || shaders.length > 0;
178
178
  if (shouldPushPaint) {
179
- recorder.savePaint(paint !== null && paint !== void 0 ? paint : {});
179
+ recorder.savePaint(paint !== null && paint !== void 0 ? paint : {}, false);
180
180
  pushColorFilters(recorder, colorFilters);
181
181
  pushImageFilters(recorder, imageFilters);
182
182
  pushMaskFilters(recorder, maskFilters);