[Android] GraphicsView scaling after canvas.ResetState - fix2#31198
Closed
kubaflo wants to merge 28 commits intodotnet:mainfrom
Closed
[Android] GraphicsView scaling after canvas.ResetState - fix2#31198kubaflo wants to merge 28 commits intodotnet:mainfrom
kubaflo wants to merge 28 commits intodotnet:mainfrom
Conversation
…lates (dotnet#30275) * Initial plan * Fix iOS Custom Entitlements File override issue - respect user-defined CodesignEntitlements Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> * Add MSBuild tests for CodesignEntitlements fix - Added SingleProject_CodesignEntitlementsRespected test to verify custom CodesignEntitlements property is preserved - Added SingleProject_DefaultEntitlementsUsedWhenNoCustomSet test to verify default behavior still works - Tests validate the fix for issue dotnet#30221 where custom entitlements were being overridden Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
…tnet#23665) Context: https://github.com/davidortinau/AllTheLists Profiling @davidortinau's app, I noticed the "Check-ins" sample felt the slowest on Android. One thing I noticed while scrolling: 98.75ms (0.90%) Microsoft.Maui!Microsoft.Maui.Handlers.ImageHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect) 67.11ms (0.61%) Mono.Android!Android.Widget.ImageView.ScaleType.get_CenterCrop() In this case, `PlatformArrange()` is called a lot for every `<Image/>`: if (PlatformView.GetScaleType() == ImageView.ScaleType.CenterCrop) { var (left, top, right, bottom) = PlatformView.Context!.ToPixels(frame); var clipRect = new Android.Graphics.Rect(0, 0, right - left, bottom - top); PlatformView.ClipBounds = clipRect; } `ImageView.ScaleType` is a class, and so and some bookkeeping is done to lookup *the same* C# instance for a Java object. We can make this a bit better by writing a new Java method: public static boolean isImageViewCenterCrop(@nonnull ImageView imageView) { return imageView.getScaleType() == ImageView.ScaleType.CENTER_CROP; } Next, let's make a `PlatformView.ToPixels()` extension method that can avoid calling `View.Context` for the same reason. Lastly, we can make a `PlatformInterop.SetClipBounds()` method to avoid creating a `Android.Graphics.Rect` object in C#. With these changes, I can only see the topmost `PlatformArrange()` method now: 2.93ms (0.03%) Microsoft.Maui!Microsoft.Maui.Handlers.ImageHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect) This should improve the layout performance of all .NET MAUI `<Image/>` on Android. I also "banned" `GetScaleType()` in `eng/BannedSymbols.txt`.
…ds remaining threshold (dotnet#29763) * Fix for 29740 * Update Issue29740.cs * Update src/Controls/tests/TestCases.HostApp/Issues/Issue29740.cs indentation changes Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com> * Update src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29740.cs Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com> --------- Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com>
* Fixed the picker view items source does not display on mac platform * Added the test case * Added the output images. * Fixed the picker view items source does not display on mac platform * Added the test case * Added the output images. * Create ShouldDisplayPickerItemsWhenOpeningPicker.png Added the output image on windows platform * Ignore the test case on catalyst platform * Added the test case for mac platform * Added the macOS output image * Added the comment line for fix.
* [iOS] Fixed hidden indicator * [iOS] Fixed hidden indicator
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…st (dotnet#29569) * [Android] Input controls should not change keyboard visibility - test * searchBar * CR fixes
* [Android] Top bar item colors - fix * Avoid tab icon tint for FontImageSource on Android Prevents applying TabIconTint when the tab icon is a FontImageSource, as it manages its own color. This ensures correct icon coloring for font-based icons in TabbedPageManager.
* Gradient background with ImageButton * Update GradientBackgroundShouldWorkWithImageButton.png
* MenuItem color fix * Added UI test * Added snapshots * Updated Mac snapshot
* [iOS] Thumb image improvements * Added snapshots
* add support to dismiss the prompt with enter on keyboard * Windows only --------- Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
* Initial plan * Fix CarouselView layout constraint issues on Mac Catalyst Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com> * Add missing image --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com> Co-authored-by: Rui Marinho <me@ruimarinho.net>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…not properly work - fix (dotnet#31100) * Call UpdateLayout in MapIsGrouped on iOS Added a call to handler.UpdateLayout() in the MapIsGrouped method to ensure the layout is refreshed when the grouping state changes in CollectionViewHandler2 for iOS. * Added a UITest
* optimize JS escaping * add tests * copy to HybridWebView * use conditional compilation * Update src/Controls/tests/DeviceTests/Elements/WebView/WebViewTests.cs Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com> * Move tests * use common WebViewHelper class * add missing using * fix build * Fix CI * More tests --------- Co-authored-by: Edward Miller <symbiogenisis@outlook.com> Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com> Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
* Changing shape background color with dataTrigger * Refactor
…1183) Addresses issue dotnet#31182 where GraphicsView would draw at half size after calling canvas.ResetState() on Android. ScalingCanvas now preserves the initial scale and restores it after ResetState and RestoreState. Added related test cases to verify correct drawing behavior.
…dotnet#27801) * Fixed the Border Rendering issues in CollectionViewHandler2 * Remove the unwanted namspace * Removed UI test and added the device test * Resolved the build errors * Registered the cv2 handler inside the test to avoid other test failures * Added a Assert.NotNull test * Resolved the conflicts
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
@kubaflo to get the candidate build in a green state I've reverted this PR on the candidate build for now Let's give this one a fresh start against main and get it green their and then merge that into inflight |
Eliminates an unnecessary call to _scalingCanvas.Scale in PlatformGraphicsView. The scaling is already handled by adjusting the dirtyRect dimensions, preventing double scaling. TextTransform Property Does Not Apply at Runtime When TextType="Html" Is Set on Label (dotnet#29700)
Contributor
Author
|
Closed in favour of #31244 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Follow-up to #31183
While reviewing the snapshots, I noticed that without calling canvas.ResetState(); in the Draw method, the rendered content size was doubled.
This change removes the unnecessary call to _scalingCanvas.Scale in PlatformGraphicsView. Scaling is already accounted for in the ResetState() method
Issues Fixed
Fixes #31182