Skip to content

Dev/xygu/20210811/wasm color picker - #6766

Merged
Xiaoy312 merged 7 commits into
masterfrom
dev/xygu/20210811/wasm-color-picker
Aug 23, 2021
Merged

Xiaoy312 merged 7 commits into
masterfrom
dev/xygu/20210811/wasm-color-picker

Conversation

@Xiaoy312

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): closes #5992

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

ColorPicker not displaying correctly on skia + wasm.

What is the new behavior?

ColorPicker & ColorSpectrum not displaying correctly on skia + wasm.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

@gitpod-io

gitpod-io Bot commented Aug 13, 2021

Copy link
Copy Markdown

@Xiaoy312

Copy link
Copy Markdown
Contributor Author

todo:

  • sanity checks: wasm💯, skia💯
  • tests..?

newHsvValues.Capacity = pixelCount;

int minDimensionInt = (int)Math.Round(minDimension);
//WorkItemHandler workItemHandler =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a last minute change to just use standard C# async/await pattern with Task instead of whatever is done in WinRT. The only downside was loss of cancellation support.

Of course I forgot to add an Uno Doc for it. Consider this a reminder to myself to document this later.

@XiaotianNetlift
XiaotianNetlift force-pushed the dev/xygu/20210811/wasm-color-picker branch from 9f2b080 to 6d16d62 Compare August 17, 2021 15:00
@Xiaoy312
Xiaoy312 marked this pull request as ready for review August 17, 2021 15:01
@Xiaoy312
Xiaoy312 requested a review from a team August 17, 2021 15:01

@davidjohnoliver davidjohnoliver left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there automated tests you can add for these fixes?

Comment thread src/Uno.UI/UI/Xaml/Media/Brush.skia.cs Resolved
Comment thread src/Uno.UI/UI/Xaml/Media/Brush.skia.cs Resolved
Comment thread src/Uno.UI/UI/Xaml/Media/Brush.wasm.cs Resolved
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20210811/wasm-color-picker branch from 74ac9cb to 5e91674 Compare August 18, 2021 15:59
@Xiaoy312

Xiaoy312 commented Aug 18, 2021 •

Copy link
Copy Markdown
Contributor Author

@davidjohnoliver Regarding tests, so there are 3 problems being addressed here:

  • 1. ColorSpectrum (the rainbow part) not showing any color
    wasm: ColorHelpers::CreateBitmapFromPixelData using .WriteAsync() in a non-async method
    skia: Brush::AsssignAndObserveImageBrush missing implementation for ImageBrush
  • 2. Luminosity Slider (horizontal slider: black ~ {color}) not showing
    wasm: Brush::AsssignAndObserveImageBrush not observing on GradientBrush.GradientStops and their (Color+Offset) changes
  • 3. Irresponsive after being reloaded
    > event subscribed OnApplyTemplate and unsubscribed from Unloaded, but not when (re-)Loaded

1 & 3 are not testable for being related to implementation,
but 2 is and, luckily, there is already an existing test for this:

sample page: UITests.Windows_UI_Xaml_Media.GradientBrushTests.LinearGradientBrush_Change_Stops
automated test: SamplesApp.UITests.Windows_UI_Xaml_Media.GradientBrushTests.LinearGradientBrush_Tests.When_GradientStops_Changed

The brush now updates properly as its GradientStops changes, which previously was not.
The relevant test also pass (if you comment out the [ActivePlatformsAttribute] that blocks it on wasm).

@Xiaoy312 Xiaoy312 added the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Aug 18, 2021
@nventive-devops

Copy link
Copy Markdown
Contributor

The build 32197 found UI Test snapshots differences: android-28-net6: 0, android-28-xamarin: 23, android-28-xamarin-Snap: 26, ios: 26, ios-Snap: 41, skia-gtk-screenshots: 39, wasm: 14, wasm-automated-net5.0-Benchmarks: 0, wasm-automated-net5.0-Default: 4, wasm-automated-net5.0-RuntimeTests: 0

Details
  • android-28-net6: 0 changed over 1

  • android-28-xamarin: 23 changed over 718

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ComboBoxTests_Disabled_UITests_Windows_UI_Xaml_Controls_ComboBox_ComboBox_Disabled
    • ComboBoxTests_Fullscreen_Popup_Generic_Closed
    • ComboBox_Dropdown_Background_ComboBox_open
    • DatePicker_PickerFlyout_PlacementstopRight_True_False_True_UITests_Windows_UI_Xaml_Controls_DatePicker_DatePicker_Placement
    • ComboBoxTests_Fullscreen_Popup_Generic_Opened
    • ComboBoxTests_ToggleDisabled_UITests_Windows_UI_Xaml_Controls_ComboBox_ComboBox_ToggleDisabled
    • DatePicker_PickerFlyout_PlacementscenterLeftOutside_False_True_True_UITests_Windows_UI_Xaml_Controls_DatePicker_DatePicker_Placement
    • ListView_ExpandableItem_ExpandMultipleItems_Expanded_State
    • PopupWithOverlay_After
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • ContentDialog_Auto_Closing_UITests_Shared_Windows_UI_Xaml_Controls_ContentDialogTests_ContentDialog_Closing
    • DatePicker_PickerFlyout_PlacementsbottomLeft_True_False_True_UITests_Windows_UI_Xaml_Controls_DatePicker_DatePicker_Placement
    • DatePicker_PickerFlyout_PlacementsbottomRight_True_False_True_UITests_Windows_UI_Xaml_Controls_DatePicker_DatePicker_Placement
    • ScrollViewer_Removed_And_Added_Initial-Scrolled
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • TextBox_BeforeTextChanging_Validation_UITests_Shared_Windows_UI_Xaml_Controls_TextBoxTests_TextBox_BeforeTextChanging
    • WebView_NavigateToAnchor_navigate_to_anchor
    • WebView_NavigateToLongString_AfterSuccess
    • When_Basic_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_HoldingTests
  • android-28-xamarin-Snap: 26 changed over 902

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CommandBar_Native_Uno_UI_Samples_Content_UITests_CommandBar_CommandBar_Native
    • Default_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name
    • Default_Uno_UI_Samples_UITests_Image_Image_UseTargetSize_Uno_UI_Samples_UITests_Image_Image_UseTargetSize
    • ComboBox_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_DropDownPlacement_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_DropDownPlacement
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats
    • NavigationView_MUXControlsTestApp_NavigationViewPage_MUXControlsTestApp_NavigationViewPage
    • NavigationView_MUXControlsTestApp_NavigationViewRS4Page_MUXControlsTestApp_NavigationViewRS4Page
    • NavigationView_MUXControlsTestApp_NavigationViewTopNavPage_MUXControlsTestApp_NavigationViewTopNavPage
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressBar_WinUIProgressBarSimple_UITests_Microsoft_UI_Xaml_Controls_ProgressBar_WinUIProgressBarSimple
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRingPage
    • Progress_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_CustomSources_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_CustomSources
    • Progress_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • NavigationView_MUXControlsTestApp_HierarchicalNavigationViewMarkup_MUXControlsTestApp_HierarchicalNavigationViewMarkup
    • NavigationView_MUXControlsTestApp_NavigationViewCustomThemeResourcesPage_MUXControlsTestApp_NavigationViewCustomThemeResourcesPage
    • Transform_Grid_With_RotateTransform_And_Button_SamplesApp_Wasm_Windows_UI_Xaml_Media_Transform_Grid_With_RotateTransform_And_Button
    • Map_MapControl_Uno_UI_Samples_Content_UITests_MapControl_MapControl
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • SplitButton_MUX_Test_UITests_Microsoft_UI_Xaml_Controls_SplitButtonTests_SplitButtonPage
    • TabView_UITests_Microsoft_UI_Xaml_Controls_TabViewTests_TabViewPage_UITests_Microsoft_UI_Xaml_Controls_TabViewTests_TabViewPage
    • TextBox_Uno_UI_Samples_Content_UITests_TextBoxControl_TextBox_In_ContentDialog_Uno_UI_Samples_Content_UITests_TextBoxControl_TextBox_In_ContentDialog
  • ios: 26 changed over 273

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Keyboard_Textbox_NoScrollViewer_Validation_5_-_Remove_Focus_on_numberTextBox
    • Large_Image_With_Margin_Ready
    • ListView_ExpandableItemLarge_ExpandHeaderWithSingleItem_Validation_Collapsed_State
    • ListView_ExpandableItemLarge_ExpandHeaderWithSingleItem_Validation_Expanded_State
    • ListView_ExpandableItemLarge_ExpandHeaderWithSingleItem_Validation_Initial_State
    • ListView_ExpandableItemLarge_ExpandHeaderWithSingleItem_Validation_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Expandable_Item_Large
    • NativeCommandBar_Size_thirdOrientation
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • Keyboard_Textbox_InsideScrollViewer_Validation_0_-_Remove_Focus_on_normalTextBox
    • ListView_ExpandableItemLarge_ExpandHeaderWithMultipleItems_Validation_Expanded_State
    • ListView_ExpandableItemLarge_ExpandHeaderWithMultipleItems_Validation_Initial_State
    • ListView_ExpandableItemLarge_ExpandHeaderWithMultipleItems_Validation_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Expandable_Item_Large
    • ListView_ExpandableItemLarge_ExpandHeader_Validation_Collapsed_State
    • ListView_ExpandableItemLarge_ExpandHeader_Validation_Expanded_State
    • ListView_ExpandableItemLarge_ExpandHeader_Validation_Initial_State
    • ListView_ExpandableItemLarge_ExpandHeader_Validation_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Expandable_Item_Large
    • ImageStretch_None_Uno_UI_Samples_UITests_ImageTestsControl_Image_Stretch_None
    • Keyboard_Textbox_InsideScrollViewer_Validation_1_-_Remove_Focus_on_filledTextBox
    • Keyboard_Textbox_InsideScrollViewer_Validation_5_-_Remove_Focus_on_numberTextBox
  • ios-Snap: 41 changed over 894

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ColorPicker_WinUIColorPickerPage_UITests_Shared_Microsoft_UI_Xaml_Controls_ColorPickerTests_WinUIColorPickerPage
    • ContentControlTestsControl_ContentControl_SetNull_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_SetNull
    • ContentControlTestsControl_ContentControl_WithPadding_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_WithPadding
    • ContentControlTestsControl_ContentControl_Inheritance_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_Inheritance
    • ContentControlTestsControl_ContentControl_MultiLevelInheritance_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_MultiLevelInheritance
    • ContentControlTestsControl_ContentControl_Nested_TemplatedParent_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_Nested_TemplatedParent
    • Default_UITests_Windows_UI_Xaml_Controls_GridTestsControl_Grid_def_MinMaxValues_UITests_Windows_UI_Xaml_Controls_GridTestsControl_Grid_def_MinMaxValues
    • Flyout_Flyout_ToggleMenu_UITests_Shared_Windows_UI_Xaml_Controls_Flyout_Flyout_ToggleMenu
    • GridTestsControl_Grid_with_Stack_Panel_and_Trimming_Uno_UI_Samples_Content_UITests_GridTestsControl_Grid_with_Stack_Panel_and_Trimming
    • Expander_WinUIExpanderPage_UITests_Shared_Microsoft_UI_Xaml_Controls_ExpanderTests_WinUIExpanderPage
    • ImageBrushTestControl_BorderImageBrush_Uno_UI_Samples_UITests_ImageBrushTestControl_BorderImageBrush
    • ImageBrushTestControl_ImageBrushWithRotateTransform_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushWithRotateTransform
    • ListView_ListViewGroupedEmpty_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewGroupedEmpty
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Uno_UI_Samples_UITests_Image_Image_Stretch
    • ListView_ListViewGroupedVariableHeightComplexTemplate_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewGroupedVariableHeightComplexTemplate
    • ListView_ListViewHeaderImage_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewHeaderImage
    • ListView_ListView_Expandable_Item_Large_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Expandable_Item_Large
    • NavigationView_MUXControlsTestApp_NavigationViewPage_MUXControlsTestApp_NavigationViewPage
    • NavigationView_MUXControlsTestApp_NavigationViewRS4Page_MUXControlsTestApp_NavigationViewRS4Page
    • NavigationView_MUXControlsTestApp_NavigationViewTopNavPage_MUXControlsTestApp_NavigationViewTopNavPage
  • skia-gtk-screenshots: 39 changed over 939

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ColorPicker-ColorPickerSample
    • ColorPicker-WinUIColorPickerPage
    • Gesture recognizer-Pointer Events test bench
    • ImageBrushTestControl-ImageBrushShapeStretchesAlignments
    • ImageBrushTestControl-ImageBrush_SameWithDelay
    • Image-Image_Stretch_Algmnt_Inf_Vertical
    • Image-Image_Stretch_Alignment_Bigger
    • Image-Image_Stretch_Alignment_Equal
    • Image-Image_Stretch_Alignment_SizeOnControl
    • Image-Image_Stretch_Alignment_Smaller
    • Image-Image_Stretch_Alignment_Taller
    • Image-UniformToFill100x100
    • ImageBrushTestControl-BorderImageBrush
    • ImageBrushTestControl-DoubleImageBrushInList
    • ImageBrushTestControl-Ellipse
    • ImageBrushTestControl-EllipsemaskingEllipseGrid
    • ImageBrushTestControl-EllipsemaskingEllipseSuperpositionPanel
    • ListView-ListView_IsSelected
    • Image-Image_Stretch_Alignment_Wider
    • NavigationView-NavigationViewTopNavPage
  • wasm: 14 changed over 902

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Microsoft_UI_Xaml_Controls.ColorPickerTests.ColorPickerSample
    • UITests.Microsoft_UI_Xaml_Controls.ImageIconTests.ImageIconPage
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRingPage
    • UITests.Shared.Windows_UI_Xaml_Automation.AutomationProperties_Name
    • UITests.Shared.Windows_UI_Xaml_Controls.ImageTests.Image_Stretch_Algmnt_Inf_Vertical
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ColorPickerTests.WinUIColorPickerPage
    • UITests.Windows_UI_Xaml.DragAndDrop.DragDrop_TestPage
    • Uno.UI.Samples.UITests.ImageBrushTestControl.Ellipse
    • Uno.UI.Samples.UITests.Image.Image_Stretch
    • Uno.UI.Samples.UITests.Image.Image_Stretch_Alignment_Bigger
    • Uno.UI.Samples.UITests.Image.Image_Stretch_Alignment_Equal
    • Uno.UI.Samples.UITests.Image.Image_Stretch_Alignment_Taller
    • Uno.UI.Samples.UITests.Image.Image_Stretch_Alignment_Wider
  • wasm-automated-net5.0-Benchmarks: 0 changed over 1

  • wasm-automated-net5.0-Default: 4 changed over 797

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • When_FallbackColor_Set_Initial
    • When_FallbackColor_Set_UITests_Windows_UI_Xaml_Media_BrushesTests_RevealBrush_Fallback
    • ListView_Weird_Measure_During_Arrange_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_Weird_Measure
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
  • wasm-automated-net5.0-RuntimeTests: 0 changed over 1

@Xiaoy312
Xiaoy312 merged commit da197a5 into master Aug 23, 2021
@Xiaoy312
Xiaoy312 deleted the dev/xygu/20210811/wasm-color-picker branch August 23, 2021 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ColorPicker issues in WASM

4 participants