| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/ozone/platform/egltest/eglplatform_shim.h" | 5 #include "ui/ozone/platform/eglheadless/eglplatform_shim.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
| 10 #include <X11/Xutil.h> | 10 #include <X11/Xutil.h> |
| 11 | 11 |
| 12 #ifdef __cplusplus | 12 #ifdef __cplusplus |
| 13 extern "C" { | 13 extern "C" { |
| 14 #endif | 14 #endif |
| 15 | 15 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 40 bool ShimTerminate(void) { | 40 bool ShimTerminate(void) { |
| 41 XCloseDisplay(g_display); | 41 XCloseDisplay(g_display); |
| 42 return true; | 42 return true; |
| 43 } | 43 } |
| 44 | 44 |
| 45 ShimNativeWindowId ShimCreateWindow(void) { | 45 ShimNativeWindowId ShimCreateWindow(void) { |
| 46 XSetWindowAttributes swa; | 46 XSetWindowAttributes swa; |
| 47 memset(&swa, 0, sizeof(swa)); | 47 memset(&swa, 0, sizeof(swa)); |
| 48 swa.event_mask = 0; | 48 swa.event_mask = 0; |
| 49 | 49 |
| 50 Window window = XCreateWindow(g_display, | 50 Window window = XCreateWindow( |
| 51 DefaultRootWindow(g_display), | 51 g_display, DefaultRootWindow(g_display), kDefaultX, kDefaultY, |
| 52 kDefaultX, | 52 kDefaultWidth, kDefaultHeight, kDefaultBorderWidth, CopyFromParent, |
| 53 kDefaultY, | 53 InputOutput, CopyFromParent, CWEventMask, &swa); |
| 54 kDefaultWidth, | |
| 55 kDefaultHeight, | |
| 56 kDefaultBorderWidth, | |
| 57 CopyFromParent, | |
| 58 InputOutput, | |
| 59 CopyFromParent, | |
| 60 CWEventMask, | |
| 61 &swa); | |
| 62 | 54 |
| 63 XMapWindow(g_display, window); | 55 XMapWindow(g_display, window); |
| 64 XStoreName(g_display, window, "EGL test"); | 56 XStoreName(g_display, window, "EGL test"); |
| 65 XFlush(g_display); | 57 XFlush(g_display); |
| 66 | 58 |
| 67 return window; | 59 return window; |
| 68 } | 60 } |
| 69 | 61 |
| 70 bool ShimQueryWindow(ShimNativeWindowId window_id, int attribute, int* value) { | 62 bool ShimQueryWindow(ShimNativeWindowId window_id, int attribute, int* value) { |
| 71 XWindowAttributes window_attributes; | 63 XWindowAttributes window_attributes; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 97 return native_window_id; | 89 return native_window_id; |
| 98 } | 90 } |
| 99 | 91 |
| 100 bool ShimReleaseNativeWindow(ShimEGLNativeWindowType native_window) { | 92 bool ShimReleaseNativeWindow(ShimEGLNativeWindowType native_window) { |
| 101 return true; | 93 return true; |
| 102 } | 94 } |
| 103 | 95 |
| 104 #ifdef __cplusplus | 96 #ifdef __cplusplus |
| 105 } | 97 } |
| 106 #endif | 98 #endif |
| OLD | NEW |