213 views
in GUI Development by

Hi, EW Team:

      I have designed a component, which has inside a WarpImage, which plays animation and whose shape can be scaled and transformed. I have integrated four such components into one panel and let all the four animation run together. The time needed for one screen update is about 20ms. After I reshaped one of the four WarpImage, the time increased to 40ms which in turn delays reaction of other GUI operation. I'd like to know how to optimize the runtime performance of such warped animating components?

     My configuration for the surface cache is as below:

#define EW_LAZY_LOAD_BITMAPS                              1
#define EW_LAZY_LOAD_BITMAPS_IF_ANIMATED_ONLY             0
#define EW_DISCARD_BITMAPS                                0
#define EW_DISCARD_BITMAPS_IF_ANIMATED_ONLY               0
#define EW_DISCARD_BITMAPS_IF_NOT_USED_IN_CURRENT_UPDATE  0
#define EW_DISCARD_BITMAPS_IF_NOT_USED_IN_RECENT_UPDATES  1
#define EW_CACHE_OFFSCREEN_SURFACES                       1

   And, Is it possible to get any optimization by enabling the buffered  property of the component? 

  By the way, I have 28MB RAM used as EW heap. and the memory consumed by resource is measured nearly 8MB. So it should be possible to get the trade-off from space to time.

 

  Thank you.

 

Best regards.

Stephen

1 Answer

0 votes
by
 
Best answer

Hello Stephen,

the time needed to perform a warp operation (texture mapping operation) corresponds to the area of this operation. The larger the area, the more pixel need to processed and thus more time needed. On target systems without any GPU able to perform the texture mapping in hardware, the operations are executed by the 'slow' CPU. I assume you target system does not contain such GPU.

What can you do?

1. By setting the property Quality of the Warp Image views to the value false, a faster version of the texture mapping algorithms is used. The disadvantage is the lower quality of the displayed image. If it is sufficient to optimize the screen updates during interactions only (e.g. while the user interactively resizes the image), you can temporarily disable the Quality when the interaction starts and at its end enable the Quality again. See also Control the bilinear filtering.

2. By setting the property Buffered of a GUI component to the value true, the content of the component is pre-drawn and stored in an off-screen bitmap. During screen update the content is not redrawn anymore. The off-screen bitmap is used. This approach makes sense only, when the content of the component does not change too often, otherwise it will be redrawn either way. Since I don't know your application, it is difficult to recommedn or not this approach. You can try it out. See also Control the visibility of nested components.

I hope it helps you further.

Best regards

Paul Banach

by
Hi, Paul:

     My CPU is iMXRT1172, whose graphic can be accelerated by VGLite.

     Your suggestion is really helpful. Even with GPU, the fewer pixels used, the better performance, right? So one option for me is to decrease the area of the warp Image.

     I will try your suggestions later.

     Thank you.

 

Best regards.

Stephen
by

Hello Stephen,

in this case the texture mapping operation (aka. Warp) is performed per VGLite. Unique exception: when the Warp Images are configured with a color or opacity gradient, then the operation is performed per software (via CPU). The combination of Warp and gradient in VGLite is not working or at least not implemented.

Please check following four properties of the Warp Images. Ensure all four properties are equal, otherwise they will define a gradient:

Even with GPU, the fewer pixels used, the better performance, right?

Yes, the more pixel, the more memory need to be transfered via data bus and calculated by the VGLite HW/SW.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...