OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/surface/accelerated_surface_linux.h" | 5 #include "ui/gfx/surface/accelerated_surface_linux.h" |
6 | 6 |
7 #include <X11/Xlib.h> | |
8 | |
9 #include "third_party/angle/include/EGL/egl.h" | 7 #include "third_party/angle/include/EGL/egl.h" |
10 #include "third_party/angle/include/EGL/eglext.h" | 8 #include "third_party/angle/include/EGL/eglext.h" |
11 #include "ui/gfx/gl/gl_surface_egl.h" | 9 #include "ui/gfx/gl/gl_surface_egl.h" |
| 10 #include "ui/gfx/gl/gl_surface_glx.h" |
12 #include "ui/gfx/gl/gl_bindings.h" | 11 #include "ui/gfx/gl/gl_bindings.h" |
13 | 12 |
14 AcceleratedSurface::AcceleratedSurface(const gfx::Size& size) | 13 AcceleratedSurface::AcceleratedSurface(const gfx::Size& size) |
15 : size_(size) { | 14 : size_(size) { |
16 Display* dpy = gfx::GLSurfaceEGL::GetNativeDisplay(); | 15 Display* dpy = gfx::GLSurfaceEGL::GetNativeDisplay(); |
17 EGLDisplay edpy = gfx::GLSurfaceEGL::GetDisplay(); | 16 EGLDisplay edpy = gfx::GLSurfaceEGL::GetDisplay(); |
18 | 17 |
19 XID window = XDefaultRootWindow(dpy); | 18 XID window = XDefaultRootWindow(dpy); |
20 XWindowAttributes gwa; | 19 XWindowAttributes gwa; |
21 XGetWindowAttributes(dpy, window, &gwa); | 20 XGetWindowAttributes(dpy, window, &gwa); |
(...skipping 16 matching lines...) Expand all Loading... |
38 glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image_); | 37 glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image_); |
39 | 38 |
40 glBindTexture(GL_TEXTURE_2D, current_texture); | 39 glBindTexture(GL_TEXTURE_2D, current_texture); |
41 } | 40 } |
42 | 41 |
43 AcceleratedSurface::~AcceleratedSurface() { | 42 AcceleratedSurface::~AcceleratedSurface() { |
44 glDeleteTextures(1, &texture_); | 43 glDeleteTextures(1, &texture_); |
45 eglDestroyImageKHR(gfx::GLSurfaceEGL::GetDisplay(), image_); | 44 eglDestroyImageKHR(gfx::GLSurfaceEGL::GetDisplay(), image_); |
46 XFreePixmap(gfx::GLSurfaceEGL::GetNativeDisplay(), pixmap_); | 45 XFreePixmap(gfx::GLSurfaceEGL::GetNativeDisplay(), pixmap_); |
47 } | 46 } |
OLD | NEW |