Skip to main content
L4Y
Associate II
August 19, 2019
Solved

Question about screen transition

  • August 19, 2019
  • 7 replies
  • 2080 views

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!

This topic has been closed for replies.
Best answer by Martin KJELDSEN

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

7 replies

Martin KJELDSEN
Principal III
August 19, 2019

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
L4YAuthor
Associate II
August 20, 2019

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
L4YAuthor
Associate II
August 22, 2019

@Martin KJELDSEN​ 

Hi Martin,

Any update about the issue?

Best Regards!

Martin KJELDSEN
Principal III
August 22, 2019

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
L4YAuthor
Associate II
August 23, 2019

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
Martin KJELDSENBest answer
Principal III
August 23, 2019

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
L4YAuthor
Associate II
August 26, 2019

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!

Martin KJELDSEN
Principal III
August 26, 2019

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

/Martin