forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "EGLImage transport for TOUCH_UI".
The issue with r90511 was that we need EGL header files for touchui=1 builds. The solution was to pull them in from third_party/angle for touchui=1 only. BUG=none TEST=by hand on Linux (w/ and w/o TOUCH_UI), Windows, and Mac TBR=sky@chromium.org,apatrick@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90513 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
backer@chromium.org
committed
Jun 25, 2011
1 parent
1cf99aa
commit ae80234
Showing
28 changed files
with
615 additions
and
44 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
chrome/browser/renderer_host/accelerated_surface_container_touch.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// 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 "accelerated_surface_container_touch.h" | ||
|
||
#include "third_party/angle/include/EGL/egl.h" | ||
#include "third_party/angle/include/EGL/eglext.h" | ||
#include "ui/gfx/gl/gl_bindings.h" | ||
#include "ui/gfx/gl/gl_surface_egl.h" | ||
|
||
AcceleratedSurfaceContainerTouch::AcceleratedSurfaceContainerTouch( | ||
uint64 surface_handle) | ||
: image_(NULL), | ||
texture_(0) { | ||
image_ = eglCreateImageKHR( | ||
gfx::GLSurfaceEGL::GetDisplay(), EGL_NO_CONTEXT, | ||
EGL_NATIVE_PIXMAP_KHR, (void*) surface_handle, NULL); | ||
|
||
glGenTextures(1, &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_); | ||
} | ||
|
||
AcceleratedSurfaceContainerTouch::~AcceleratedSurfaceContainerTouch() { | ||
glDeleteTextures(1, &texture_); | ||
eglDestroyImageKHR(gfx::GLSurfaceEGL::GetDisplay(), image_); | ||
} |
31 changes: 31 additions & 0 deletions
31
chrome/browser/renderer_host/accelerated_surface_container_touch.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// 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 CHROME_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_TOUCH_H_ | ||
#define CHROME_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_TOUCH_H_ | ||
#pragma once | ||
|
||
#include "base/basictypes.h" | ||
#include "base/memory/ref_counted.h" | ||
|
||
// Helper class for storing image data from the GPU process renderered | ||
// on behalf of the RWHVV. It assumes that GL context that will display | ||
// the image data is current when an instance of this object is created | ||
// or destroyed. | ||
class AcceleratedSurfaceContainerTouch | ||
: public base::RefCounted<AcceleratedSurfaceContainerTouch> { | ||
public: | ||
explicit AcceleratedSurfaceContainerTouch(uint64 surface_handle); | ||
uint32 texture() const { return texture_; } | ||
private: | ||
friend class base::RefCounted<AcceleratedSurfaceContainerTouch>; | ||
|
||
~AcceleratedSurfaceContainerTouch(); | ||
|
||
void* image_; | ||
uint32 texture_; | ||
DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerTouch); | ||
}; | ||
|
||
#endif // CHROME_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_TOUCH_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.