Code Monkey home page Code Monkey logo

Comments (2)

maxkatz6 avatar maxkatz6 commented on June 4, 2024

@djalan you need to run Dispatcher jobs first, and only then timer tick. As otherwise render thread won't have anything to render.

But either way, we have tests for rendering into a bitmap:

var frame = window.CaptureRenderedFrame();

For this bug we definitely need a minimal repro, as it works for me.

Note, CaptureRenderedFrame used in our tests is just a handy extension on top of ForceRenderTimerTick:
https://github.com/AvaloniaUI/Avalonia/blob/master/src/Headless/Avalonia.Headless/HeadlessWindowExtensions.cs#L22-L24

from avalonia.

djalan avatar djalan commented on June 4, 2024

@maxkatz6 I changed my code and most of the clicks in my application work well by simply using:

Dispatcher.UIThread.RunJobs();
AvaloniaHeadlessPlatform.ForceRenderTimerTick();

On the other hand, I experience problems when we use IPageTransition like in the below image. I tried using my loop to sync over 30 times with 10_000_000 ticks, but I still can't land on the final frame when I click the next button.

I had success in other parts of my application by calling my loop 4-5 times and with 100_000 or 1_000_000 ticks, but this one below looks like a dead end.

On two rare occassions, but it is not a constant behavior, I had success looping 20x with 10_000_000 ticks. I was able to see half of page 2, but it does not happen all the time. Increasing the numbers can end up yielding less frames.

PageTransition

I was able to sync (with a few loop calls) another part of the application that uses page transition too. I will compare the classes tomorrow.

from avalonia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.