mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-03 07:06:04 +00:00
feat(windows): add fabric support (#2321)
# Summary This PR adds Fabric support and a FabricExample app for Windows. Windows support for Fabric is experimental and as such APIs are subject to change/break. ## Test Plan https://github.com/software-mansion/react-native-svg/assets/1422161/2a7db119-44a8-4ee1-a837-41ca8320d8fa ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ❌ | | Android | ❌ | | Windows | ✅ | ## Checklist - [x] I have tested this on a device and a simulator - [ ] I added documentation in `README.md` - [ ] I updated the typed files (typescript) - [ ] I added a test for the API in the `__tests__` folder
This commit is contained in:
@@ -1,11 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef USE_FABRIC
|
||||
#include "DefsProps.g.h"
|
||||
#endif
|
||||
|
||||
#include "DefsView.g.h"
|
||||
#include "GroupView.h"
|
||||
|
||||
namespace winrt::RNSVG::implementation {
|
||||
|
||||
#ifdef USE_FABRIC
|
||||
REACT_STRUCT(DefsProps)
|
||||
struct DefsProps : DefsPropsT<DefsProps, SvgGroupCommonProps> {
|
||||
DefsProps(const winrt::Microsoft::ReactNative::ViewProps &props);
|
||||
|
||||
void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept
|
||||
override;
|
||||
|
||||
REACT_SVG_NODE_COMMON_PROPS;
|
||||
REACT_SVG_RENDERABLE_COMMON_PROPS;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct DefsView : DefsViewT<DefsView, RNSVG::implementation::GroupView> {
|
||||
public:
|
||||
DefsView() = default;
|
||||
|
||||
#ifdef USE_FABRIC
|
||||
DefsView(const winrt::Microsoft::ReactNative::CreateComponentViewArgs &args);
|
||||
|
||||
static void RegisterComponent(const winrt::Microsoft::ReactNative::IReactPackageBuilderFabric &builder) noexcept;
|
||||
#endif
|
||||
|
||||
// IRenderable
|
||||
void Draw(RNSVG::D2DDeviceContext const &deviceContext, Windows::Foundation::Size const &size);
|
||||
};
|
||||
} // namespace winrt::RNSVG::implementation
|
||||
|
||||
Reference in New Issue
Block a user