1 /* 2 * Cogl 3 * 4 * A Low Level GPU Graphics and Utilities API 5 * 6 * Copyright (C) 2011,2013 Intel Corporation. 7 * 8 * Permission is hereby granted, free of charge, to any person 9 * obtaining a copy of this software and associated documentation 10 * files (the "Software"), to deal in the Software without 11 * restriction, including without limitation the rights to use, copy, 12 * modify, merge, publish, distribute, sublicense, and/or sell copies 13 * of the Software, and to permit persons to whom the Software is 14 * furnished to do so, subject to the following conditions: 15 * 16 * The above copyright notice and this permission notice shall be 17 * included in all copies or substantial portions of the Software. 18 * 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 23 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 24 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 * SOFTWARE. 27 * 28 * 29 */ 30 31 #ifndef __COGL_ONSCREEN_PRIVATE_H 32 #define __COGL_ONSCREEN_PRIVATE_H 33 34 #include "cogl-onscreen.h" 35 #include "cogl-framebuffer-private.h" 36 #include "cogl-closure-list-private.h" 37 #include "cogl-list.h" 38 39 #include <glib.h> 40 41 #ifdef COGL_HAS_WIN32_SUPPORT 42 #include <windows.h> 43 #endif 44 45 typedef struct _CoglOnscreenEvent 46 { 47 CoglList link; 48 49 CoglOnscreen *onscreen; 50 CoglFrameInfo *info; 51 CoglFrameEvent type; 52 } CoglOnscreenEvent; 53 54 typedef struct _CoglOnscreenQueuedDirty 55 { 56 CoglList link; 57 58 CoglOnscreen *onscreen; 59 CoglOnscreenDirtyInfo info; 60 } CoglOnscreenQueuedDirty; 61 62 struct _CoglOnscreen 63 { 64 CoglFramebuffer _parent; 65 66 #ifdef COGL_HAS_X11_SUPPORT 67 uint32_t foreign_xid; 68 CoglOnscreenX11MaskCallback foreign_update_mask_callback; 69 void *foreign_update_mask_data; 70 #endif 71 72 #ifdef COGL_HAS_WIN32_SUPPORT 73 HWND foreign_hwnd; 74 #endif 75 76 #ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT 77 struct wl_surface *foreign_surface; 78 #endif 79 80 #ifdef COGL_HAS_EGL_PLATFORM_MIR_SUPPORT 81 struct MirSurface *foreign_surface; 82 #endif 83 84 CoglBool swap_throttled; 85 86 CoglList frame_closures; 87 88 CoglBool resizable; 89 CoglList resize_closures; 90 91 CoglList dirty_closures; 92 93 int64_t frame_counter; 94 int64_t swap_frame_counter; /* frame counter at last all to 95 * cogl_onscreen_swap_region() or 96 * cogl_onscreen_swap_buffers() */ 97 GQueue pending_frame_infos; 98 99 void *winsys; 100 }; 101 102 CoglOnscreen * 103 _cogl_onscreen_new (void); 104 105 void 106 _cogl_framebuffer_winsys_update_size (CoglFramebuffer *framebuffer, 107 int width, int height); 108 109 void 110 _cogl_onscreen_queue_event (CoglOnscreen *onscreen, 111 CoglFrameEvent type, 112 CoglFrameInfo *info); 113 114 void 115 _cogl_onscreen_notify_frame_sync (CoglOnscreen *onscreen, CoglFrameInfo *info); 116 117 void 118 _cogl_onscreen_notify_complete (CoglOnscreen *onscreen, CoglFrameInfo *info); 119 120 void 121 _cogl_onscreen_notify_resize (CoglOnscreen *onscreen); 122 123 void 124 _cogl_onscreen_queue_dirty (CoglOnscreen *onscreen, 125 const CoglOnscreenDirtyInfo *info); 126 127 128 void 129 _cogl_onscreen_queue_full_dirty (CoglOnscreen *onscreen); 130 131 #endif /* __COGL_ONSCREEN_PRIVATE_H */ 132