summaryrefslogtreecommitdiffstats
path: root/gpu/gles2_conform_support
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-08 05:33:40 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-08 05:33:40 +0000
commit0e19785cd8f751070f7c0e9b4d12677e53b7f1b7 (patch)
tree89235f1374c4e65991af306bc87f11bbee5800b7 /gpu/gles2_conform_support
parent440e6103764405fd0d3620c26e47c46a6f9f1417 (diff)
downloadchromium_src-0e19785cd8f751070f7c0e9b4d12677e53b7f1b7.zip
chromium_src-0e19785cd8f751070f7c0e9b4d12677e53b7f1b7.tar.gz
chromium_src-0e19785cd8f751070f7c0e9b4d12677e53b7f1b7.tar.bz2
Make gles2_conform_support compile in Aura.
Break out the GTK dependent bits from gpu/gles2_conform_support/native/egl_native_x11.cc and provide stub versions for aura. This won't run, but at least it will compile which is an improvement. BUG=247211 Review URL: https://chromiumcodereview.appspot.com/16114016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205034 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/gles2_conform_support')
-rw-r--r--gpu/gles2_conform_support/gles2_conform_support.gyp32
-rw-r--r--gpu/gles2_conform_support/native/egl_native_aura.cc42
-rw-r--r--gpu/gles2_conform_support/native/egl_native_gtk.cc63
-rw-r--r--gpu/gles2_conform_support/native/egl_native_x11.cc49
4 files changed, 123 insertions, 63 deletions
diff --git a/gpu/gles2_conform_support/gles2_conform_support.gyp b/gpu/gles2_conform_support/gles2_conform_support.gyp
index 7e62d32..6564ea1 100644
--- a/gpu/gles2_conform_support/gles2_conform_support.gyp
+++ b/gpu/gles2_conform_support/gles2_conform_support.gyp
@@ -4,26 +4,30 @@
{
'variables': {
+ 'chromium_code': 1,
# These are defined here because we want to be able to compile them on
# the buildbots without needed the OpenGL ES 2.0 conformance tests
# which are not open source.
'bootstrap_sources_native': [
'native/main.cc',
],
- 'conditions': [
- ['OS=="linux"', {
- 'bootstrap_sources_native': [
- 'native/egl_native.cc',
- 'native/egl_native_x11.cc',
- ],
- }],
- ['OS=="win"', {
- 'bootstrap_sources_native': [
- 'native/egl_native.cc',
- 'native/egl_native_win.cc',
- ],
- }],
- ],
+ 'conditions': [
+ ['OS=="linux"', {
+ 'bootstrap_sources_native': [
+ 'native/egl_native_aura.cc',
+ 'native/egl_native.cc',
+ 'native/egl_native_gtk.cc',
+ 'native/egl_native_x11.cc',
+ ],
+ }],
+ ['OS=="win"', {
+ 'bootstrap_sources_native': [
+ 'native/egl_native.cc',
+ 'native/egl_native_win.cc',
+ ],
+ }],
+ ],
+
},
'targets': [
{
diff --git a/gpu/gles2_conform_support/native/egl_native_aura.cc b/gpu/gles2_conform_support/native/egl_native_aura.cc
new file mode 100644
index 0000000..f3eea47
--- /dev/null
+++ b/gpu/gles2_conform_support/native/egl_native_aura.cc
@@ -0,0 +1,42 @@
+// Copyright 2013 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.
+
+// This is just a compile fix. If this is really needed when using aura, the
+// methods below should be filled out.
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#include "base/logging.h"
+
+extern "C" {
+#if defined(GLES2_CONFORM_SUPPORT_ONLY)
+#include "gpu/gles2_conform_support/gtf/gtf_stubs.h"
+#else
+#include "third_party/gles2_conform/GTF_ES/glsl/GTF/Source/eglNative.h"
+#endif
+
+GTFbool GTFNativeCreateDisplay(EGLNativeDisplayType *pNativeDisplay) {
+ NOTIMPLEMENTED();
+ return GTFfalse;
+}
+
+void GTFNativeDestroyDisplay(EGLNativeDisplayType nativeDisplay) {
+ NOTIMPLEMENTED();
+}
+
+void GTFNativeDestroyWindow(EGLNativeDisplayType nativeDisplay,
+ EGLNativeWindowType nativeWindow) {
+ NOTIMPLEMENTED();
+}
+
+GTFbool GTFNativeCreateWindow(EGLNativeDisplayType nativeDisplay,
+ EGLDisplay eglDisplay, EGLConfig eglConfig,
+ const char* title, int width, int height,
+ EGLNativeWindowType *pNativeWindow) {
+ NOTIMPLEMENTED();
+ return GTFfalse;
+}
+
+} // extern "C"
diff --git a/gpu/gles2_conform_support/native/egl_native_gtk.cc b/gpu/gles2_conform_support/native/egl_native_gtk.cc
new file mode 100644
index 0000000..e3ae0cb
--- /dev/null
+++ b/gpu/gles2_conform_support/native/egl_native_gtk.cc
@@ -0,0 +1,63 @@
+// Copyright 2013 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 <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
+
+extern "C" {
+
+#if defined(GLES2_CONFORM_SUPPORT_ONLY)
+#include "gpu/gles2_conform_support/gtf/gtf_stubs.h"
+#else
+#include "third_party/gles2_conform/GTF_ES/glsl/GTF/Source/eglNative.h"
+#endif
+
+GTFbool GTFNativeCreateDisplay(EGLNativeDisplayType *pNativeDisplay) {
+ int argc = 0;
+ char **argv = NULL;
+ gtk_init(&argc, &argv);
+ *pNativeDisplay = GDK_DISPLAY();;
+ return *pNativeDisplay ? GTFtrue : GTFfalse;
+}
+
+void GTFNativeDestroyDisplay(EGLNativeDisplayType nativeDisplay) {
+ gtk_exit(0);
+}
+
+void GTFNativeDestroyWindow(EGLNativeDisplayType nativeDisplay,
+ EGLNativeWindowType nativeWindow) {
+ GdkWindow* window = gdk_window_lookup(nativeWindow);
+ gpointer widget = NULL;
+ gdk_window_get_user_data(window, &widget);
+ gtk_widget_destroy(GTK_WIDGET(widget));
+}
+
+GTFbool GTFNativeCreateWindow(EGLNativeDisplayType nativeDisplay,
+ EGLDisplay eglDisplay, EGLConfig eglConfig,
+ const char* title, int width, int height,
+ EGLNativeWindowType *pNativeWindow) {
+#ifdef CHROMEOS_GLES2_CONFORMANCE
+ // Due to the behavior of ChromeOS window manager, which always resize the
+ // top level window etc, we had to create a popup window.
+ GtkWidget* hwnd = gtk_window_new(GTK_WINDOW_POPUP);
+#else
+ GtkWidget* hwnd = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+#endif
+
+ gtk_window_set_title(GTK_WINDOW(hwnd), title);
+ gtk_window_set_default_size(GTK_WINDOW(hwnd), width, height);
+ gtk_widget_set_double_buffered(hwnd, FALSE);
+ gtk_widget_set_app_paintable(hwnd, TRUE);
+
+ // We had to enter gtk main loop to realize the window on ChromeOS.
+ gtk_widget_show_now(hwnd);
+
+ *pNativeWindow = GDK_WINDOW_XWINDOW(hwnd->window);
+
+ return GTFtrue;
+}
+
+} // extern "C"
diff --git a/gpu/gles2_conform_support/native/egl_native_x11.cc b/gpu/gles2_conform_support/native/egl_native_x11.cc
index c57a6f5..3cb6895 100644
--- a/gpu/gles2_conform_support/native/egl_native_x11.cc
+++ b/gpu/gles2_conform_support/native/egl_native_x11.cc
@@ -4,8 +4,6 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
extern "C" {
#if defined(GLES2_CONFORM_SUPPORT_ONLY)
@@ -14,52 +12,6 @@ extern "C" {
#include "third_party/gles2_conform/GTF_ES/glsl/GTF/Source/eglNative.h"
#endif
-
-GTFbool GTFNativeCreateDisplay(EGLNativeDisplayType *pNativeDisplay) {
- int argc = 0;
- char **argv = NULL;
- gtk_init(&argc, &argv);
- *pNativeDisplay = GDK_DISPLAY();;
- return *pNativeDisplay ? GTFtrue : GTFfalse;
-}
-
-void GTFNativeDestroyDisplay(EGLNativeDisplayType nativeDisplay) {
- gtk_exit(0);
-}
-
-GTFbool GTFNativeCreateWindow(EGLNativeDisplayType nativeDisplay,
- EGLDisplay eglDisplay, EGLConfig eglConfig,
- const char* title, int width, int height,
- EGLNativeWindowType *pNativeWindow) {
-#ifdef CHROMEOS_GLES2_CONFORMANCE
- // Due to the behavior of ChromeOS window manager, which always resize the
- // top level window etc, we had to create a popup window.
- GtkWidget* hwnd = gtk_window_new(GTK_WINDOW_POPUP);
-#else
- GtkWidget* hwnd = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-#endif
-
- gtk_window_set_title(GTK_WINDOW(hwnd), title);
- gtk_window_set_default_size(GTK_WINDOW(hwnd), width, height);
- gtk_widget_set_double_buffered(hwnd, FALSE);
- gtk_widget_set_app_paintable(hwnd, TRUE);
-
- // We had to enter gtk main loop to realize the window on ChromeOS.
- gtk_widget_show_now(hwnd);
-
- *pNativeWindow = GDK_WINDOW_XWINDOW(hwnd->window);
-
- return GTFtrue;
-}
-
-void GTFNativeDestroyWindow(EGLNativeDisplayType nativeDisplay,
- EGLNativeWindowType nativeWindow) {
- GdkWindow* window = gdk_window_lookup(nativeWindow);
- gpointer widget = NULL;
- gdk_window_get_user_data(window, &widget);
- gtk_widget_destroy(GTK_WIDGET(widget));
-}
-
EGLImageKHR GTFCreateEGLImage(int width, int height,
GLenum format, GLenum type) {
PFNEGLCREATEIMAGEKHRPROC egl_create_image_khr_;
@@ -120,4 +72,3 @@ void GTFDestroyEGLImage(EGLImageKHR image) {
}
} // extern "C"
-