Scaling component performance


#1

I have some instances of a component which I move and scale at the same time. The component does nothing but draw an image. While the components are scaling the performance is 15fps. If I remove the scaling, leaving just movement, it's 60fps. How can I improve this?


#2

Which OS? Which rendering engine are you using? Have you profiled your app to see which functions are actually using CPU?


#3

This is on iOS 8. It's mostly in juce::OpenGLContext::CachedImage::paintComponent which goes to                                   juce::OpenGLRendering::StateHelpers::EdgeTableRenderer<juce::OpenGLRendering::StateHelpers::ShaderQuadQueue>::handleEdgeTableLineFull. This eventually adds a line to a quad list, which calls draw(). This appears to be doing a draw call per line of an image I'm trying to draw... that doesn't seem right....

There's also a lot of time spent in juce::OpenGLContext::copyTexture from juce::OpenGLContext::CachedImage::drawComponentBuffer.



 


#4

This appears to be doing a draw call per line of an image I'm trying to draw... that doesn't seem right....
 

That is how it works if the image is skewed or rotated, as it needs to draw through a stencil with anti-aliased edges. If you're just resizing then it may be possible to optimise that process into fewer triangles though..


#5

I'm just resizing it, it's not skewed or rotated. Since I'm not rotating it, should it already be going through a more optimal rendering path? I wonder if I'm doing something to cause suboptimal rendering.


#6

Could just be that that particular path isn't optimised, I'd need to check when I get chance..