summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-16 17:57:36 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-16 17:57:36 +0000
commit86be5d085562b134a353faffe5c737470f0a1788 (patch)
tree5f126b106b49c24711c56c97890e129a3c794e8d /gpu
parent14055fca73ef88666127f1f9c3b1c62d2ea683f7 (diff)
downloadchromium_src-86be5d085562b134a353faffe5c737470f0a1788.zip
chromium_src-86be5d085562b134a353faffe5c737470f0a1788.tar.gz
chromium_src-86be5d085562b134a353faffe5c737470f0a1788.tar.bz2
Move code around to fix build with system mesa.
BUG=161389 Review URL: https://codereview.chromium.org/11973003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177172 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/EGL/eglextchromium.h36
-rw-r--r--gpu/GL/glextchromium.h26
-rw-r--r--gpu/GLES2/gl2chromium_constants.h23
-rw-r--r--gpu/command_buffer/client/gles2_c_lib.cc1
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc5
-rw-r--r--gpu/command_buffer/service/gles2_cmd_validation.cc1
6 files changed, 88 insertions, 4 deletions
diff --git a/gpu/EGL/eglextchromium.h b/gpu/EGL/eglextchromium.h
new file mode 100644
index 0000000..fdde853
--- /dev/null
+++ b/gpu/EGL/eglextchromium.h
@@ -0,0 +1,36 @@
+// Copyright (c) 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 file contains Chromium-specific EGL extensions declarations.
+
+#ifndef GPU_EGL_EGLEXTCHROMIUM_H_
+#define GPU_EGL_EGLEXTCHROMIUM_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EGL/eglplatform.h>
+
+/* EGLSyncControlCHROMIUM requires 64-bit uint support */
+#if KHRONOS_SUPPORT_INT64
+#ifndef EGL_CHROMIUM_sync_control
+#define EGL_CHROMIUM_sync_control 1
+typedef khronos_uint64_t EGLuint64CHROMIUM;
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(
+ EGLDisplay dpy, EGLSurface surface, EGLuint64CHROMIUM *ust,
+ EGLuint64CHROMIUM *msc, EGLuint64CHROMIUM *sbc);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCVALUESCHROMIUMPROC)
+ (EGLDisplay dpy, EGLSurface surface, EGLuint64CHROMIUM *ust,
+ EGLuint64CHROMIUM *msc, EGLuint64CHROMIUM *sbc);
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#define // GPU_EGL_EGLEXTCHROMIUM_H_
diff --git a/gpu/GL/glextchromium.h b/gpu/GL/glextchromium.h
new file mode 100644
index 0000000..41818d7
--- /dev/null
+++ b/gpu/GL/glextchromium.h
@@ -0,0 +1,26 @@
+// Copyright (c) 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 file contains Chromium-specific GL extensions declarations.
+
+#ifndef GPU_GL_GLEXTCHROMIUM_H_
+#define GPU_GL_GLEXTCHROMIUM_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef GL_NVX_gpu_memory_info
+#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047
+#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048
+#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049
+#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A
+#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GPU_GL_GLEXTCHROMIUM_H_
diff --git a/gpu/GLES2/gl2chromium_constants.h b/gpu/GLES2/gl2chromium_constants.h
new file mode 100644
index 0000000..0e3b422
--- /dev/null
+++ b/gpu/GLES2/gl2chromium_constants.h
@@ -0,0 +1,23 @@
+// Copyright (c) 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 file contains some GLES2 constants. There is a Chromium-specific need
+// to have them in a separate file.
+
+#ifndef GPU_GLES2_GL2CHROMIUM_CONSTANTS_H_
+#define GPU_GLES2_GL2CHROMIUM_CONSTANTS_H_
+
+#ifndef GL_DEPTH24_STENCIL8
+#define GL_DEPTH24_STENCIL8 0x88F0
+#endif
+
+/* GL_EXT_discard_framebuffer */
+#ifndef GL_EXT_discard_framebuffer
+#define GL_COLOR_EXT 0x1800
+#define GL_DEPTH_EXT 0x1801
+#define GL_STENCIL_EXT 0x1802
+#endif
+
+#endif // GPU_GLES2_GL2CHROMIUM_CONSTANTS_H_
+
diff --git a/gpu/command_buffer/client/gles2_c_lib.cc b/gpu/command_buffer/client/gles2_c_lib.cc
index ed3e009..5c25761 100644
--- a/gpu/command_buffer/client/gles2_c_lib.cc
+++ b/gpu/command_buffer/client/gles2_c_lib.cc
@@ -10,6 +10,7 @@
#ifndef GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES
#endif
+#include <GLES2/gl2chromium.h>
#include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h>
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 6f450a2..2c1a468 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -56,6 +56,7 @@
#include "gpu/command_buffer/service/texture_manager.h"
#include "gpu/command_buffer/service/vertex_attrib_manager.h"
#include "gpu/command_buffer/service/vertex_array_manager.h"
+#include "gpu/GLES2/gl2chromium_constants.h"
#include "ui/gl/async_pixel_transfer_delegate.h"
#include "ui/gl/gl_image.h"
#include "ui/gl/gl_implementation.h"
@@ -64,10 +65,6 @@
#include "ui/surface/io_surface_support_mac.h"
#endif
-#if !defined(GL_DEPTH24_STENCIL8)
-#define GL_DEPTH24_STENCIL8 0x88F0
-#endif
-
// TODO(zmo): we can't include "City.h" due to type def conflicts.
extern uint64 CityHash64(const char*, size_t);
diff --git a/gpu/command_buffer/service/gles2_cmd_validation.cc b/gpu/command_buffer/service/gles2_cmd_validation.cc
index 8d4fd71..3377933 100644
--- a/gpu/command_buffer/service/gles2_cmd_validation.cc
+++ b/gpu/command_buffer/service/gles2_cmd_validation.cc
@@ -8,6 +8,7 @@
#define GLES2_GPU_SERVICE 1
#include "gpu/command_buffer/service/gles2_cmd_validation.h"
#include "gpu/command_buffer/service/gl_utils.h"
+#include "gpu/GLES2/gl2chromium_constants.h"
namespace gpu {
namespace gles2 {