                                          COLOR_BLACK_ALPHA(is_rhd ? 255 : 0), COLOR_BLACK_ALPHA(is_rhd ? 0 : 255));
    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));
    // border
    ui_draw_rect(s->vg, rect.x, rect.y, rect.w, rect.h, bg_colors[STATUS_OFFROAD], 0, 1);
  
    const bool face_detected = s->scene.dmonitoring_state.getFaceDetected();
    if (face_detected) {
      auto fxy_list = s->scene.driver_state.getFacePosition();
      float face_x = fxy_list[0];
 
</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     float fbox_x = valid_rect.centerX() + (is_rhd ? face_x : -face_x) * valid_rect.w;
    float fbox_y = valid_rect.centerY() + face_y * valid_rect.h;
 </s> add     int fbox_x = valid_rect.centerX() + (is_rhd ? face_x : -face_x) * valid_rect.w;
    int fbox_y = valid_rect.centerY() + face_y * valid_rect.h; </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     const float box_size = 0.6 * rect.h / 2;
    ui_draw_rect(s->vg, fbox_x - box_size / 2, fbox_y - box_size / 2, box_size, box_size, nvgRGBAf(1.0, 1.0, 1.0, alpha), 35, 10);
 </s> add     const int box_size = 0.6 * rect.h / 2;
    ui_draw_rect(s->vg, {fbox_x - box_size / 2, fbox_y - box_size / 2, box_size, box_size}, nvgRGBAf(1.0, 1.0, 1.0, alpha), 10, 35.);
  ui_draw_rect(s->vg, rect, bg_colors[STATUS_OFFROAD], 1);
                                          COLOR_BLACK_ALPHA(is_rhd ? 255 : 0), COLOR_BLACK_ALPHA(is_rhd ? 0 : 255));
    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));
    // border
  ui_draw_rect(s->vg, rect, bg_colors[STATUS_OFFROAD], 1);
  
    const bool face_detected = s->scene.dmonitoring_state.getFaceDetected();
    if (face_detected) {
      auto fxy_list = s->scene.driver_state.getFacePosition();
      float face_x = fxy_list[0];
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