• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining
5  * a copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial
14  * portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19  * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  */
25 
26 #include "pixman-renderer.h"
27 
28 #ifndef LIBWESTON_PIXMAN_RENDERER_PROTECTED_H
29 #define LIBWESTON_PIXMAN_RENDERER_PROTECTED_H
30 
31 struct pixman_output_state {
32 	void *shadow_buffer;
33 	pixman_image_t *shadow_image;
34 	pixman_image_t *hw_buffer;
35 	pixman_region32_t *hw_extra_damage;
36     struct tde_output_state_t *tde;
37 };
38 
39 struct pixman_surface_state {
40 	struct weston_surface *surface;
41 
42 	pixman_image_t *image;
43 	struct weston_buffer_reference buffer_ref;
44 	struct weston_buffer_release_reference buffer_release_ref;
45 
46 	struct wl_listener buffer_destroy_listener;
47 	struct wl_listener surface_destroy_listener;
48 	struct wl_listener renderer_destroy_listener;
49     struct tde_surface_state_t *tde;
50 };
51 
52 struct pixman_renderer {
53 	struct weston_renderer base;
54 
55 	int repaint_debug;
56 	pixman_image_t *debug_color;
57 	struct weston_binding *debug_binding;
58 
59 	struct wl_signal destroy_signal;
60     struct tde_renderer_t *tde;
61 };
62 
63 struct pixman_surface_state * get_surface_state(struct weston_surface *surface);
64 struct pixman_renderer * get_renderer(struct weston_compositor *ec);
65 struct pixman_output_state * get_output_state(struct weston_output *output);
66 
67 #endif // LIBWESTON_PIXMAN_RENDERER_PROTECTED_H
68