cancel
Showing results for 
Search instead for 
Did you mean: 

Question about screen transition

L4Y
Associate II

I am working on a custom board with TouchGFX, and the custom board connects to a SPI LCD. I found an issue that TouchGFX will call flushFrameBuffer(const touchgfx::Rect& rect) function twice when making a screen transition. I just wondering if the behavior is normal, and why.

Best Regards!

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

You can override beginFrame() and endFrame() in your concrete hal:

void MyHal::beginFrame()
{
    //set some global variable here. In flushFrameBuffer() check if you're transferring the same frame twice.
 
   HAL::beginFrame();
}

If the frame number is different then it's a problem we have to solve in TouchGFX unless you want to compare the entire Rect with what's in the other framebuffer. Not a good idea.

Edit: This is verified in 4.10.0 and will be fixed. Until then you can use the above to ensure that you're only transferring the same frame once.

/Martin

View solution in original post

9 REPLIES 9
Martin KJELDSEN
Chief III

Hi L4Y,

I'm assuming this is a screen transition with no effct (Slide, Cover) and you're wondering why we're trying to transfer the same framebuffer contents twice?

Is rect identical between calls?

/Martin

L4Y
Associate II

Hi Martin,

Yes, it's exactly as what you said. And the size of the Rect is always full screen between each calls when making screen transition

Best Regards!

L4Y
Associate II

@Martin KJELDSEN​ 

Hi Martin,

Any update about the issue?

Best Regards!

Martin KJELDSEN
Chief III

Hi @L4Y​,

I think it's because, usually, if people use an animation to transfer to a different screen, the very last frame of that animation will be the same as the screen being switched in. For noTransition this essentially the same, since there's just 1 step to the transition and then the new frame.

This may be something we haven't thought fully through for flushFrameBuffer(). I suppose what you could do is remember if you've already transferred a particular Rect within a certain frame. Then don't do that again.

Does that make sense?

/Martin

L4Y
Associate II

Hi Martin,

I don't think we could know the particular frame that we've already transferred since we just know the size of Rect from flushFrameBuffer() perspective.

Best Regards

Martin KJELDSEN
Chief III

You can override beginFrame() and endFrame() in your concrete hal:

void MyHal::beginFrame()
{
    //set some global variable here. In flushFrameBuffer() check if you're transferring the same frame twice.
 
   HAL::beginFrame();
}

If the frame number is different then it's a problem we have to solve in TouchGFX unless you want to compare the entire Rect with what's in the other framebuffer. Not a good idea.

Edit: This is verified in 4.10.0 and will be fixed. Until then you can use the above to ensure that you're only transferring the same frame once.

/Martin

L4Y
Associate II

Hi Martin,

Yes, that's maybe a workaround even though it's not perfect. Hope it can be improved in next TouchGFX release.

Best Regards!

Right. I'll investigate whether or not we're 100% right in our assumptions here 🙂 And then it will definitely be improved.

/Martin

Hi again,

Okay, verified. We're working on a fix.

/Martin