Repository navigation
[Fabric] Support blob: images, and provide better image.onError callbacks - #13285
Merged
Merged
Conversation
| -> winrt::Microsoft::ReactNative::Composition::Experimental::IBrush { | ||
| auto compositor = winrt::Microsoft::ReactNative::Composition::Experimental:: | ||
| MicrosoftCompositionContextHelper::InnerCompositor(compositionContext); | ||
| auto drawingBrush = compositionContext.CreateDrawingSurfaceBrush( |
Contributor
There was a problem hiding this comment.
nit: {} - brace initialization to avoid any type conversion happening and ensuring uniform initialization? https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es23-prefer-the--initializer-syntax
| winrt::Windows::Graphics::DirectX::DirectXAlphaMode::Premultiplied); | ||
| POINT pt; | ||
| Microsoft::ReactNative::Composition::AutoDrawDrawingSurface autoDraw(drawingBrush, scale, &pt); | ||
| auto renderTarget = autoDraw.GetRenderTarget(); |
Contributor
There was a problem hiding this comment.
nit: uniform initialization?
| size, | ||
| winrt::Windows::Graphics::DirectX::DirectXPixelFormat::B8G8R8A8UIntNormalized, | ||
| winrt::Windows::Graphics::DirectX::DirectXAlphaMode::Premultiplied); | ||
| POINT pt; |
Contributor
There was a problem hiding this comment.
POINT pt{}?
| const winrt::Microsoft::ReactNative::IReactContext &reactContext, | ||
| const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compositionContext) | ||
| -> winrt::Microsoft::ReactNative::Composition::Experimental::IBrush { | ||
| auto compositor = winrt::Microsoft::ReactNative::Composition::Experimental:: |
Contributor
There was a problem hiding this comment.
uniform initialization?
Marlene Cota (marlenecota)
approved these changes
Jun 3, 2024
Julio César Rocha (JunielKatarn)
approved these changes
Jun 4, 2024
acoates-ms
added a commit
to acoates-ms/react-native-windows
that referenced
this pull request
Jun 4, 2024
…acks (microsoft#13285) * [Fabric] Support blob: images, and provide better image.onError callbacks * Change files * Remove some test code * Add user-agent * Add public API to set default User-Agent header * various fixes * fix snapshots * Rename Networking -> HttpSettings * Change files * fix * Http.UserAgent RuntimeOption needs to be set before the HttpResource is created
acoates-ms
added a commit
that referenced
this pull request
Jun 5, 2024
* [Fabric] Support blob: images, and provide better image.onError callbacks (#13285) * [Fabric] Support blob: images, and provide better image.onError callbacks * Change files * Remove some test code * Add user-agent * Add public API to set default User-Agent header * various fixes * fix snapshots * Rename Networking -> HttpSettings * Change files * fix * Http.UserAgent RuntimeOption needs to be set before the HttpResource is created * fixups for ImageErrorInfo not existing in 0.74 * fix
11 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In a recent integration ImageLoader started taking more detailed error information. This change provides better error handling for image loading.
I also went ahead and hooked up an ImageLoader for
blob:images.Recent changes to the ImageExample RNTester test page added uses of an Image uri which requires a user-agent header be included in the request to successfully download the image. This PR adds a new API
Microsoft.ReactNative.Networking.SetDefaultUserAgent(ReactInstanceSettings, string)which applications can use to set the a default user-agent header for network requests.The new ImageExample images also needed work to get to work in paper. In particular piping through the new DefaultUserAgent, and forcing a custom download step if its set.
Fixes #13262.
Microsoft Reviewers: Open in CodeFlow