diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-02 19:45:52 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-02 19:45:52 +0000 |
commit | aa766612f25b5211ac65f40a19afe09d45c07c9a (patch) | |
tree | e404e96c940225c31b759df1227e475e4133a689 /gpu | |
parent | 180096e984be38d99d04f0036408a3ffd077210e (diff) | |
download | chromium_src-aa766612f25b5211ac65f40a19afe09d45c07c9a.zip chromium_src-aa766612f25b5211ac65f40a19afe09d45c07c9a.tar.gz chromium_src-aa766612f25b5211ac65f40a19afe09d45c07c9a.tar.bz2 |
Remove support for switching draw surfaces on a context.This was originally intended to share canvas "back buffers" between the GPU process and the browser process. The plan is to issue all the GL calls in the GPU process now, with the browser process just doing the final present. Removing the redundant code.
Review URL: http://codereview.chromium.org/7701021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99424 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
27 files changed, 64 insertions, 251 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index 7268091..90ff54a 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -217,12 +217,12 @@ GL_APICALL void GL_APIENTRY glResizeCHROMIUM (GLuint width, GLuint heigh GL_APICALL const GLchar* GL_APIENTRY glGetRequestableExtensionsCHROMIUM (void); GL_APICALL void GL_APIENTRY glRequestExtensionCHROMIUM (const char* extension); GL_APICALL void GL_APIENTRY glRateLimitOffscreenContextCHROMIUM (void); -GL_APICALL void GL_APIENTRY glSetSurfaceCHROMIUM (GLint surface_id); GL_APICALL void GL_APIENTRY glGetMultipleIntegervCHROMIUM (const GLenum* pnames, GLuint count, GLint* results, GLsizeiptr size); GL_APICALL void GL_APIENTRY glGetProgramInfoCHROMIUM (GLidProgram program, GLsizeiNotNegative bufsize, GLsizei* size, void* info); GL_APICALL void GL_APIENTRY glPlaceholder447CHROMIUM (void); GL_APICALL void GL_APIENTRY glPlaceholder451CHROMIUM (void); GL_APICALL void GL_APIENTRY glPlaceholder452CHROMIUM (void); +GL_APICALL void GL_APIENTRY glPlaceholder453CHROMIUM (void); """ # This is the list of all commmands that will be generated and their Id. @@ -428,7 +428,7 @@ _CMD_ID_TABLE = { 'RequestExtensionCHROMIUM': 450, 'Placeholder451CHROMIUM': 451, 'Placeholder452CHROMIUM': 452, - 'SetSurfaceCHROMIUM': 453, + 'Placeholder453CHROMIUM': 453, 'GetMultipleIntegervCHROMIUM': 454, 'GetProgramInfoCHROMIUM': 455, } @@ -1547,12 +1547,6 @@ _FUNCTION_INFO = { 'decoder_func': 'DoReleaseShaderCompiler', 'unit_test': False, }, - 'SetSurfaceCHROMIUM': { - 'decoder_func': 'DoSetSurfaceCHROMIUM', - 'extension': True, - 'chromium': True, - 'unit_test': False, - }, 'ShaderBinary': {'type': 'Custom'}, 'ShaderSource': { 'type': 'Manual', @@ -1763,6 +1757,9 @@ _FUNCTION_INFO = { 'Placeholder452CHROMIUM': { 'type': 'UnknownCommand', }, + 'Placeholder453CHROMIUM': { + 'type': 'UnknownCommand', + }, } diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h index 6e2dd2b..4ba96ac 100644 --- a/gpu/command_buffer/client/gles2_c_lib_autogen.h +++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h @@ -566,9 +566,6 @@ void GLES2RequestExtensionCHROMIUM(const char* extension) { void GLES2RateLimitOffscreenContextCHROMIUM() { gles2::GetGLContext()->RateLimitOffscreenContextCHROMIUM(); } -void GLES2SetSurfaceCHROMIUM(GLint surface_id) { - gles2::GetGLContext()->SetSurfaceCHROMIUM(surface_id); -} void GLES2GetMultipleIntegervCHROMIUM( const GLenum* pnames, GLuint count, GLint* results, GLsizeiptr size) { gles2::GetGLContext()->GetMultipleIntegervCHROMIUM( diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h index d6d1654..384f4ac 100644 --- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h +++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h @@ -1212,11 +1212,6 @@ c.Init(bucket_id); } - void SetSurfaceCHROMIUM(GLint surface_id) { - gles2::SetSurfaceCHROMIUM& c = GetCmdSpace<gles2::SetSurfaceCHROMIUM>(); - c.Init(surface_id); - } - void GetMultipleIntegervCHROMIUM( uint32 pnames_shm_id, uint32 pnames_shm_offset, GLuint count, uint32 results_shm_id, uint32 results_shm_offset, GLsizeiptr size) { diff --git a/gpu/command_buffer/client/gles2_demo.cc b/gpu/command_buffer/client/gles2_demo.cc index 66e9026..72937d5 100644 --- a/gpu/command_buffer/client/gles2_demo.cc +++ b/gpu/command_buffer/client/gles2_demo.cc @@ -66,7 +66,6 @@ bool GLES2Demo::Setup(void* hwnd, int32 size) { gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(true)); GpuScheduler* gpu_scheduler = GpuScheduler::Create(command_buffer.get(), - NULL, group.get()); if (!gpu_scheduler->Initialize(reinterpret_cast<HWND>(hwnd), gfx::Size(), diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h index 021e3e9..b6d2278 100644 --- a/gpu/command_buffer/client/gles2_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_autogen.h @@ -1262,11 +1262,6 @@ void RequestExtensionCHROMIUM(const char* extension); void RateLimitOffscreenContextCHROMIUM(); -void SetSurfaceCHROMIUM(GLint surface_id) { - GPU_CLIENT_LOG("[" << this << "] glSetSurfaceCHROMIUM(" << surface_id << ")"); - helper_->SetSurfaceCHROMIUM(surface_id); -} - void GetMultipleIntegervCHROMIUM( const GLenum* pnames, GLuint count, GLint* results, GLsizeiptr size); diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h index 59df77d..0c29aa7 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h @@ -8873,40 +8873,6 @@ COMPILE_ASSERT(offsetof(RequestExtensionCHROMIUM, header) == 0, COMPILE_ASSERT(offsetof(RequestExtensionCHROMIUM, bucket_id) == 4, OffsetOf_RequestExtensionCHROMIUM_bucket_id_not_4); -struct SetSurfaceCHROMIUM { - typedef SetSurfaceCHROMIUM ValueType; - static const CommandId kCmdId = kSetSurfaceCHROMIUM; - static const cmd::ArgFlags kArgFlags = cmd::kFixed; - - static uint32 ComputeSize() { - return static_cast<uint32>(sizeof(ValueType)); // NOLINT - } - - void SetHeader() { - header.SetCmd<ValueType>(); - } - - void Init(GLint _surface_id) { - SetHeader(); - surface_id = _surface_id; - } - - void* Set(void* cmd, GLint _surface_id) { - static_cast<ValueType*>(cmd)->Init(_surface_id); - return NextCmdAddress<ValueType>(cmd); - } - - gpu::CommandHeader header; - int32 surface_id; -}; - -COMPILE_ASSERT(sizeof(SetSurfaceCHROMIUM) == 8, - Sizeof_SetSurfaceCHROMIUM_is_not_8); -COMPILE_ASSERT(offsetof(SetSurfaceCHROMIUM, header) == 0, - OffsetOf_SetSurfaceCHROMIUM_header_not_0); -COMPILE_ASSERT(offsetof(SetSurfaceCHROMIUM, surface_id) == 4, - OffsetOf_SetSurfaceCHROMIUM_surface_id_not_4); - struct GetMultipleIntegervCHROMIUM { typedef GetMultipleIntegervCHROMIUM ValueType; static const CommandId kCmdId = kGetMultipleIntegervCHROMIUM; @@ -9109,6 +9075,36 @@ COMPILE_ASSERT(sizeof(Placeholder452CHROMIUM) == 4, COMPILE_ASSERT(offsetof(Placeholder452CHROMIUM, header) == 0, OffsetOf_Placeholder452CHROMIUM_header_not_0); +struct Placeholder453CHROMIUM { + typedef Placeholder453CHROMIUM ValueType; + static const CommandId kCmdId = kPlaceholder453CHROMIUM; + static const cmd::ArgFlags kArgFlags = cmd::kFixed; + + static uint32 ComputeSize() { + return static_cast<uint32>(sizeof(ValueType)); // NOLINT + } + + void SetHeader() { + header.SetCmd<ValueType>(); + } + + void Init() { + SetHeader(); + } + + void* Set(void* cmd) { + static_cast<ValueType*>(cmd)->Init(); + return NextCmdAddress<ValueType>(cmd); + } + + gpu::CommandHeader header; +}; + +COMPILE_ASSERT(sizeof(Placeholder453CHROMIUM) == 4, + Sizeof_Placeholder453CHROMIUM_is_not_4); +COMPILE_ASSERT(offsetof(Placeholder453CHROMIUM, header) == 0, + OffsetOf_Placeholder453CHROMIUM_header_not_0); + #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_ diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h index 66e45ae..e10a7fe 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h @@ -3495,19 +3495,6 @@ TEST(GLES2FormatTest, RequestExtensionCHROMIUM) { EXPECT_EQ(static_cast<uint32>(11), cmd.bucket_id); } -TEST(GLES2FormatTest, SetSurfaceCHROMIUM) { - SetSurfaceCHROMIUM cmd = { { 0 } }; - void* next_cmd = cmd.Set( - &cmd, - static_cast<GLint>(11)); - EXPECT_EQ(static_cast<uint32>(SetSurfaceCHROMIUM::kCmdId), - cmd.header.command); - EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); - EXPECT_EQ(static_cast<char*>(next_cmd), - reinterpret_cast<char*>(&cmd) + sizeof(cmd)); - EXPECT_EQ(static_cast<GLint>(11), cmd.surface_id); -} - TEST(GLES2FormatTest, GetMultipleIntegervCHROMIUM) { GetMultipleIntegervCHROMIUM cmd = { { 0 } }; void* next_cmd = cmd.Set( @@ -3579,5 +3566,16 @@ TEST(GLES2FormatTest, Placeholder452CHROMIUM) { reinterpret_cast<char*>(&cmd) + sizeof(cmd)); } +TEST(GLES2FormatTest, Placeholder453CHROMIUM) { + Placeholder453CHROMIUM cmd = { { 0 } }; + void* next_cmd = cmd.Set( + &cmd); + EXPECT_EQ(static_cast<uint32>(Placeholder453CHROMIUM::kCmdId), + cmd.header.command); + EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); + EXPECT_EQ(static_cast<char*>(next_cmd), + reinterpret_cast<char*>(&cmd) + sizeof(cmd)); +} + #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ diff --git a/gpu/command_buffer/common/gles2_cmd_id_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_id_test_autogen.h index 5d3ceb4..cae5339 100644 --- a/gpu/command_buffer/common/gles2_cmd_id_test_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_id_test_autogen.h @@ -401,8 +401,6 @@ TEST(GLES2CommandIdTest, CommandIdsMatch) { GLES2_GetRequestableExtensionsCHROMIUM_kCmdId_mismatch); COMPILE_ASSERT(RequestExtensionCHROMIUM::kCmdId == 450, GLES2_RequestExtensionCHROMIUM_kCmdId_mismatch); - COMPILE_ASSERT(SetSurfaceCHROMIUM::kCmdId == 453, - GLES2_SetSurfaceCHROMIUM_kCmdId_mismatch); COMPILE_ASSERT(GetMultipleIntegervCHROMIUM::kCmdId == 454, GLES2_GetMultipleIntegervCHROMIUM_kCmdId_mismatch); COMPILE_ASSERT(GetProgramInfoCHROMIUM::kCmdId == 455, diff --git a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h index 910302b..1063edf 100644 --- a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h @@ -207,7 +207,7 @@ OP(RequestExtensionCHROMIUM) /* 450 */ \ OP(Placeholder451CHROMIUM) /* 451 */ \ OP(Placeholder452CHROMIUM) /* 452 */ \ - OP(SetSurfaceCHROMIUM) /* 453 */ \ + OP(Placeholder453CHROMIUM) /* 453 */ \ OP(GetMultipleIntegervCHROMIUM) /* 454 */ \ OP(GetProgramInfoCHROMIUM) /* 455 */ \ diff --git a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h index b74a318..559fe88 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h @@ -179,7 +179,7 @@ static GLES2Util::EnumToString enum_to_string_table[] = { { 0x00000400, "GL_STENCIL_BUFFER_BIT", }, { 0x800A, "GL_FUNC_SUBTRACT", }, { 0x8E2C, "GL_DEPTH_COMPONENT16_NONLINEAR_NV", }, - { 0x889F, "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", }, + { 0x8508, "GL_DECR_WRAP", }, { 0x8006, "GL_FUNC_ADD", }, { 0x8007, "GL_MIN_EXT", }, { 0x8004, "GL_ONE_MINUS_CONSTANT_ALPHA", }, @@ -408,7 +408,7 @@ static GLES2Util::EnumToString enum_to_string_table[] = { { 0x80CA, "GL_BLEND_DST_ALPHA", }, { 0x8CD6, "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT", }, { 0x8872, "GL_MAX_TEXTURE_IMAGE_UNITS", }, - { 0x8508, "GL_DECR_WRAP", }, + { 0x889F, "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", }, { 0x8507, "GL_INCR_WRAP", }, { 0x8895, "GL_ELEMENT_ARRAY_BUFFER_BINDING", }, { 0x8894, "GL_ARRAY_BUFFER_BINDING", }, diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 923cfae..d6e8cfd 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -34,7 +34,6 @@ #include "gpu/command_buffer/service/renderbuffer_manager.h" #include "gpu/command_buffer/service/shader_manager.h" #include "gpu/command_buffer/service/shader_translator.h" -#include "gpu/command_buffer/service/surface_manager.h" #include "gpu/command_buffer/service/texture_manager.h" #include "gpu/command_buffer/service/vertex_attrib_manager.h" #include "ui/gfx/gl/gl_context.h" @@ -448,7 +447,7 @@ GLES2Decoder::~GLES2Decoder() { class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, public GLES2Decoder { public: - GLES2DecoderImpl(SurfaceManager* surface_manager, ContextGroup* group); + explicit GLES2DecoderImpl(ContextGroup* group); // Overridden from AsyncAPIInterface. virtual Error DoCommand(unsigned int command, @@ -1038,8 +1037,6 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, // Wrapper for glValidateProgram. void DoValidateProgram(GLuint program_client_id); - void DoSetSurfaceCHROMIUM(GLint surface_id); - // Gets the number of values that will be returned by glGetXXX. Returns // false if pname is unknown. bool GetNumValuesReturnedForGLGet(GLenum pname, GLsizei* num_values); @@ -1168,9 +1165,6 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, #undef GLES2_CMD_OP - // Maps surface IDs to GLSurface. - gpu::SurfaceManager* surface_manager_; - // The GL context this decoder renders to on behalf of the client. scoped_refptr<gfx::GLSurface> surface_; scoped_refptr<gfx::GLContext> context_; @@ -1636,15 +1630,12 @@ GLenum FrameBuffer::CheckStatus() { return glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); } -GLES2Decoder* GLES2Decoder::Create(SurfaceManager* surface_manager, - ContextGroup* group) { - return new GLES2DecoderImpl(surface_manager, group); +GLES2Decoder* GLES2Decoder::Create(ContextGroup* group) { + return new GLES2DecoderImpl(group); } -GLES2DecoderImpl::GLES2DecoderImpl(SurfaceManager* surface_manager, - ContextGroup* group) +GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group) : GLES2Decoder(), - surface_manager_(surface_manager), group_(group), error_bits_(0), pack_alignment_(4), @@ -2558,14 +2549,6 @@ error::Error GLES2DecoderImpl::HandleResizeCHROMIUM( return error::kNoError; } -void GLES2DecoderImpl::DoSetSurfaceCHROMIUM(GLint surface_id) { - gfx::GLSurface* surface = surface_manager_->LookupSurface(surface_id); - if (!surface) - return; - - surface_ = surface; -} - const char* GLES2DecoderImpl::GetCommandName(unsigned int command_id) const { if (command_id > kStartPoint && command_id < kNumCommands) { return gles2::GetCommandName(static_cast<CommandId>(command_id)); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h index 5995d4b..35ad67d 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder.h @@ -42,8 +42,7 @@ class GLES2Decoder : public CommonDecoder { typedef error::Error Error; // Creates a decoder. - static GLES2Decoder* Create(SurfaceManager* surface_manager, - ContextGroup* group); + static GLES2Decoder* Create(ContextGroup* group); virtual ~GLES2Decoder(); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h index 27ef39b..2fb68fe 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h @@ -2568,13 +2568,6 @@ error::Error GLES2DecoderImpl::HandleGetMaxValueInBufferCHROMIUM( return error::kNoError; } -error::Error GLES2DecoderImpl::HandleSetSurfaceCHROMIUM( - uint32 immediate_data_size, const gles2::SetSurfaceCHROMIUM& c) { - GLint surface_id = static_cast<GLint>(c.surface_id); - DoSetSurfaceCHROMIUM(surface_id); - return error::kNoError; -} - error::Error GLES2DecoderImpl::HandlePlaceholder447CHROMIUM( uint32 immediate_data_size, const gles2::Placeholder447CHROMIUM& c) { return error::kUnknownCommand; @@ -2587,5 +2580,9 @@ error::Error GLES2DecoderImpl::HandlePlaceholder452CHROMIUM( uint32 immediate_data_size, const gles2::Placeholder452CHROMIUM& c) { return error::kUnknownCommand; } +error::Error GLES2DecoderImpl::HandlePlaceholder453CHROMIUM( + uint32 immediate_data_size, const gles2::Placeholder453CHROMIUM& c) { + return error::kUnknownCommand; +} #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc index cf648fd..3081ac9 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc @@ -2894,45 +2894,6 @@ TEST_F(GLES2DecoderWithShaderTest, VertexAttribPointer) { } } -TEST_F(GLES2DecoderTest, SetSurfaceCHROMIUMChangesSurfaceForExistentSurface) { - const int kSurfaceId = 1; - scoped_refptr<gfx::GLSurfaceStub> surface(new gfx::GLSurfaceStub); - - EXPECT_CALL(*surface_manager_.get(), LookupSurface(kSurfaceId)) - .WillOnce(Return(surface.get())) - .RetiresOnSaturation(); - - SetSurfaceCHROMIUM cmd; - cmd.Init(kSurfaceId); - EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); - - EXPECT_EQ(surface.get(), decoder_->GetGLSurface()); -} - -TEST_F(GLES2DecoderTest, - SetSurfaceCHROMIUMDoesNotChangeSurfaceWhenSurfaceDoesNotExist) { - const int kExistentSurfaceId = 1; - const int kNonexistentSurfaceId = 2; - scoped_refptr<gfx::GLSurfaceStub> surface(new gfx::GLSurfaceStub); - - EXPECT_CALL(*surface_manager_.get(), LookupSurface(kExistentSurfaceId)) - .WillOnce(Return(surface.get())) - .RetiresOnSaturation(); - - EXPECT_CALL(*surface_manager_.get(), LookupSurface(kNonexistentSurfaceId)) - .WillOnce(Return(static_cast<gfx::GLSurface*>(NULL))) - .RetiresOnSaturation(); - - SetSurfaceCHROMIUM cmd; - cmd.Init(kExistentSurfaceId); - EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); - - cmd.Init(kNonexistentSurfaceId); - EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); - - EXPECT_EQ(surface.get(), decoder_->GetGLSurface()); -} - // Test that with an RGB backbuffer if we set the color mask to 1,1,1,1 it is // set to 1,1,1,0 at Draw time but is 1,1,1,1 at query time. TEST_F(GLES2DecoderRGBBackbufferTest, RGBBackbufferColorMask) { diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h index 1206925..a94aff6 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h @@ -1711,8 +1711,9 @@ TEST_F(GLES2DecoderTest2, ViewportInvalidArgs3_0) { // TODO(gman): RequestExtensionCHROMIUM -// TODO(gman): SetSurfaceCHROMIUM // TODO(gman): GetMultipleIntegervCHROMIUM +// TODO(gman): GetProgramInfoCHROMIUM + #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_ diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h index 80f5bc3..ce9cc45 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h @@ -10,7 +10,5 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_ #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_ -// TODO(gman): GetProgramInfoCHROMIUM - #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_ diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc index d20daa9..eb69e87 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc @@ -70,7 +70,6 @@ void GLES2DecoderTestBase::InitDecoder( bool bind_generates_resource) { gl_.reset(new StrictMock<MockGLInterface>()); ::gfx::GLInterface::SetGLInterface(gl_.get()); - surface_manager_.reset(new StrictMock<MockSurfaceManager>); group_ = ContextGroup::Ref(new ContextGroup(bind_generates_resource)); InSequence sequence; @@ -181,7 +180,7 @@ void GLES2DecoderTestBase::InitDecoder( }; std::vector<int32> attribs(attributes, attributes + arraysize(attributes)); - decoder_.reset(GLES2Decoder::Create(surface_manager_.get(), group_.get())); + decoder_.reset(GLES2Decoder::Create(group_.get())); decoder_->Initialize( surface_, context_, surface_->GetSize(), DisallowedExtensions(), NULL, attribs); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h index be2ba02..c3e0dd8 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h @@ -16,7 +16,6 @@ #include "gpu/command_buffer/service/program_manager.h" #include "gpu/command_buffer/service/renderbuffer_manager.h" #include "gpu/command_buffer/service/shader_manager.h" -#include "gpu/command_buffer/service/surface_manager_mock.h" #include "gpu/command_buffer/service/texture_manager.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/gl/gl_context_stub.h" @@ -276,7 +275,6 @@ class GLES2DecoderTestBase : public testing::Test { scoped_refptr<gfx::GLSurfaceStub> surface_; scoped_refptr<gfx::GLContextStub> context_; scoped_ptr<GLES2Decoder> decoder_; - scoped_ptr<MockSurfaceManager> surface_manager_; GLuint client_buffer_id_; GLuint client_framebuffer_id_; diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc index c4505a5..70f84a4 100644 --- a/gpu/command_buffer/service/gpu_scheduler.cc +++ b/gpu/command_buffer/service/gpu_scheduler.cc @@ -20,12 +20,10 @@ using ::base::SharedMemory; namespace gpu { GpuScheduler* GpuScheduler::Create(CommandBuffer* command_buffer, - SurfaceManager* surface_manager, gles2::ContextGroup* group) { DCHECK(command_buffer); - gles2::GLES2Decoder* decoder = - gles2::GLES2Decoder::Create(surface_manager, group); + gles2::GLES2Decoder* decoder = gles2::GLES2Decoder::Create(group); GpuScheduler* scheduler = new GpuScheduler(command_buffer, decoder, diff --git a/gpu/command_buffer/service/gpu_scheduler.h b/gpu/command_buffer/service/gpu_scheduler.h index 7d12535..72ffe26 100644 --- a/gpu/command_buffer/service/gpu_scheduler.h +++ b/gpu/command_buffer/service/gpu_scheduler.h @@ -43,7 +43,6 @@ class GpuScheduler : public CommandBufferEngine { public: // If a group is not passed in one will be created. static GpuScheduler* Create(CommandBuffer* command_buffer, - SurfaceManager* surface_manager, gles2::ContextGroup* group); // This constructor is for unit tests. diff --git a/gpu/command_buffer/service/surface_manager.cc b/gpu/command_buffer/service/surface_manager.cc deleted file mode 100644 index 2fca939..0000000 --- a/gpu/command_buffer/service/surface_manager.cc +++ /dev/null @@ -1,15 +0,0 @@ -// 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. - -#include "gpu/command_buffer/service/surface_manager.h" - -namespace gpu { - -SurfaceManager::SurfaceManager() { -} - -SurfaceManager::~SurfaceManager() { -} - -} // namespace gpu diff --git a/gpu/command_buffer/service/surface_manager.h b/gpu/command_buffer/service/surface_manager.h deleted file mode 100644 index 4caa4ac..0000000 --- a/gpu/command_buffer/service/surface_manager.h +++ /dev/null @@ -1,31 +0,0 @@ -// 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. - -#ifndef GPU_COMMAND_BUFFER_SERVICE_SURFACE_MANAGER_H_ -#define GPU_COMMAND_BUFFER_SERVICE_SURFACE_MANAGER_H_ - -#include "base/basictypes.h" - -namespace gfx { -class GLSurface; -} - -namespace gpu { - -// Interface used to get the GLSurface corresponding to an ID communicated -// through the command buffer. -class SurfaceManager { - public: - SurfaceManager(); - virtual ~SurfaceManager(); - - virtual gfx::GLSurface* LookupSurface(int id) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(SurfaceManager); -}; - -} // namespace gpu - -#endif // GPU_COMMAND_BUFFER_SERVICE_SURFACE_MANAGER_H_ diff --git a/gpu/command_buffer/service/surface_manager_mock.cc b/gpu/command_buffer/service/surface_manager_mock.cc deleted file mode 100644 index e472582..0000000 --- a/gpu/command_buffer/service/surface_manager_mock.cc +++ /dev/null @@ -1,15 +0,0 @@ -// 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. - -#include "gpu/command_buffer/service/surface_manager_mock.h" - -namespace gpu { - -MockSurfaceManager::MockSurfaceManager() { -} - -MockSurfaceManager::~MockSurfaceManager() { -} - -} // namespace gpu diff --git a/gpu/command_buffer/service/surface_manager_mock.h b/gpu/command_buffer/service/surface_manager_mock.h deleted file mode 100644 index 97f878e..0000000 --- a/gpu/command_buffer/service/surface_manager_mock.h +++ /dev/null @@ -1,26 +0,0 @@ -// 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. - -#ifndef GPU_COMMAND_BUFFER_SERVICE_SURFACE_MANAGER_MOCK_H_ -#define GPU_COMMAND_BUFFER_SERVICE_SURFACE_MANAGER_MOCK_H_ - -#include "gpu/command_buffer/service/surface_manager.h" -#include "testing/gmock/include/gmock/gmock.h" - -namespace gpu { - -class MockSurfaceManager : public SurfaceManager { - public: - MockSurfaceManager(); - virtual ~MockSurfaceManager(); - - MOCK_METHOD1(LookupSurface, gfx::GLSurface*(int id)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockSurfaceManager); -}; - -} // namespace gpu - -#endif // GPU_COMMAND_BUFFER_SERVICE_SURFACE_MANAGER_MOCK_H_ diff --git a/gpu/demos/framework/window.cc b/gpu/demos/framework/window.cc index e5d24dd..30e4b5e 100644 --- a/gpu/demos/framework/window.cc +++ b/gpu/demos/framework/window.cc @@ -60,9 +60,7 @@ bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) { } GpuScheduler* gpu_scheduler( - GpuScheduler::Create(command_buffer.get(), - NULL, - NULL)); + GpuScheduler::Create(command_buffer.get(), NULL)); if (!gpu_scheduler->Initialize(hwnd, gfx::Size(), false, gpu::gles2::DisallowedExtensions(), NULL, std::vector<int32>(), diff --git a/gpu/gles2_conform_support/egl/display.cc b/gpu/gles2_conform_support/egl/display.cc index 7b5d26b..da0ac3c 100644 --- a/gpu/gles2_conform_support/egl/display.cc +++ b/gpu/gles2_conform_support/egl/display.cc @@ -110,9 +110,7 @@ EGLSurface Display::CreateWindowSurface(EGLConfig config, std::vector<int32> attribs; gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(true)); scoped_ptr<GpuScheduler> gpu_scheduler( - GpuScheduler::Create(command_buffer_.get(), - NULL, - group.get())); + GpuScheduler::Create(command_buffer_.get(), group.get())); if (!gpu_scheduler->Initialize( win, gfx::Size(), false, gpu::gles2::DisallowedExtensions(), NULL, attribs, NULL)) diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp index 436545b..b571fe1 100644 --- a/gpu/gpu.gyp +++ b/gpu/gpu.gyp @@ -232,8 +232,6 @@ 'command_buffer/service/shader_manager.cc', 'command_buffer/service/shader_translator.h', 'command_buffer/service/shader_translator.cc', - 'command_buffer/service/surface_manager.cc', - 'command_buffer/service/surface_manager.h', 'command_buffer/service/texture_manager.h', 'command_buffer/service/texture_manager.cc', 'command_buffer/service/vertex_attrib_manager.h', @@ -310,8 +308,6 @@ 'command_buffer/service/renderbuffer_manager_unittest.cc', 'command_buffer/service/shader_manager_unittest.cc', 'command_buffer/service/shader_translator_unittest.cc', - 'command_buffer/service/surface_manager_mock.cc', - 'command_buffer/service/surface_manager_mock.h', 'command_buffer/service/test_helper.cc', 'command_buffer/service/test_helper.h', 'command_buffer/service/texture_manager_unittest.cc', |