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

Side by Side Diff: ui/gfx/surface/accelerated_surface_linux.cc

Issue 7395020: Create new GLSurface for cross process image transport. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698