gallium: rename st_framebuffer_iface -> pipe_frontend_drawable, etc.
[platform/upstream/mesa.git] / src / gallium / frontends / hgl / hgl_context.h
1 /*
2  * Copyright 2009-2014, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *              Alexander von Gluck IV, kallisti5@unixzen.com
7  */
8 #ifndef HGL_CONTEXT_H
9 #define HGL_CONTEXT_H
10
11 #include "util/u_thread.h"
12 #include "util/format/u_formats.h"
13 #include "pipe/p_compiler.h"
14 #include "pipe/p_screen.h"
15 #include "postprocess/filters.h"
16
17 #include "frontend/api.h"
18
19 #include "bitmap_wrapper.h"
20
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26
27 #define CONTEXT_MAX 32
28
29 typedef int64 context_id;
30
31
32 struct hgl_buffer
33 {
34         struct pipe_frontend_drawable *drawable;
35         struct st_visual* visual;
36
37         unsigned width;
38         unsigned height;
39         unsigned mask;
40
41         struct pipe_screen* screen;
42         void* winsysContext;
43
44         enum pipe_texture_target target;
45         struct pipe_resource* textures[ST_ATTACHMENT_COUNT];
46
47         void *map;
48 };
49
50
51 struct hgl_display
52 {
53         mtx_t mutex;
54
55         struct pipe_frontend_screen *fscreen;
56 };
57
58
59 struct hgl_context
60 {
61         struct hgl_display* display;
62         struct st_context* st;
63         struct st_visual* stVisual;
64
65         // Post processing
66         struct pp_queue_t* postProcess;
67         unsigned int postProcessEnable[PP_FILTERS];
68
69         // Desired viewport size
70         unsigned width;
71         unsigned height;
72
73         mtx_t fbMutex;
74
75         struct hgl_buffer* buffer;
76 };
77
78 // hgl_buffer from statetracker interface
79 struct hgl_buffer* hgl_st_framebuffer(struct pipe_frontend_drawable *drawable);
80
81 // hgl framebuffer
82 struct hgl_buffer* hgl_create_st_framebuffer(struct hgl_context* context, void *winsysContext);
83 void hgl_destroy_st_framebuffer(struct hgl_buffer *buffer);
84
85 // hgl manager
86 struct pipe_frontend_screen* hgl_create_st_manager(struct hgl_context* screen);
87 void hgl_destroy_st_manager(struct pipe_frontend_screen *fscreen);
88
89 // hgl visual
90 struct st_visual* hgl_create_st_visual(ulong options);
91 void hgl_destroy_st_visual(struct st_visual* visual);
92
93 // hgl display
94 struct hgl_display* hgl_create_display(struct pipe_screen* screen);
95 void hgl_destroy_display(struct hgl_display *display);
96
97
98 #ifdef __cplusplus
99 }
100 #endif
101
102 #endif /* HGL_CONTEXT_H */