                          viz_rect.y+(header_h-(header_h/2.5)),
                          viz_rect.x, viz_rect.y+header_h,
                          nvgRGBAf(0,0,0,0.45), nvgRGBAf(0,0,0,0));
  
    ui_draw_rect(s->vg, viz_rect.x, viz_rect.y, viz_rect.w, header_h, gradient);
  
    ui_draw_vision_maxspeed(s);
    ui_draw_vision_speed(s);
    ui_draw_vision_event(s);
  }
 
</s> remove   ui_draw_rect(s->vg, blackout_x, rect.y, blackout_w, rect.h, gradient);
  ui_draw_rect(s->vg, blackout_x, rect.y, blackout_w, rect.h, COLOR_BLACK_ALPHA(144));
 </s> add   ui_fill_rect(s->vg, {blackout_x, rect.y, blackout_w, rect.h}, gradient);
  ui_fill_rect(s->vg, {blackout_x, rect.y, blackout_w, rect.h}, COLOR_BLACK_ALPHA(144)); </s> remove   ui_draw_rect(s->vg, rect.x, rect.y, rect.w, rect.h, bg_colors[STATUS_OFFROAD], 0, 1);
 </s> add   ui_draw_rect(s->vg, rect, bg_colors[STATUS_OFFROAD], 1); </s> remove   ui_draw_rect(s->vg, alr_x, alr_y, alr_w, alr_h, color);

  NVGpaint gradient = nvgLinearGradient(s->vg, alr_x, alr_y, alr_x, alr_y+alr_h,
                                        nvgRGBAf(0.0,0.0,0.0,0.05), nvgRGBAf(0.0,0.0,0.0,0.35));
  ui_draw_rect(s->vg, alr_x, alr_y, alr_w, alr_h, gradient);
 </s> add   ui_fill_rect(s->vg, rect, color);
  ui_fill_rect(s->vg, rect, nvgLinearGradient(s->vg, rect.x, rect.y, rect.x, rect.bottom(), 
                                            nvgRGBAf(0.0, 0.0, 0.0, 0.05), nvgRGBAf(0.0, 0.0, 0.0, 0.35))); </s> remove   ui_draw_rect(s->vg, metric_x, metric_y, metric_w, metric_h,
               severity > 0 ? COLOR_WHITE : COLOR_WHITE_ALPHA(85), 20, 2);
 </s> add   const Rect rect = {30, 338 + y_offset, 240, message_str ? strchr(message_str, '\n') ? 124 : 100 : 148};
  ui_draw_rect(s->vg, rect, severity > 0 ? COLOR_WHITE : COLOR_WHITE_ALPHA(85), 2, 20.); </s> remove   ui_draw_rect(s->vg, 0, 0, sbr_w, s->fb_h, color);
 </s> add   ui_fill_rect(s->vg, {0, 0, sbr_w, s->fb_h}, color);
  ui_fill_rect(s->vg, {viz_rect.x, viz_rect.y, viz_rect.w, header_h}, gradient);
                          viz_rect.y+(header_h-(header_h/2.5)),
                          viz_rect.x, viz_rect.y+header_h,
                          nvgRGBAf(0,0,0,0.45), nvgRGBAf(0,0,0,0));
  
  ui_fill_rect(s->vg, {viz_rect.x, viz_rect.y, viz_rect.w, header_h}, gradient);
  
    ui_draw_vision_maxspeed(s);
    ui_draw_vision_speed(s);
    ui_draw_vision_event(s);
  }
keep keep keep keep replace keep keep keep keep keep
 Use  Rect as the parameter of draw_rect (#19696)

* Use rect as the parameter of draw_rect

* add function ui_fill_rect

* simplify

* rebase master

* apply review 
selfdrive/ui/paint.cc