Skip to content

Animatable tile brush #3864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hawkerm
Copy link

@hawkerm hawkerm commented Mar 18, 2021

Fixes #3631

Extends the existing effect animations API to allow creation/manipulation of a CompositionSurfaceBrush which lets us manipulate a brush's properties directly outside the visual. This was the key into animating a tiled background.

There are some questions and remaining issues to investigate. Not sure if they're issues with the animation APIs or composition. However, the base cases work. I've also validated that between this and ParallaxView in the platform, they should serve as replacements to the TileControl so it can be deprecated.

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

TileControl mass copies an image across a surface to tile it and animate it.

What is the new behavior?

Use BorderEffect from Win2D to do tiling effect in graphics layer, then expose a way with a new SurfaceBrushFactory to animate a CompositionSurfaceBrush's properties via the new 7.0 animation layer.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Pull Request has been submitted to the documentation repository instructions. Link:
  • Sample in sample app has been added / updated (for bug fixes / features)
  • New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes (should be source compatible)

TO DO

  • Investigate issues when using KeyFrame animations or setting other properties like RotationAngleInDegrees @Sergio0694 found another odd case here I can send you to help investigate.
  • Add other animation helpers besides just OffsetBrushAnimation (should have a suite)
  • Should the source be more than just an image? Like should we have a Win2D Path provider to use @ratishphilip's work as input too?
  • ScreenToGif records oddly (though GameBar is fine...)
  • Not sure about anything else???

@ghost
Copy link

ghost commented Mar 18, 2021

Thanks hawkerm for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost requested review from michael-hawker, azchohfi and Kyaa-dost March 18, 2021 20:02
@net-foundation-cla
Copy link

net-foundation-cla bot commented Mar 18, 2021

CLA assistant check
All CLA requirements met.

@net-foundation-cla
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

❌ hawkerm sign now
You have signed the CLA already but the status is still pending? Let us recheck it.

@ghost ghost requested a review from Rosuavio March 18, 2021 20:02
@ghost ghost added controls 🎛️ improvements ✨ WinUI 💠 Related to WinUI 3 Version or when paired with External can mean requires fix in WinUI 2/3. labels Mar 18, 2021
Clean-up Brush Properties for use in XAML
@michael-hawker michael-hawker removed the WinUI 💠 Related to WinUI 3 Version or when paired with External can mean requires fix in WinUI 2/3. label Mar 22, 2021
@michael-hawker michael-hawker modified the milestones: 7.1, 7.0.1 Mar 22, 2021
@XAML-Knight
Copy link
Contributor

Hi @hawkerm will you be needing any more assistance on this feature?

  • or -

@michael-hawker are we just waiting for brave souls to review this PR?

@hawkerm
Copy link
Author

hawkerm commented Aug 17, 2021

FYI @XAML-Knight: @hawkerm == @michael-hawker 😉 - This is just my personal account as I was messing around with this for a weekend project and not for anything specific we have priorities on.

I had encountered a few odd edge cases when the confines of the target surface were super narrow, so I was debating if that was a show-stopper or not, though probably more things we should file as potential composition issues.

I should at least clean-up the PR so it can build in the pipeline for easier testing, but we should move this out of the 7.1 milestone as I don't think there'll be time to finalize it (though I may pillage a tiny bit of this for Shadow Animations if it's needed).

@michael-hawker michael-hawker modified the milestones: 7.1, 7.2/8.0? Aug 24, 2021
@michael-hawker michael-hawker added the labs 🧪 Marks an issue/PR involved with Toolkit Labs label Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
controls 🎛️ improvements ✨ labs 🧪 Marks an issue/PR involved with Toolkit Labs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Simplify/Remove TileControl?
3 participants