Files
react-native-svg/windows/RNSVG/Fabric/SvgStrings.h
Andrew Coates d02c997352 fix: react-native-windows implementation for new architecture (#2527)
# Summary
There are two main things going on with the PR. Both involve a reworking
of the new arch implementation of rn-svg for windows.
The current implementation attempts to implement a svg renderer from
scratch. There are numerous edge cases that it wasn't handling
correctly, and the performance had some serious issues. This
implementation switches to use the svg rendering path built into
Direct2D. This brings significant performance improvements.

The 2nd issue is there have been various breaking changes in
react-native-windows for how new arch native components are implemented.
This brings the rn-svg implementation in line with those latest changes.

## Test Plan

Primary testing right now is loading up the example app in the repo.
New arch on react-native-windows is still in somewhat early days - so
there are not really current users of this code. I am integrating this
code into Microsoft Office, where I have tested some scenarios. But we
will get expanded testing as we roll out the new arch. I expect there to
be some follow-ups as we expand our usage. The version of rn-svg before
this PR doesn't build with the latest new arch react-native-windows
versions. - So its hard to get worse than that.

### What's required for testing (prerequisites)?

### What are the steps to reproduce (after prerequisites)?

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |    N/A  |
| MacOS   |    N/A      |
| Android |    N/A      |
| Web     |          |

## 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
2024-11-15 12:17:12 +01:00

58 lines
2.4 KiB
C++

#pragma once
namespace winrt::RNSVG::SvgStrings {
constexpr wchar_t fillAttributeName[] = L"fill";
constexpr wchar_t clipPathAttributeName[] = L"clip-path";
constexpr wchar_t clipRuleAttributeName[] = L"clip-rule";
constexpr wchar_t fillRuleAttributeName[] = L"fill-rule";
constexpr wchar_t colorAttributeName[] = L"color";
constexpr wchar_t opacityAttributeName[] = L"opacity";
constexpr wchar_t fillOpacityAttributeName[] = L"fill-opacity";
constexpr wchar_t stopOpacityAttributeName[] = L"stop-opacity";
constexpr wchar_t strokeAttributeName[] = L"stroke";
constexpr wchar_t strokeWidthAttributeName[] = L"stroke-width";
constexpr wchar_t strokeOpacityAttributeName[] = L"stroke-opacity";
constexpr wchar_t strokeLinecapAttributeName[] = L"stroke-linecap";
constexpr wchar_t strokeLinejoinAttributeName[] = L"stroke-linejoin";
constexpr wchar_t strokeDashArrayAttributeName[] = L"stroke-dasharray";
constexpr wchar_t strokeDashOffsetAttributeName[] = L"stroke-dashoffset";
constexpr wchar_t strokeMiterLimitAttributeName[] = L"stroke-miterlimit";
constexpr wchar_t idAttributeName[] = L"id";
constexpr wchar_t transformAttributeName[] = L"transform";
constexpr wchar_t xAttributeName[] = L"x";
constexpr wchar_t yAttributeName[] = L"y";
constexpr wchar_t widthAttributeName[] = L"width";
constexpr wchar_t heightAttributeName[] = L"height";
constexpr wchar_t cxAttributeName[] = L"cx";
constexpr wchar_t cyAttributeName[] = L"cy";
constexpr wchar_t rxAttributeName[] = L"rx";
constexpr wchar_t ryAttributeName[] = L"ry";
constexpr wchar_t rAttributeName[] = L"r";
constexpr wchar_t fxAttributeName[] = L"fx";
constexpr wchar_t fyAttributeName[] = L"fy";
constexpr wchar_t x1AttributeName[] = L"x1";
constexpr wchar_t y1AttributeName[] = L"y1";
constexpr wchar_t x2AttributeName[] = L"x2";
constexpr wchar_t y2AttributeName[] = L"y2";
constexpr wchar_t gradientUnitsAttributeName[] = L"gradientUnits";
constexpr wchar_t gradientTransformAttributeName[] = L"gradientTransform";
constexpr wchar_t offsetAttributeName[] = L"offset";
constexpr wchar_t stopColorAttributeName[] = L"stop-color";
constexpr wchar_t stopAttributeName[] = L"stop";
constexpr wchar_t xlinkhrefAttributeName[] = L"xlink:href";
constexpr wchar_t dAttributeName[] = L"d";
constexpr wchar_t noneAttributeValue[] = L"none";
constexpr wchar_t viewBoxAttributeName[] = L"viewBox";
constexpr wchar_t preserveAspectRatioAttributeName[] = L"preserveAspectRatio";
}