gitlab-ci: enable sanitizers for the meson builds
[mesa-waffle.git] / src / waffle / android / droid_platform.c
blobd1cf843380647068fa745afc72bf6044a9ed1866
1 // SPDX-FileCopyrightText: Copyright 2012 Intel Corporation
2 // SPDX-License-Identifier: BSD-2-Clause
4 #include <stdlib.h>
6 #include "wcore_error.h"
8 #include "posix_platform.h"
10 #include "wegl_config.h"
11 #include "wegl_context.h"
12 #include "wegl_util.h"
14 #include "droid_display.h"
15 #include "droid_platform.h"
16 #include "droid_window.h"
18 static const struct wcore_platform_vtbl droid_platform_vtbl;
20 static bool
21 droid_platform_destroy(struct wcore_platform *wc_self)
23 struct droid_platform *self = droid_platform(wc_self);
25 posix_platform_teardown(wc_self);
26 free(self);
27 return true;
30 struct wcore_platform*
31 droid_platform_create(void)
33 static const char *dso_names[] = {
34 NULL,
35 "libGLESv1_CM.so",
36 "libGLESv2.so",
38 struct droid_platform *self;
40 self = wcore_calloc(sizeof(*self));
41 if (self == NULL)
42 return NULL;
44 wcore_platform_init(&self->wcore);
45 posix_platform_init(&self->wcore, dso_names);
47 self->wcore.vtbl = &droid_platform_vtbl;
48 return &self->wcore;
51 static const struct wcore_platform_vtbl droid_platform_vtbl = {
52 .destroy = droid_platform_destroy,
54 .make_current = wegl_make_current,
55 .get_proc_address = wegl_get_proc_address,
56 .dl_can_open = posix_platform_can_dlopen,
57 .dl_sym = posix_platform_dlsym,
59 .display = {
60 .connect = droid_display_connect,
61 .destroy = droid_display_disconnect,
62 .supports_context_api = wegl_display_supports_context_api,
63 .get_native = NULL,
66 .config = {
67 .choose = wegl_config_choose,
68 .destroy = wegl_config_destroy,
69 .get_native = NULL,
72 .context = {
73 .create = wegl_context_create,
74 .destroy = wegl_context_destroy,
75 .get_native = NULL,
78 .window = {
79 .create = droid_window_create,
80 .destroy = droid_window_destroy,
81 .show = droid_window_show,
82 .swap_buffers = wegl_surface_swap_buffers,
83 .resize = droid_window_resize,
84 .get_native = NULL,