summaryrefslogtreecommitdiffstats
path: root/ui/gl/gl_gl_api_implementation.cc
diff options
context:
space:
mode:
authorcaseq@google.com <caseq@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-07 14:09:20 +0000
committercaseq@google.com <caseq@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-07 14:09:20 +0000
commit632c8e173cd423e6f2af156fc7d9c0b33c89909a (patch)
tree9a42c9d1c3718a3bd90dba6f9277e164d9a5e1a2 /ui/gl/gl_gl_api_implementation.cc
parent593e0102a007ef2375f1f5769e51df4225bbbee5 (diff)
downloadchromium_src-632c8e173cd423e6f2af156fc7d9c0b33c89909a.zip
chromium_src-632c8e173cd423e6f2af156fc7d9c0b33c89909a.tar.gz
chromium_src-632c8e173cd423e6f2af156fc7d9c0b33c89909a.tar.bz2
Revert "Revert "Revert 198403 "Move WrappedTexImage functionality to ui/gl"""
This broke accelerated compositing on Mac, effectively making default configuration unusable for all sites. TBR=gman BUG=238581 Review URL: https://codereview.chromium.org/14580015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198718 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl/gl_gl_api_implementation.cc')
-rw-r--r--ui/gl/gl_gl_api_implementation.cc100
1 files changed, 0 insertions, 100 deletions
diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc
index b8d8c5c..303ae1d 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -10,7 +10,6 @@
#include "base/command_line.h"
#include "base/string_util.h"
#include "ui/gl/gl_context.h"
-#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_state_restorer.h"
#include "ui/gl/gl_surface.h"
#include "ui/gl/gl_switches.h"
@@ -100,105 +99,6 @@ void RealGLApi::Initialize(DriverGL* driver) {
InitializeBase(driver);
}
-static inline GLenum GetTexInternalFormat(GLenum internal_format) {
- if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) {
- if (internal_format == GL_BGRA_EXT || internal_format == GL_BGRA8_EXT)
- return GL_RGBA8;
- }
- return internal_format;
-}
-
-// TODO(epenner): Could the above function be merged into this and removed?
-static inline GLenum GetTexInternalFormat(GLenum internal_format,
- GLenum format,
- GLenum type) {
- GLenum gl_internal_format = GetTexInternalFormat(internal_format);
-
- if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2)
- return gl_internal_format;
-
- if (type == GL_FLOAT) {
- switch (format) {
- case GL_RGBA:
- gl_internal_format = GL_RGBA32F_ARB;
- break;
- case GL_RGB:
- gl_internal_format = GL_RGB32F_ARB;
- break;
- case GL_LUMINANCE_ALPHA:
- gl_internal_format = GL_LUMINANCE_ALPHA32F_ARB;
- break;
- case GL_LUMINANCE:
- gl_internal_format = GL_LUMINANCE32F_ARB;
- break;
- case GL_ALPHA:
- gl_internal_format = GL_ALPHA32F_ARB;
- break;
- default:
- NOTREACHED();
- break;
- }
- } else if (type == GL_HALF_FLOAT_OES) {
- switch (format) {
- case GL_RGBA:
- gl_internal_format = GL_RGBA16F_ARB;
- break;
- case GL_RGB:
- gl_internal_format = GL_RGB16F_ARB;
- break;
- case GL_LUMINANCE_ALPHA:
- gl_internal_format = GL_LUMINANCE_ALPHA16F_ARB;
- break;
- case GL_LUMINANCE:
- gl_internal_format = GL_LUMINANCE16F_ARB;
- break;
- case GL_ALPHA:
- gl_internal_format = GL_ALPHA16F_ARB;
- break;
- default:
- NOTREACHED();
- break;
- }
- }
- return gl_internal_format;
-}
-
-static inline GLenum GetTexType(GLenum type) {
- if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) {
- if (type == GL_HALF_FLOAT_OES)
- return GL_HALF_FLOAT_ARB;
- }
- return type;
-}
-
-void RealGLApi::glTexImage2DFn(
- GLenum target, GLint level, GLint internalformat,
- GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type,
- const void* pixels) {
- GLenum gl_internal_format = GetTexInternalFormat(
- internalformat, format, type);
- GLenum gl_type = GetTexType(type);
- return driver_->fn.glTexImage2DFn(
- target, level, gl_internal_format, width, height, border, format, gl_type,
- pixels);
-}
-
-void RealGLApi::glTexSubImage2DFn(
- GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
- GLsizei height, GLenum format, GLenum type, const void* pixels) {
- GLenum gl_type = GetTexType(type);
- return driver_->fn.glTexSubImage2DFn(
- target, level, xoffset, yoffset, width, height, format, gl_type, pixels);
-}
-
-void RealGLApi::glTexStorage2DEXTFn(
- GLenum target, GLsizei levels, GLenum internalformat, GLsizei width,
- GLsizei height) {
- GLenum gl_internal_format = GetTexInternalFormat(internalformat);
- return driver_->fn.glTexStorage2DEXTFn(
- target, levels, gl_internal_format, width, height);
-}
-
TraceGLApi::~TraceGLApi() {
}