1 /*
2  * Copyright (C) 2016-2020 Red Hat
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17  * 02111-1307, USA.
18  *
19  */
20 
21 #ifndef META_ONSCREEN_NATIVE_H
22 #define META_ONSCREEN_NATIVE_H
23 
24 #include <glib.h>
25 
26 #include "backends/meta-backend-types.h"
27 #include "backends/native/meta-backend-native-types.h"
28 #include "clutter/clutter.h"
29 #include "cogl/cogl.h"
30 
31 #define META_TYPE_ONSCREEN_NATIVE (meta_onscreen_native_get_type ())
32 G_DECLARE_FINAL_TYPE (MetaOnscreenNative, meta_onscreen_native,
33                       META, ONSCREEN_NATIVE,
34                       CoglOnscreenEgl)
35 
36 void meta_renderer_native_release_onscreen (CoglOnscreen *onscreen);
37 
38 void meta_onscreen_native_finish_frame (CoglOnscreen *onscreen,
39                                         ClutterFrame *frame);
40 
41 void meta_onscreen_native_dummy_power_save_page_flip (CoglOnscreen *onscreen);
42 
43 gboolean meta_onscreen_native_is_buffer_scanout_compatible (CoglOnscreen *onscreen,
44                                                             uint32_t      drm_format,
45                                                             uint64_t      drm_modifier,
46                                                             uint32_t      stride);
47 
48 void meta_onscreen_native_set_view (CoglOnscreen     *onscreen,
49                                     MetaRendererView *view);
50 
51 MetaOnscreenNative * meta_onscreen_native_new (MetaRendererNative *renderer_native,
52                                                MetaGpuKms         *render_gpu,
53                                                MetaOutput         *output,
54                                                MetaCrtc           *crtc,
55                                                CoglContext        *cogl_context,
56                                                int                 width,
57                                                int                 height);
58 
59 #endif /* META_ONSCREEN_NATIVE_H */
60