Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(796)

Side by Side Diff: gpu/vulkan/tests/native_window_x11.cc

Issue 1776453003: Added initial implementation of Vulkan Render Passes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn_vulkan
Patch Set: Adding logging/macros headers Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/vulkan/tests/native_window.h ('k') | gpu/vulkan/tests/vulkan_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "gpu/vulkan/tests/native_window.h"
6
7 #include <X11/Xlib.h>
8
9 #include "ui/gfx/geometry/rect.h"
10 #include "ui/gfx/x/x11_types.h"
11
12 namespace gpu {
13
14 gfx::AcceleratedWidget CreateNativeWindow(const gfx::Rect& bounds) {
15 XDisplay* display = gfx::GetXDisplay();
16 XSetWindowAttributes swa;
17 swa.event_mask = StructureNotifyMask | ExposureMask;
18 swa.override_redirect = True;
19 XID window = XCreateWindow(
20 display, RootWindow(display, DefaultScreen(display)), // parent
21 bounds.x(), bounds.y(), bounds.width(), bounds.height(),
22 0, // border width
23 CopyFromParent, // depth
24 InputOutput,
25 CopyFromParent, // visual
26 CWEventMask | CWOverrideRedirect, &swa);
27 XMapWindow(display, window);
28
29 while (1) {
30 XEvent event;
31 XNextEvent(display, &event);
32 if (event.type == MapNotify && event.xmap.window == window)
33 break;
34 }
35
36 return window;
37 }
38
39 void DestroyNativeWindow(gfx::AcceleratedWidget window) {
40 XDestroyWindow(gfx::GetXDisplay(), window);
41 }
42
43 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/vulkan/tests/native_window.h ('k') | gpu/vulkan/tests/vulkan_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698