+#include "metrics-info.h"
+
+typedef enum
+{
+ METRICS_OP_ACCUM,
+ METRICS_OP_BUFFER_DATA,
+ METRICS_OP_BUFFER_SUB_DATA,
+ METRICS_OP_BITMAP,
+ METRICS_OP_BLIT_FRAMEBUFFER,
+ METRICS_OP_CLEAR,
+ METRICS_OP_CLEAR_BUFFER_DATA,
+ METRICS_OP_CLEAR_TEX_IMAGE,
+ METRICS_OP_COPY_PIXELS,
+ METRICS_OP_COPY_TEX_IMAGE,
+ METRICS_OP_DRAW_PIXELS,
+ METRICS_OP_GET_TEX_IMAGE,
+ METRICS_OP_READ_PIXELS,
+ METRICS_OP_TEX_IMAGE,
+
+ /* METRICS_OP_SHADER must be last.
+ *
+ * All larger values for metrics_op_t are interpreted as:
+ *
+ * METRICS_OP_SHADER + shader_program_number
+ *
+ * to indicate a specific shader program.
+ */
+ METRICS_OP_SHADER
+} metrics_op_t;
+
+typedef struct metrics metrics_t;
+
+/* Create a new metrics_t object for tracking metrics, given the
+ * pre-initialized metrics_info_t* describing available counters. */
+metrics_t *
+metrics_create (metrics_info_t *info);
+
+/* Free all internal resources of a metrics_t
+ *
+ * All outstanding metrics counters are discarded.
+ *
+ * The metrics_t object remains valid and may be used again.
+ */
+void
+metrics_fini (metrics_t *metrics);
+
+/* Destroy a metrics_t object.
+ *
+ * After this call, the metrics_t* value is and must not be used
+ * further. */
+void
+metrics_destroy (metrics_t *metrics);
+