Commit a9fb79db authored by gman@chromium.org's avatar gman@chromium.org

Make GLES2Implementation based on GLES2Interface

GLES2Interface is a pure virutal interface. It's likely
that more functions of GLES2Implementation will need have
be declared in GLES2Interface but this is a first step

BUG=155914


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162216 0039d316-1c4b-4281-b951-d872f2087c98
parent c5531187
...@@ -3470,5 +3470,10 @@ void GLES2Implementation::PopGroupMarkerEXT() { ...@@ -3470,5 +3470,10 @@ void GLES2Implementation::PopGroupMarkerEXT() {
debug_marker_manager_.PopGroup(); debug_marker_manager_.PopGroup();
} }
// 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
// instead of having to edit some template or the code generator.
#include "../client/gles2_implementation_impl_autogen.h"
} // namespace gles2 } // namespace gles2
} // namespace gpu } // namespace gpu
...@@ -13,11 +13,13 @@ ...@@ -13,11 +13,13 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "../common/compiler_specific.h"
#include "../common/debug_marker_manager.h" #include "../common/debug_marker_manager.h"
#include "../common/gles2_cmd_utils.h" #include "../common/gles2_cmd_utils.h"
#include "../common/scoped_ptr.h" #include "../common/scoped_ptr.h"
#include "../client/ref_counted.h" #include "../client/ref_counted.h"
#include "../client/gles2_cmd_helper.h" #include "../client/gles2_cmd_helper.h"
#include "../client/gles2_interface.h"
#include "../client/query_tracker.h" #include "../client/query_tracker.h"
#include "../client/ring_buffer.h" #include "../client/ring_buffer.h"
#include "../client/share_group.h" #include "../client/share_group.h"
...@@ -98,7 +100,7 @@ class ClientSideBufferHelper; ...@@ -98,7 +100,7 @@ class ClientSideBufferHelper;
// be had by changing your code to use command buffers directly by using the // be had by changing your code to use command buffers directly by using the
// GLES2CmdHelper but that entails changing your code to use and deal with // GLES2CmdHelper but that entails changing your code to use and deal with
// shared memory and synchronization issues. // shared memory and synchronization issues.
class GLES2_IMPL_EXPORT GLES2Implementation { class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
public: public:
class ErrorMessageCallback { class ErrorMessageCallback {
public: public:
...@@ -180,7 +182,7 @@ class GLES2_IMPL_EXPORT GLES2Implementation { ...@@ -180,7 +182,7 @@ class GLES2_IMPL_EXPORT GLES2Implementation {
bool share_resources, bool share_resources,
bool bind_generates_resource); bool bind_generates_resource);
~GLES2Implementation(); virtual ~GLES2Implementation();
bool Initialize( bool Initialize(
unsigned int starting_transfer_buffer_size, unsigned int starting_transfer_buffer_size,
...@@ -199,10 +201,12 @@ class GLES2_IMPL_EXPORT GLES2Implementation { ...@@ -199,10 +201,12 @@ class GLES2_IMPL_EXPORT GLES2Implementation {
// this file instead of having to edit some template or the code generator. // this file instead of having to edit some template or the code generator.
#include "../client/gles2_implementation_autogen.h" #include "../client/gles2_implementation_autogen.h"
void DisableVertexAttribArray(GLuint index); virtual void DisableVertexAttribArray(GLuint index) OVERRIDE;
void EnableVertexAttribArray(GLuint index); virtual void EnableVertexAttribArray(GLuint index) OVERRIDE;
void GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params); virtual void GetVertexAttribfv(
void GetVertexAttribiv(GLuint index, GLenum pname, GLint* params); GLuint index, GLenum pname, GLfloat* params) OVERRIDE;
virtual void GetVertexAttribiv(
GLuint index, GLenum pname, GLint* params) OVERRIDE;
void GetProgramInfoCHROMIUMHelper(GLuint program, std::vector<int8>* result); void GetProgramInfoCHROMIUMHelper(GLuint program, std::vector<int8>* result);
GLint GetAttribLocationHelper(GLuint program, const char* name); GLint GetAttribLocationHelper(GLuint program, const char* name);
......
This diff is collapsed.
// Copyright (c) 2012 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 "../client/gles2_interface.h"
namespace gpu {
namespace gles2 {
GLES2Interface::GLES2Interface() {
}
GLES2Interface::~GLES2Interface() {
}
} // namespace gles2
} // namespace gpu
// Copyright (c) 2012 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 GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_H_
#define GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_H_
#include <GLES2/gl2.h>
#include "gles2_impl_export.h"
namespace gpu {
namespace gles2 {
// This class is the interface for all client side GL functions.
class GLES2_IMPL_EXPORT GLES2Interface {
public:
GLES2Interface();
virtual ~GLES2Interface();
// Include the auto-generated part of this class. We split this because
// it means we can easily edit the non-auto generated parts right here in
// this file instead of having to edit some template or the code generator.
#include "../client/gles2_interface_autogen.h"
};
} // namespace gles2
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_H_
This diff is collapsed.
// Copyright (c) 2012 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 "gpu/command_buffer/client/gles2_interface_stub.h"
namespace gpu {
namespace gles2 {
GLES2InterfaceStub::GLES2InterfaceStub() {
}
GLES2InterfaceStub::~GLES2InterfaceStub() {
}
// Include the auto-generated part of this class. We split this because
// it means we can easily edit the non-auto generated parts right here in
// this file instead of having to edit some template or the code generator.
#include "gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h"
} // namespace gles2
} // namespace gpu
// Copyright (c) 2012 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 GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_H_
#define GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_H_
#include "gpu/command_buffer/common/compiler_specific.h"
#include "gpu/command_buffer/client/gles2_interface.h"
namespace gpu {
namespace gles2 {
// This class a stub to help with mocks for the GLES2Interface class.
class GLES2InterfaceStub : public GLES2Interface {
public:
GLES2InterfaceStub();
virtual ~GLES2InterfaceStub();
// Include the auto-generated part of this class. We split this because
// it means we can easily edit the non-auto generated parts right here in
// this file instead of having to edit some template or the code generator.
#include "gpu/command_buffer/client/gles2_interface_stub_autogen.h"
};
} // namespace gles2
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_H_
This diff is collapsed.
This diff is collapsed.
...@@ -74,6 +74,8 @@ static GLES2Util::EnumToString enum_to_string_table[] = { ...@@ -74,6 +74,8 @@ static GLES2Util::EnumToString enum_to_string_table[] = {
{ 0x88BB, "GL_BUFFER_ACCESS_OES", }, { 0x88BB, "GL_BUFFER_ACCESS_OES", },
{ 0x88BC, "GL_BUFFER_MAPPED_OES", }, { 0x88BC, "GL_BUFFER_MAPPED_OES", },
{ 0x88BD, "GL_BUFFER_MAP_POINTER_OES", }, { 0x88BD, "GL_BUFFER_MAP_POINTER_OES", },
{ 0x904A, "GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX", },
{ 0x904B, "GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX", },
{ 0x0C10, "GL_SCISSOR_BOX", }, { 0x0C10, "GL_SCISSOR_BOX", },
{ 0x0C11, "GL_SCISSOR_TEST", }, { 0x0C11, "GL_SCISSOR_TEST", },
{ 0x80000000, "GL_MULTISAMPLE_BUFFER_BIT7_QCOM", }, { 0x80000000, "GL_MULTISAMPLE_BUFFER_BIT7_QCOM", },
...@@ -113,6 +115,9 @@ static GLES2Util::EnumToString enum_to_string_table[] = { ...@@ -113,6 +115,9 @@ static GLES2Util::EnumToString enum_to_string_table[] = {
{ 0x8D40, "GL_FRAMEBUFFER", }, { 0x8D40, "GL_FRAMEBUFFER", },
{ 0x8D41, "GL_RENDERBUFFER", }, { 0x8D41, "GL_RENDERBUFFER", },
{ 0x0BD0, "GL_DITHER", }, { 0x0BD0, "GL_DITHER", },
{ 0x9047, "GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX", },
{ 0x9049, "GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX", },
{ 0x9048, "GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX", },
{ 0x1801, "GL_DEPTH_EXT", }, { 0x1801, "GL_DEPTH_EXT", },
{ 0x1800, "GL_COLOR_EXT", }, { 0x1800, "GL_COLOR_EXT", },
{ 0x1802, "GL_STENCIL_EXT", }, { 0x1802, "GL_STENCIL_EXT", },
......
...@@ -149,6 +149,8 @@ ...@@ -149,6 +149,8 @@
'command_buffer/client/client_test_helper.h', 'command_buffer/client/client_test_helper.h',
'command_buffer/client/cmd_buffer_helper_test.cc', 'command_buffer/client/cmd_buffer_helper_test.cc',
'command_buffer/client/fenced_allocator_test.cc', 'command_buffer/client/fenced_allocator_test.cc',
'command_buffer/client/gles2_interface_stub.cc',
'command_buffer/client/gles2_interface_stub.h',
'command_buffer/client/gles2_implementation_unittest.cc', 'command_buffer/client/gles2_implementation_unittest.cc',
'command_buffer/client/mapped_memory_unittest.cc', 'command_buffer/client/mapped_memory_unittest.cc',
'command_buffer/client/query_tracker_unittest.cc', 'command_buffer/client/query_tracker_unittest.cc',
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
'command_buffer/client/gles2_implementation_autogen.h', 'command_buffer/client/gles2_implementation_autogen.h',
'command_buffer/client/gles2_implementation.cc', 'command_buffer/client/gles2_implementation.cc',
'command_buffer/client/gles2_implementation.h', 'command_buffer/client/gles2_implementation.h',
'command_buffer/client/gles2_implementation_impl_autogen.h',
'command_buffer/client/gles2_interface.h',
'command_buffer/client/gles2_interface.cc',
'command_buffer/client/program_info_manager.cc', 'command_buffer/client/program_info_manager.cc',
'command_buffer/client/program_info_manager.h', 'command_buffer/client/program_info_manager.h',
'command_buffer/client/query_tracker.cc', 'command_buffer/client/query_tracker.cc',
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
'<(DEPTH)/gpu/command_buffer/client/gles2_c_lib.cc', '<(DEPTH)/gpu/command_buffer/client/gles2_c_lib.cc',
'<(DEPTH)/gpu/command_buffer/client/gles2_cmd_helper.cc', '<(DEPTH)/gpu/command_buffer/client/gles2_cmd_helper.cc',
'<(DEPTH)/gpu/command_buffer/client/gles2_implementation.cc', '<(DEPTH)/gpu/command_buffer/client/gles2_implementation.cc',
'<(DEPTH)/gpu/command_buffer/client/gles2_interface.cc',
'<(DEPTH)/gpu/command_buffer/client/program_info_manager.cc', '<(DEPTH)/gpu/command_buffer/client/program_info_manager.cc',
'<(DEPTH)/gpu/command_buffer/client/transfer_buffer.cc', '<(DEPTH)/gpu/command_buffer/client/transfer_buffer.cc',
'<(DEPTH)/gpu/command_buffer/client/gles2_lib.cc', '<(DEPTH)/gpu/command_buffer/client/gles2_lib.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment