gallium/hud: add hud_pane::hud pointer
authorMarek Olšák <marek.olsak@amd.com>
Wed, 21 Jun 2017 19:10:27 +0000 (21:10 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 26 Jun 2017 00:17:03 +0000 (02:17 +0200)
for later use

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/gallium/auxiliary/hud/hud_context.c
src/gallium/auxiliary/hud/hud_private.h

index 551cea9..ae2e0fb 100644 (file)
@@ -778,7 +778,8 @@ hud_pane_update_dyn_ceiling(struct hud_graph *gr, struct hud_pane *pane)
 }
 
 static struct hud_pane *
-hud_pane_create(unsigned x1, unsigned y1, unsigned x2, unsigned y2,
+hud_pane_create(struct hud_context *hud,
+                unsigned x1, unsigned y1, unsigned x2, unsigned y2,
                 unsigned period, uint64_t max_value, uint64_t ceiling,
                 boolean dyn_ceiling, boolean sort_items)
 {
@@ -787,6 +788,7 @@ hud_pane_create(unsigned x1, unsigned y1, unsigned x2, unsigned y2,
    if (!pane)
       return NULL;
 
+   pane->hud = hud;
    pane->x1 = x1;
    pane->y1 = y1;
    pane->x2 = x2;
@@ -1123,8 +1125,8 @@ hud_parse_env_var(struct hud_context *hud, const char *env)
      column_width = width > column_width ? width : column_width;
 
       if (!pane) {
-         pane = hud_pane_create(x, y, x + width, y + height, period, 10,
-                         ceiling, dyn_ceiling, sort_items);
+         pane = hud_pane_create(hud, x, y, x + width, y + height, period, 10,
+                                ceiling, dyn_ceiling, sort_items);
          if (!pane)
             return;
       }
index fba919e..580ceb3 100644 (file)
@@ -104,6 +104,7 @@ struct hud_graph {
 
 struct hud_pane {
    struct list_head head;
+   struct hud_context *hud;
    unsigned x1, y1, x2, y2;
    unsigned inner_x1;
    unsigned inner_y1;