X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fvg%2Fvg_profiler.h;h=87de34f53dae041f4a9be1dd465c656c9ef3f222;hb=5071899d6840f99825d0eaab4132a0bf27646938;hp=fdd26a7101bfca4b57d45bb8b8ce5df08a84a7b9;hpb=2a8c3c81345133939e0893ae8a972e83532888b4;p=vg.git diff --git a/src/vg/vg_profiler.h b/src/vg/vg_profiler.h index fdd26a7..87de34f 100644 --- a/src/vg/vg_profiler.h +++ b/src/vg/vg_profiler.h @@ -24,12 +24,12 @@ struct vg_profile struct timespec start; }; -static void vg_profile_begin( struct vg_profile *profile ) +VG_STATIC void vg_profile_begin( struct vg_profile *profile ) { clock_gettime( CLOCK_REALTIME, &profile->start ); } -static void vg_profile_increment( struct vg_profile *profile ) +VG_STATIC void vg_profile_increment( struct vg_profile *profile ) { profile->buffer_current ++; @@ -42,7 +42,7 @@ static void vg_profile_increment( struct vg_profile *profile ) profile->samples[ profile->buffer_current ] = 0.0f; } -static void vg_profile_end( struct vg_profile *profile ) +VG_STATIC void vg_profile_end( struct vg_profile *profile ) { struct timespec time_end; @@ -61,7 +61,7 @@ static void vg_profile_end( struct vg_profile *profile ) } } -static void vg_profile_drawn( struct vg_profile **profiles, u32 count, +VG_STATIC void vg_profile_drawn( struct vg_profile **profiles, u32 count, float budget, ui_rect panel, u32 colour_offset ) { if( !vg_profiler ) @@ -76,7 +76,7 @@ static void vg_profile_drawn( struct vg_profile **profiles, u32 count, float sh = panel[3] / VG_PROFILE_SAMPLE_COUNT, sw = panel[2]; - ui_fill_rect( &ui_global_ctx, panel, 0xa0000000 ); + ui_fill_rect( panel, 0xa0000000 ); assert( count <= 8 ); float avgs[8]; @@ -110,7 +110,7 @@ static void vg_profile_drawn( struct vg_profile **profiles, u32 count, wx, sh }; u32 colour = colours[ (j+colour_offset) % vg_list_size(colours) ]; - ui_fill_rect( &ui_global_ctx, block, colour ); + ui_fill_rect( block, colour ); total += sample; avgs[j] += sample; @@ -121,19 +121,19 @@ static void vg_profile_drawn( struct vg_profile **profiles, u32 count, for( int i=0; iname ); - ui_text( &ui_global_ctx, (ui_rect){ panel[0] + panel[2] + 4, - panel[1] + i * 14, 0, 0 }, - infbuf, - 1, - k_text_align_left ); + ui_text( (ui_rect){ panel[0] + panel[2] + 4, + panel[1] + i * 14, 0, 0 }, + infbuf, + 1, + k_text_align_left ); } } -static void vg_profiler_init(void) +VG_STATIC void vg_profiler_init(void) { vg_convar_push( (struct vg_convar){ .name = "vg_profiler",