Acknowledged
CIQQA-3112

Profiler: Dc.draw* methods not registering

Not sure if this is a bug or intentional, but with SDK 8.1.1 in the simulator profiler, I can only see Dc.getHeight and Dc.getWidth. Calls to the drawing functions like Dc.drawText, dc.drawBitmap, dc.drawCircle or dc.drawArc are not registered. Screenshots will follow in comments.

  • I also tried this on a real device (using the -k compiler option) and found that a significant portion of time was spent in various entries only labelled as "(native code)" (which don't appear in the sim profile). I assume at least some of these correspond to the "missing" dc.draw*() calls.

  • I noticed that this seems to happen for devices with Connect IQ version 5 or higher (e.g. fr955). Anything with CIQ less than 4 seems to behave as expected (e.g. fr935).

    I don't want to come to any conclusions for CIQ 4 devices, since the only devices I have like that are preview devices like venu2system6preview, and that one acts kind of funny (I call dc.drawText / dc.drawRectangle and the profiler shows dc.drawCircle / dc.drawRoundedRectangle). (Regular venu2 works like the other CIQ 5 devices in that dc.draw* calls are not shown at all)

    If I didn't know better, I'd say it had something to do with the fact that most CIQ 4+ devices have a GPU, but I see the same behaviour for vivoactive5 and fr165, which don't have a GPU (we know this because in compiler.json, enhancedGraphicSupport is false, and they lack support for Graphics.VectorFont.)

  • Interestingly, if I put the Dc.draw* in a wrapper function, that wrapper function also does not show up in the profiler. Here an example

    function drawPrepared() as Void {
        _dc.drawText( _x as Number, 
                      _y as Number, 
                      _garminFont as GarminFont, 
                      _text, 
                      _justify as TextJustification );
    }

    although called multiple times, drawPrepared does not show in the profiler.

  • The only Dc functions that show up:

    Also tried looking for any functions that have "draw" in it. It only shows my own function that encapsulate the Dc functions. Since these functions are called and content is shown on the screen, I am pretty certain that the Dc.draw* functions are called, they just do not show up on the profiler.