Skip to content

Commit

Permalink
Revert r118240 - gles_2_c_lib as a component.
Browse files Browse the repository at this point in the history
Broke compile on windows.

TBR=gman@chromium.org
BUG=107735
TEST=waterfall greens up again

Review URL: https://chromiumcodereview.appspot.com/9264003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118252 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dpranke@chromium.org committed Jan 19, 2012
1 parent e6aa469 commit 96fba19
Show file tree
Hide file tree
Showing 19 changed files with 44 additions and 99 deletions.
6 changes: 3 additions & 3 deletions gpu/command_buffer/build_gles2_cmd_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
_SIZE_OF_COMMAND_HEADER = 4
_FIRST_SPECIFIC_COMMAND_ID = 256

_LICENSE = """// Copyright (c) 2012 The Chromium Authors. All rights reserved.
_LICENSE = """// 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.
Expand Down Expand Up @@ -201,7 +201,7 @@
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenumBlitFilter filter);
GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenumRenderBufferTarget target, GLsizei samples, GLenumRenderBufferFormat internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenumTextureTarget target, GLsizei levels, GLenumTextureInternalFormatStorage internalFormat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenumTextureTarget target, GLsizei levels, GLintTextureInternalFormatStorage internalFormat, GLsizei width, GLsizei height);
// Non-GL commands.
GL_APICALL void GL_APIENTRY glSwapBuffers (void);
GL_APICALL GLuint GL_APIENTRY glGetMaxValueInBufferCHROMIUM (GLidBuffer buffer_id, GLsizei count, GLenumGetMaxIndexType type, GLuint offset);
Expand Down Expand Up @@ -6022,7 +6022,7 @@ def WriteGLES2CLibImplementation(self, filename):
"""Writes the GLES2 c lib implementation."""
file = CHeaderWriter(
filename,
"// These functions emulate GLES2 over command buffers.\n")
"// These functions emluate GLES2 over command buffers.\n")

for func in self.original_functions:
func.WriteGLES2CLibImplementation(file)
Expand Down
9 changes: 2 additions & 7 deletions gpu/command_buffer/client/gles2_c_lib.cc
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// 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.

// These functions emulate GLES2 over command buffers for C.
// These functions emluate GLES2 over command buffers for C.

#include <assert.h>
#include "../client/gles2_lib.h"

#ifndef GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES
#endif
#include <GLES2/gl2ext.h>

extern "C" {
// Include the auto-generated part of this file. We split this because it means
// we can easily edit the non-auto generated parts right here in this file
Expand Down
6 changes: 3 additions & 3 deletions gpu/command_buffer/client/gles2_c_lib_autogen.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// 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.

// This file is auto-generated from
// gpu/command_buffer/build_gles2_cmd_buffer.py
// DO NOT EDIT!

// These functions emulate GLES2 over command buffers.
// These functions emluate GLES2 over command buffers.
#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_C_LIB_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_CLIENT_GLES2_C_LIB_AUTOGEN_H_

Expand Down Expand Up @@ -515,7 +515,7 @@ void GLES2RenderbufferStorageMultisampleEXT(
target, samples, internalformat, width, height);
}
void GLES2TexStorage2DEXT(
GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width,
GLenum target, GLsizei levels, GLint internalFormat, GLsizei width,
GLsizei height) {
gles2::GetGLContext()->TexStorage2DEXT(
target, levels, internalFormat, width, height);
Expand Down
26 changes: 0 additions & 26 deletions gpu/command_buffer/client/gles2_c_lib_export.h

This file was deleted.

2 changes: 1 addition & 1 deletion gpu/command_buffer/client/gles2_cmd_helper_autogen.h
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@
}

void TexStorage2DEXT(
GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width,
GLenum target, GLsizei levels, GLint internalFormat, GLsizei width,
GLsizei height) {
gles2::TexStorage2DEXT* c = GetCmdSpace<gles2::TexStorage2DEXT>();
if (c) {
Expand Down
4 changes: 2 additions & 2 deletions gpu/command_buffer/client/gles2_implementation_autogen.h
Original file line number Diff line number Diff line change
Expand Up @@ -1390,10 +1390,10 @@ void RenderbufferStorageMultisampleEXT(
}

void TexStorage2DEXT(
GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width,
GLenum target, GLsizei levels, GLint internalFormat, GLsizei width,
GLsizei height) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << this << "] glTexStorage2DEXT(" << GLES2Util::GetStringTextureTarget(target) << ", " << levels << ", " << GLES2Util::GetStringTextureInternalFormatStorage(internalFormat) << ", " << width << ", " << height << ")"); // NOLINT
GPU_CLIENT_LOG("[" << this << "] glTexStorage2DEXT(" << GLES2Util::GetStringTextureTarget(target) << ", " << levels << ", " << internalFormat << ", " << width << ", " << height << ")"); // NOLINT
if (levels < 0) {
SetGLError(GL_INVALID_VALUE, "glTexStorage2DEXT: levels < 0");
return;
Expand Down
14 changes: 6 additions & 8 deletions gpu/command_buffer/client/gles2_lib.h
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright (c) 2009 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.

// These functions emulate GLES2 over command buffers.
// These functions emluate GLES2 over command buffers.

#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_
#define GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_

#include "gpu/command_buffer/client/gles2_c_lib_export.h"

#include "../client/gles2_implementation.h"

namespace gles2 {

// Initialize the GLES2 library.
GLES2_C_LIB_EXPORT void Initialize();
void Initialize();

// Terminate the GLES2 library.
GLES2_C_LIB_EXPORT void Terminate();
void Terminate();

// Get the current GL context.
GLES2_C_LIB_EXPORT gpu::gles2::GLES2Implementation* GetGLContext();
gpu::gles2::GLES2Implementation* GetGLContext();

// Set the current GL context.
GLES2_C_LIB_EXPORT void SetGLContext(gpu::gles2::GLES2Implementation* impl);
void SetGLContext(gpu::gles2::GLES2Implementation* impl);

} // namespace gles2

Expand Down
8 changes: 4 additions & 4 deletions gpu/command_buffer/common/gles2_cmd_format_autogen.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// 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.

Expand Down Expand Up @@ -8482,7 +8482,7 @@ struct TexStorage2DEXT {
}

void Init(
GLenum _target, GLsizei _levels, GLenum _internalFormat, GLsizei _width,
GLenum _target, GLsizei _levels, GLint _internalFormat, GLsizei _width,
GLsizei _height) {
SetHeader();
target = _target;
Expand All @@ -8493,7 +8493,7 @@ struct TexStorage2DEXT {
}

void* Set(
void* cmd, GLenum _target, GLsizei _levels, GLenum _internalFormat,
void* cmd, GLenum _target, GLsizei _levels, GLint _internalFormat,
GLsizei _width, GLsizei _height) {
static_cast<ValueType*>(
cmd)->Init(_target, _levels, _internalFormat, _width, _height);
Expand All @@ -8503,7 +8503,7 @@ struct TexStorage2DEXT {
gpu::CommandHeader header;
uint32 target;
int32 levels;
uint32 internalFormat;
int32 internalFormat;
int32 width;
int32 height;
};
Expand Down
6 changes: 3 additions & 3 deletions gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// 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.

Expand Down Expand Up @@ -3303,15 +3303,15 @@ TEST_F(GLES2FormatTest, TexStorage2DEXT) {
&cmd,
static_cast<GLenum>(11),
static_cast<GLsizei>(12),
static_cast<GLenum>(13),
static_cast<GLint>(13),
static_cast<GLsizei>(14),
static_cast<GLsizei>(15));
EXPECT_EQ(static_cast<uint32>(TexStorage2DEXT::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
EXPECT_EQ(static_cast<GLsizei>(12), cmd.levels);
EXPECT_EQ(static_cast<GLenum>(13), cmd.internalFormat);
EXPECT_EQ(static_cast<GLint>(13), cmd.internalFormat);
EXPECT_EQ(static_cast<GLsizei>(14), cmd.width);
EXPECT_EQ(static_cast<GLsizei>(15), cmd.height);
CheckBytesWrittenMatchesExpectedSize(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// 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.

Expand Down Expand Up @@ -205,7 +205,7 @@ static GLES2Util::EnumToString enum_to_string_table[] = {
{ 0x00000400, "GL_STENCIL_BUFFER_BIT", },
{ 0x800A, "GL_FUNC_SUBTRACT", },
{ 0x8E2C, "GL_DEPTH_COMPONENT16_NONLINEAR_NV", },
{ 0x8508, "GL_DECR_WRAP", },
{ 0x889F, "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", },
{ 0x8006, "GL_FUNC_ADD", },
{ 0x8007, "GL_MIN_EXT", },
{ 0x8004, "GL_ONE_MINUS_CONSTANT_ALPHA", },
Expand Down Expand Up @@ -465,7 +465,7 @@ static GLES2Util::EnumToString enum_to_string_table[] = {
{ 0x8CE4, "GL_COLOR_ATTACHMENT4_NV", },
{ 0x8CD6, "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT", },
{ 0x8872, "GL_MAX_TEXTURE_IMAGE_UNITS", },
{ 0x889F, "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", },
{ 0x8508, "GL_DECR_WRAP", },
{ 0x8507, "GL_INCR_WRAP", },
{ 0x8895, "GL_ELEMENT_ARRAY_BUFFER_BINDING", },
{ 0x8894, "GL_ARRAY_BUFFER_BINDING", },
Expand Down
7 changes: 4 additions & 3 deletions gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// 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.

Expand Down Expand Up @@ -2546,7 +2546,7 @@ error::Error GLES2DecoderImpl::HandleTexStorage2DEXT(
uint32 immediate_data_size, const gles2::TexStorage2DEXT& c) {
GLenum target = static_cast<GLenum>(c.target);
GLsizei levels = static_cast<GLsizei>(c.levels);
GLenum internalFormat = static_cast<GLenum>(c.internalFormat);
GLint internalFormat = static_cast<GLint>(c.internalFormat);
GLsizei width = static_cast<GLsizei>(c.width);
GLsizei height = static_cast<GLsizei>(c.height);
if (!validators_->texture_target.IsValid(target)) {
Expand All @@ -2559,7 +2559,8 @@ error::Error GLES2DecoderImpl::HandleTexStorage2DEXT(
}
if (!validators_->texture_internal_format_storage.IsValid(internalFormat)) {
SetGLError(
GL_INVALID_ENUM, "glTexStorage2DEXT: internalFormat GL_INVALID_ENUM");
GL_INVALID_VALUE,
"glTexStorage2DEXT: internalFormat GL_INVALID_VALUE");
return error::kNoError;
}
if (width < 0) {
Expand Down
3 changes: 1 addition & 2 deletions gpu/demos/demos.gyp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# 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.

Expand Down Expand Up @@ -41,7 +41,6 @@
'gpu_demo_framework',
'../gpu.gyp:command_buffer_client',
'../gpu.gyp:command_buffer_service',
'../gpu.gyp:gles2_implementation',
'../../base/base.gyp:base',
'../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../../ui/ui.gyp:ui',
Expand Down
3 changes: 1 addition & 2 deletions gpu/gles2_conform_support/gles2_conform_support.gyp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# 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.

Expand Down Expand Up @@ -31,7 +31,6 @@
'type': 'static_library',
'dependencies': [
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/gpu/gpu.gyp:gles2_implementation',
'<(DEPTH)/gpu/gpu.gyp:command_buffer_service',
],
'include_dirs': ['<(DEPTH)/third_party/khronos'],
Expand Down
15 changes: 2 additions & 13 deletions gpu/gpu.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
'gles2_c_lib_source_files': [
'command_buffer/client/gles2_c_lib.cc',
'command_buffer/client/gles2_c_lib_autogen.h',
'command_buffer/client/gles2_c_lib_export.h',
'command_buffer/client/gles2_lib.h',
'command_buffer/client/gles2_lib.cc',
],
Expand Down Expand Up @@ -142,15 +141,11 @@
# Stub to expose gles2_implemenation in C instead of C++.
# so GLES2 C programs can work with no changes.
'target_name': 'gles2_c_lib',
'type': '<(component)',
'type': 'static_library',
'dependencies': [
'../base/base.gyp:base',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'gles2_implementation',
],
'defines': [
'GLES2_C_LIB_IMPLEMENTATION',
],
'sources': [
'<@(gles2_c_lib_source_files)',
],
Expand All @@ -159,14 +154,11 @@
# Same as gles2_c_lib except with no parameter checking. Required for
# OpenGL ES 2.0 conformance tests.
'target_name': 'gles2_c_lib_nocheck',
'type': '<(component)',
'type': 'static_library',
'defines': [
'GLES2_C_LIB_IMPLEMENTATION',
'GLES2_CONFORMANCE_TESTS=1',
],
'dependencies': [
'../base/base.gyp:base',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'gles2_implementation_client_side_arrays_no_check',
],
'sources': [
Expand Down Expand Up @@ -297,9 +289,6 @@
'gles2_implementation_client_side_arrays',
'gles2_cmd_helper',
],
'defines': [
'GLES2_C_LIB_IMPLEMENTATION',
],
'sources': [
'<@(gles2_c_lib_source_files)',
'command_buffer/client/cmd_buffer_helper_test.cc',
Expand Down
3 changes: 1 addition & 2 deletions ppapi/ppapi_proxy.gypi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# 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.

Expand All @@ -10,7 +10,6 @@
'dependencies': [
'../base/base.gyp:base',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../gpu/gpu.gyp:gles2_implementation',
'../gpu/gpu.gyp:gpu_ipc',
'../ipc/ipc.gyp:ipc',
'../skia/skia.gyp:skia',
Expand Down
2 changes: 2 additions & 0 deletions third_party/khronos/GLES2/gl2.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ typedef khronos_ssize_t GLsizeiptr;
/*-------------------------------------------------------------------------
* GL core functions.
*-----------------------------------------------------------------------*/
#undef GL_APICALL
#define GL_APICALL
#undef GL_APIENTRY
#define GL_APIENTRY

Expand Down
2 changes: 1 addition & 1 deletion third_party/khronos/GLES2/gl2ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOCHROMIUM) ();
#ifdef GL_GLEXT_PROTOTYPES
#define glEnableFeatureCHROMIUM GLES2_GET_FUN(EnableFeatureCHROMIUM)
#if !defined(GLES2_USE_CPP_BINDINGS)
GL_APICALL GLboolean GL_APIENTRY glEnableFeatureCHROMIUM (const GLchar *feature);
GL_APICALL void GL_APIENTRY glEnableFeatureCHROMIUM (const GLchar *feature);
#endif
#else
typedef void (GL_APIENTRYP PFNGLENABLEFEATURECHROMIUM) (const GLchar *feature);
Expand Down
14 changes: 2 additions & 12 deletions third_party/khronos/GLES2/gl2platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,8 @@

#include <KHR/khrplatform.h>

#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(GLES2_C_LIB_IMPLEMENTATION)
#define GL_APICALL __declspec(dllexport)
#else
#define GL_APICALL __declspec(dllimport)
#endif /* defined(GLES2_C_LIB_IMPLEMENTATION) */
#else /* defined(WIN32) */
#define GL_APICALL __attribute__((visibility("default")))
#endif
#else
# define GL_APICALL
#ifndef GL_APICALL
#define GL_APICALL KHRONOS_APICALL
#endif

#ifndef GL_APIENTRY
Expand Down
Loading

0 comments on commit 96fba19

Please sign in to comment.