diff options
author | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-25 14:55:40 +0000 |
---|---|---|
committer | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-25 14:55:40 +0000 |
commit | 1cf99aa4097c941fbd3295eee277b40a947978df (patch) | |
tree | 1ea1af795f6e5214870ba5ff463316b558e2e0ad /ui/gfx/surface | |
parent | 5a9299c645bfa4fcbbc3b3106af2837e2b9f7ec1 (diff) | |
download | chromium_src-1cf99aa4097c941fbd3295eee277b40a947978df.zip chromium_src-1cf99aa4097c941fbd3295eee277b40a947978df.tar.gz chromium_src-1cf99aa4097c941fbd3295eee277b40a947978df.tar.bz2 |
Revert 90511 - Use pixmaps and EGLImages to transport image data between GPU process and browser. Behind a compile TOUCH_UI flag.
It uses the MAC OSX AcceleratedSurface IPCs to communicate between the GPU process and browser. The major difference between the OSX display path is that I send an ACK back after AcceleratedSurfaceSetIOSurface because the process of binding a texture to the pixmap may destroy the contents of the pixmap.
BUG=none
TEST=by hand on Linux (w/ and w/o TOUCH_UI), Windows, and Mac
Review URL: http://codereview.chromium.org/6987014
TBR=backer@chromium.org
Review URL: http://codereview.chromium.org/7261016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90512 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/surface')
-rw-r--r-- | ui/gfx/surface/accelerated_surface_linux.cc | 47 | ||||
-rw-r--r-- | ui/gfx/surface/accelerated_surface_linux.h | 33 | ||||
-rw-r--r-- | ui/gfx/surface/surface.gyp | 5 |
3 files changed, 0 insertions, 85 deletions
diff --git a/ui/gfx/surface/accelerated_surface_linux.cc b/ui/gfx/surface/accelerated_surface_linux.cc deleted file mode 100644 index 9a42c68..0000000 --- a/ui/gfx/surface/accelerated_surface_linux.cc +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ui/gfx/surface/accelerated_surface_linux.h" - -#include <X11/Xlib.h> - -#include "third_party/angle/include/EGL/egl.h" -#include "third_party/angle/include/EGL/eglext.h" -#include "ui/gfx/gl/gl_surface_egl.h" -#include "ui/gfx/gl/gl_bindings.h" - -AcceleratedSurface::AcceleratedSurface(const gfx::Size& size) - : size_(size) { - Display* dpy = gfx::GLSurfaceEGL::GetNativeDisplay(); - EGLDisplay edpy = gfx::GLSurfaceEGL::GetDisplay(); - - XID window = XDefaultRootWindow(dpy); - XWindowAttributes gwa; - XGetWindowAttributes(dpy, window, &gwa); - pixmap_ = XCreatePixmap( - dpy, window, size_.width(), size_.height(), gwa.depth); - - image_ = eglCreateImageKHR( - edpy, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, (void*) pixmap_, NULL); - - glGenTextures(1, &texture_); - - GLint current_texture = 0; - glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_texture); - - glBindTexture(GL_TEXTURE_2D, texture_); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image_); - - glBindTexture(GL_TEXTURE_2D, current_texture); -} - -AcceleratedSurface::~AcceleratedSurface() { - glDeleteTextures(1, &texture_); - eglDestroyImageKHR(gfx::GLSurfaceEGL::GetDisplay(), image_); - XFreePixmap(gfx::GLSurfaceEGL::GetNativeDisplay(), pixmap_); -} diff --git a/ui/gfx/surface/accelerated_surface_linux.h b/ui/gfx/surface/accelerated_surface_linux.h deleted file mode 100644 index b905712..0000000 --- a/ui/gfx/surface/accelerated_surface_linux.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_GFX_SURFACE_ACCELERATED_SURFACE_LINUX_H_ -#define UI_GFX_SURFACE_ACCELERATED_SURFACE_LINUX_H_ -#pragma once - -#include "base/memory/ref_counted.h" -#include "ui/gfx/size.h" - -// The GL context associated with the surface must be current when -// an instance is created or destroyed. -class AcceleratedSurface : public base::RefCounted<AcceleratedSurface> { - public: - AcceleratedSurface(const gfx::Size& size); - const gfx::Size& size() const { return size_; } - uint32 pixmap() const { return pixmap_; } - uint32 texture() const { return texture_; } - - private: - ~AcceleratedSurface(); - - gfx::Size size_; - void* image_; - uint32 pixmap_; - uint32 texture_; - - friend class base::RefCounted<AcceleratedSurface>; - DISALLOW_COPY_AND_ASSIGN(AcceleratedSurface); -}; - -#endif // UI_GFX_SURFACE_ACCELERATED_SURFACE_LINUX_H_ diff --git a/ui/gfx/surface/surface.gyp b/ui/gfx/surface/surface.gyp index 960e148..e4c2893 100644 --- a/ui/gfx/surface/surface.gyp +++ b/ui/gfx/surface/surface.gyp @@ -16,9 +16,6 @@ ['include', '_(gtk|linux|posix|skia|x)\\.cc$'], ['include', '/(gtk|x11)_[^/]*\\.cc$'], ], - 'include_dirs': [ - '<(DEPTH)/third_party/angle/include', - ], }], ['OS=="mac"', {'sources/': [ ['include', '/cocoa/'], @@ -47,8 +44,6 @@ '<(DEPTH)/ui/ui.gyp:ui_gfx', ], 'sources': [ - 'accelerated_surface_linux.cc', - 'accelerated_surface_linux.h', 'accelerated_surface_mac.cc', 'accelerated_surface_mac.h', 'io_surface_support_mac.cc', |