Skip to content

Commit

Permalink
[0.74] Port fixes (#13430)
Browse files Browse the repository at this point in the history
* [Fabric] [Win32] Add image response APIs to win32 exports (#13428)

* Add image response APIs to win32 exports

* Change files

* fix

* [Fabric] Handle changes to BorderRadius (#13422)

* Handle changes to borderradius

* Change files

* format

* fix change files
  • Loading branch information
acoates-ms authored Jul 10, 2024
1 parent d3c8e76 commit 71a102a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Handle changes to borderradius",
"packageName": "react-native-windows",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Add image response APIs to win32 exports",
"packageName": "react-native-windows",
"email": "[email protected]",
"dependentChangeType": "patch"
}
21 changes: 21 additions & 0 deletions vnext/Desktop/module.g.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
void* winrt_make_Microsoft_Internal_TestController();
void* winrt_make_Microsoft_ReactNative_ReactNativeIsland();
#ifdef USE_WINUI3
void *winrt_make_Microsoft_ReactNative_Composition_ImageFailedResponse();
void *winrt_make_Microsoft_ReactNative_Composition_StreamImageResponse();
void *winrt_make_Microsoft_ReactNative_Composition_Experimental_UriBrushFactoryImageResponse();
void *winrt_make_Microsoft_ReactNative_Composition_Experimental_MicrosoftCompositionContextHelper();
#endif
void *winrt_make_Microsoft_ReactNative_Composition_Experimental_SystemCompositionContextHelper();
Expand All @@ -28,6 +31,15 @@ void* winrt_make_facebook_react_NativeLogEventSource();
void* winrt_make_facebook_react_NativeTraceEventSource();

#ifndef USE_FABRIC
void *winrt_make_Microsoft_ReactNative_Composition_ImageFailedResponse() {
winrt::throw_hresult(E_NOTIMPL);
}
void *winrt_make_Microsoft_ReactNative_Composition_StreamImageResponse() {
winrt::throw_hresult(E_NOTIMPL);
}
void *winrt_make_Microsoft_ReactNative_Composition_Experimental_UriBrushFactoryImageResponse() {
winrt::throw_hresult(E_NOTIMPL);
}
void* winrt_make_Microsoft_ReactNative_ReactNativeIsland() {
winrt::throw_hresult(E_NOTIMPL);
}
Expand Down Expand Up @@ -65,6 +77,15 @@ void* __stdcall winrt_get_activation_factory([[maybe_unused]] std::wstring_view
return winrt_make_Microsoft_ReactNative_ReactNativeIsland();
}
#ifdef USE_WINUI3
if (requal(name, L"Microsoft.ReactNative.Composition.ImageFailedResponse")) {
return winrt_make_Microsoft_ReactNative_Composition_ImageFailedResponse();
}
if (requal(name, L"Microsoft.ReactNative.Composition.StreamImageResponse")) {
return winrt_make_Microsoft_ReactNative_Composition_StreamImageResponse();
}
if (requal(name, L"Microsoft.ReactNative.Composition.Experimental.UriBrushFactoryImageResponse")) {
return winrt_make_Microsoft_ReactNative_Composition_Experimental_UriBrushFactoryImageResponse();
}
if (requal(name, L"Microsoft.ReactNative.Composition.Experimental.MicrosoftCompositionContextHelper")) {
return winrt_make_Microsoft_ReactNative_Composition_Experimental_MicrosoftCompositionContextHelper();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@ void SetBorderLayerPropertiesCommon(
facebook::react::BorderStyle borderStyle) {
layer.Offset({anchorOffset.x, anchorOffset.y, 0}, {anchorPoint.x, anchorPoint.y, 0});
layer.RelativeSizeWithOffset(size, relativeSizeAdjustment);
layer.as<::Microsoft::ReactNative::Composition::Experimental::IVisualInterop>()->SetClippingPath(nullptr);

if ((textureRect.right - textureRect.left) <= 0 || (textureRect.bottom - textureRect.top) <= 0)
return;

Expand Down Expand Up @@ -703,7 +705,8 @@ void SetBorderLayerProperties(
// if (VisualVersion::IsUseWinCompClippingRegionEnabled())
{
layer.Offset({anchorOffset.x, anchorOffset.y, 0}, {anchorPoint.x, anchorPoint.y, 0});
layer.Size({textureRect.right - textureRect.left, textureRect.bottom - textureRect.top});
layer.RelativeSizeWithOffset(
{textureRect.right - textureRect.left, textureRect.bottom - textureRect.top}, {0.0f, 0.0f});

layer.Brush(theme->Brush(*borderColor));

Expand Down

0 comments on commit 71a102a

Please sign in to comment.