diff options
20 files changed, 124 insertions, 112 deletions
diff --git a/gfx/gfx.gyp b/gfx/gfx.gyp index 4b7d612..d5a06aa 100644 --- a/gfx/gfx.gyp +++ b/gfx/gfx.gyp @@ -130,6 +130,30 @@ }], ], }, + { + 'target_name': 'gfx_gl', + 'type': 'static_library', + 'include_dirs': [ + '..', + '../third_party/glew/include', + ], + 'defines': [ + 'GLEW_STATIC', + ], + 'sources': [ + 'gl/gl_context.cc', + 'gl/gl_context.h', + 'gl/gl_context_osmesa.cc', + 'gl/gl_context_osmesa.h', + 'gl/gl_context_linux.cc', + 'gl/gl_context_linux.h', + 'gl/gl_context_mac.cc', + 'gl/gl_context_mac.h', + 'gl/gl_context_win.cc', + 'gl/gl_context_win.h', + '../third_party/glew/src/glew.c', + ], + }, ], } diff --git a/gpu/command_buffer/service/gl_context.cc b/gfx/gl/gl_context.cc index e123936..cf9b111 100644 --- a/gpu/command_buffer/service/gl_context.cc +++ b/gfx/gl/gl_context.cc @@ -2,17 +2,12 @@ // 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/gl_context.h" -#include "gpu/command_buffer/service/gl_utils.h" -#include "gpu/command_buffer/common/logging.h" +#include <GL/glew.h> -namespace gpu { +#include "gfx/gl/gl_context.h" +#include "base/logging.h" -GLContext::GLContext() { -} - -GLContext::~GLContext() { -} +namespace gfx { // GLEW initialization is extremely expensive because it looks up // hundreds of function pointers. Realistically we are not going to @@ -88,4 +83,4 @@ bool GLContext::InitializeCommon() { return true; } -} // namespace gpu +} // namespace gfx diff --git a/gpu/command_buffer/service/gl_context.h b/gfx/gl/gl_context.h index cd41b56..a115f28 100644 --- a/gpu/command_buffer/service/gl_context.h +++ b/gfx/gl/gl_context.h @@ -2,23 +2,23 @@ // 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_GL_CONTEXT_H_ -#define GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_H_ +#ifndef GFX_GL_GL_CONTEXT_H_ +#define GFX_GL_GL_CONTEXT_H_ #include "build/build_config.h" #include "gfx/native_widget_types.h" #include "gfx/size.h" #include "gpu/command_buffer/common/logging.h" -namespace gpu { +namespace gfx { bool InitializeGLEW(); // Encapsulates an OpenGL context, hiding platform specific management. class GLContext { public: - GLContext(); - virtual ~GLContext(); + GLContext() {} + virtual ~GLContext() {} // Destroys the GL context. virtual void Destroy() = 0; @@ -59,6 +59,6 @@ class GLContext { DISALLOW_COPY_AND_ASSIGN(GLContext); }; -} // namespace gpu +} // namespace gfx -#endif // GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_H_ +#endif // GFX_GL_GL_CONTEXT_H_ diff --git a/gpu/command_buffer/service/gl_context_linux.cc b/gfx/gl/gl_context_linux.cc index 1c04d91..42bdc37e 100644 --- a/gpu/command_buffer/service/gl_context_linux.cc +++ b/gfx/gl/gl_context_linux.cc @@ -5,19 +5,20 @@ // This file implements the ViewGLContext and PbufferGLContext classes. #include <dlfcn.h> +#include <GL/glew.h> +#include <GL/glxew.h> +#include <GL/glx.h> +#include <GL/osmew.h> #include <X11/Xlib.h> #include <X11/Xutil.h> -// Ensure that gl_utils.h is included before any GL headers. -#include "gpu/command_buffer/service/gl_utils.h" - #include "app/x11_util.h" +#include "base/logging.h" #include "base/scoped_ptr.h" -#include "gpu/command_buffer/service/gl_context.h" -#include "gpu/command_buffer/service/gl_context_osmesa.h" -#include "gpu/command_buffer/common/logging.h" +#include "gfx/gl/gl_context.h" +#include "gfx/gl/gl_context_osmesa.h" -namespace gpu { +namespace gfx { typedef GLXContext GLContextHandle; typedef GLXPbuffer PbufferHandle; @@ -398,4 +399,4 @@ GLContext* GLContext::CreateOffscreenGLContext(void* shared_handle) { } } -} // namespace gpu +} // namespace gfx diff --git a/gpu/command_buffer/service/gl_context_mac.cc b/gfx/gl/gl_context_mac.cc index 7fed885..65121ca 100644 --- a/gpu/command_buffer/service/gl_context_mac.cc +++ b/gfx/gl/gl_context_mac.cc @@ -4,16 +4,17 @@ // This file implements the ViewGLContext and PbufferGLContext classes. -// Ensure that gl_utils.h is included before any GL headers. -#include "gpu/command_buffer/service/gl_utils.h" +#include <GL/glew.h> +#include <GL/osmew.h> +#include <OpenGL/OpenGL.h> #include "app/surface/accelerated_surface_mac.h" +#include "base/logging.h" #include "base/scoped_ptr.h" -#include "gpu/command_buffer/service/gl_context.h" -#include "gpu/command_buffer/service/gl_context_osmesa.h" -#include "gpu/command_buffer/common/logging.h" +#include "gfx/gl/gl_context.h" +#include "gfx/gl/gl_context_osmesa.h" -namespace gpu { +namespace gfx { typedef CGLContextObj GLContextHandle; typedef CGLPBufferObj PbufferHandle; @@ -179,4 +180,4 @@ GLContext* GLContext::CreateOffscreenGLContext(void* shared_handle) { } } -} // namespace gpu +} // namespace gfx diff --git a/gpu/command_buffer/service/gl_context_osmesa.cc b/gfx/gl/gl_context_osmesa.cc index 6ec7489..80b1cc9 100644 --- a/gpu/command_buffer/service/gl_context_osmesa.cc +++ b/gfx/gl/gl_context_osmesa.cc @@ -2,11 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <GL/glew.h> +#include <GL/osmew.h> + #include <algorithm> -#include "gpu/command_buffer/service/gl_context_osmesa.h" +#include "gfx/gl/gl_context_osmesa.h" -namespace gpu { +namespace gfx { OSMesaGLContext::OSMesaGLContext() #if !defined(UNIT_TEST) @@ -103,4 +106,4 @@ void OSMesaGLContext::Resize(const gfx::Size& new_size) { MakeCurrent(); } -} // namespace gpu +} // namespace gfx diff --git a/gpu/command_buffer/service/gl_context_osmesa.h b/gfx/gl/gl_context_osmesa.h index 06b14ca..1c60433 100644 --- a/gpu/command_buffer/service/gl_context_osmesa.h +++ b/gfx/gl/gl_context_osmesa.h @@ -2,17 +2,16 @@ // 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_GL_CONTEXT_OSMESA_H_ -#define GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_OSMESA_H_ - -// Ensure that gl_utils.h is included before any GL headers. -#include "gpu/command_buffer/service/gl_utils.h" +#ifndef GFX_GL_GL_CONTEXT_OSMESA_H_ +#define GFX_GL_GL_CONTEXT_OSMESA_H_ #include "base/scoped_ptr.h" #include "gfx/size.h" -#include "gpu/command_buffer/service/gl_context.h" +#include "gfx/gl/gl_context.h" + +typedef struct osmesa_context *OSMesaContext; -namespace gpu { +namespace gfx { // Encapsulates an OSMesa OpenGL context that uses software rendering. class OSMesaGLContext : public GLContext { @@ -53,6 +52,6 @@ class OSMesaGLContext : public GLContext { DISALLOW_COPY_AND_ASSIGN(OSMesaGLContext); }; -} // namespace gpu +} // namespace gfx -#endif // GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_OSMESA_H_ +#endif // GFX_GL_GL_CONTEXT_OSMESA_H_ diff --git a/gpu/command_buffer/service/gl_context_win.cc b/gfx/gl/gl_context_win.cc index 05cee5b..2a1d6d0 100644 --- a/gpu/command_buffer/service/gl_context_win.cc +++ b/gfx/gl/gl_context_win.cc @@ -4,17 +4,19 @@ // This file implements the NativeViewGLContext and PbufferGLContext classes. -#include <algorithm> +#include <GL/glew.h> +#include <GL/osmew.h> +#include <GL/wglew.h> +#include <windows.h> -// Ensure that gl_utils.h is included before any GL headers. -#include "gpu/command_buffer/service/gl_utils.h" +#include <algorithm> +#include "base/logging.h" #include "base/scoped_ptr.h" -#include "gpu/command_buffer/service/gl_context.h" -#include "gpu/command_buffer/service/gl_context_osmesa.h" -#include "gpu/command_buffer/common/logging.h" +#include "gfx/gl/gl_context.h" +#include "gfx/gl/gl_context_osmesa.h" -namespace gpu { +namespace gfx { typedef HGLRC GLContextHandle; typedef HPBUFFERARB PbufferHandle; @@ -620,4 +622,4 @@ GLContext* GLContext::CreateOffscreenGLContext(void* shared_handle) { } } -} // namespace gpu +} // namespace gfx diff --git a/gpu/command_buffer/service/gl_context_stub.cc b/gpu/command_buffer/service/gl_context_stub.cc index 84e6209..5b776db 100644 --- a/gpu/command_buffer/service/gl_context_stub.cc +++ b/gpu/command_buffer/service/gl_context_stub.cc @@ -5,12 +5,12 @@ // This file implements the StubGLContext. #include "build/build_config.h" -#include "gpu/command_buffer/service/gl_context.h" +#include "gfx/gl/gl_context.h" namespace gpu { // A GLContext that does nothing for unit tests. -class StubGLContext : public GLContext { +class StubGLContext : public gfx::GLContext { public: // Implement GLContext. @@ -23,17 +23,22 @@ class StubGLContext : public GLContext { virtual void* GetHandle() { return NULL; } }; +} // namespace gpu + +namespace gfx { + #if !defined(OS_MACOSX) -GLContext* GLContext::CreateViewGLContext(gfx::PluginWindowHandle /* window */, +GLContext* GLContext::CreateViewGLContext(PluginWindowHandle /* window */, bool /* multisampled */) { - return new StubGLContext; + return new gpu::StubGLContext; } #endif // OS_MACOSX -GLContext* GLContext::CreateOffscreenGLContext(void* /* shared_handle */) { - return new StubGLContext; +GLContext* GLContext::CreateOffscreenGLContext( + void* /* shared_handle */) { + return new gpu::StubGLContext; } -} // namespace gpu +} // namespace gfx diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 13654c1..26ab67f 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -16,13 +16,13 @@ #include "base/weak_ptr.h" #include "build/build_config.h" #define GLES2_GPU_SERVICE 1 +#include "gfx/gl/gl_context.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/service/buffer_manager.h" #include "gpu/command_buffer/service/cmd_buffer_engine.h" #include "gpu/command_buffer/service/context_group.h" #include "gpu/command_buffer/service/framebuffer_manager.h" -#include "gpu/command_buffer/service/gl_context.h" #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/command_buffer/service/gles2_cmd_validation.h" #include "gpu/command_buffer/service/id_manager.h" @@ -368,7 +368,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, virtual const char* GetCommandName(unsigned int command_id) const; // Overridden from GLES2Decoder. - virtual bool Initialize(GLContext* context, + virtual bool Initialize(gfx::GLContext* context, const gfx::Size& size, GLES2Decoder* parent, uint32 parent_client_texture_id); @@ -377,7 +377,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, virtual bool MakeCurrent(); virtual uint32 GetServiceIdForTesting(uint32 client_id); virtual GLES2Util* GetGLES2Util() { return &util_; } - virtual GLContext* GetGLContext() { return context_; } + virtual gfx::GLContext* GetGLContext() { return context_; } virtual void SetSwapBuffersCallback(Callback0::Type* callback); @@ -827,14 +827,14 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, #undef GLES2_CMD_OP // The GL context this decoder renders to on behalf of the client. - GLContext* context_; + gfx::GLContext* context_; // A GLContext that is kept in its default state. It is used to perform // operations that should not be dependent on client set GLContext state, like // clearing a render buffer when it is created. // TODO(apatrick): Decoders in the same ContextGroup could potentially share // the same default GL context. - scoped_ptr<GLContext> default_context_; + scoped_ptr<gfx::GLContext> default_context_; // A parent decoder can access this decoders saved offscreen frame buffer. // The parent pointer is reset if the parent is destroyed. @@ -1168,7 +1168,7 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group) anti_aliased_(false) { } -bool GLES2DecoderImpl::Initialize(GLContext* context, +bool GLES2DecoderImpl::Initialize(gfx::GLContext* context, const gfx::Size& size, GLES2Decoder* parent, uint32 parent_client_texture_id) { @@ -1178,7 +1178,7 @@ bool GLES2DecoderImpl::Initialize(GLContext* context, // Create a GL context that is kept in a default state and shares a namespace // with the main GL context. - default_context_.reset(GLContext::CreateOffscreenGLContext( + default_context_.reset(gfx::GLContext::CreateOffscreenGLContext( context_->GetHandle())); if (!default_context_.get()) { Destroy(); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h index 08e664b..4acd379 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder.h @@ -12,11 +12,11 @@ #include "gfx/size.h" #include "gpu/command_buffer/service/common_decoder.h" +namespace gfx { +class GLContext; +} namespace gpu { -// Forward-declared instead of including gl_context.h, because including glx.h -// causes havok. -class GLContext; namespace gles2 { @@ -53,7 +53,7 @@ class GLES2Decoder : public CommonDecoder { // parent's namespace. // Returns: // true if successful. - virtual bool Initialize(GLContext* context, + virtual bool Initialize(gfx::GLContext* context, const gfx::Size& size, GLES2Decoder* parent, uint32 parent_client_texture_id) = 0; @@ -74,7 +74,7 @@ class GLES2Decoder : public CommonDecoder { virtual GLES2Util* GetGLES2Util() = 0; // Gets the associated GLContext. - virtual GLContext* GetGLContext() = 0; + virtual gfx::GLContext* GetGLContext() = 0; // Sets a callback which is called when a SwapBuffers command is processed. virtual void SetSwapBuffersCallback(Callback0::Type* callback) = 0; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h index e29a1fe8..d69d755 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h @@ -28,7 +28,7 @@ class MockGLES2Decoder : public GLES2Decoder { .WillByDefault(testing::Return(true)); } - MOCK_METHOD4(Initialize, bool(GLContext* context, + MOCK_METHOD4(Initialize, bool(gfx::GLContext* context, const gfx::Size& size, GLES2Decoder* parent, uint32 parent_texture_id)); @@ -37,7 +37,7 @@ class MockGLES2Decoder : public GLES2Decoder { MOCK_METHOD0(MakeCurrent, bool()); MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id)); MOCK_METHOD0(GetGLES2Util, GLES2Util*()); - MOCK_METHOD0(GetGLContext, GLContext*()); + MOCK_METHOD0(GetGLContext, gfx::GLContext*()); MOCK_METHOD1(SetSwapBuffersCallback, void(Callback0::Type*)); MOCK_METHOD3(DoCommand, error::Error(unsigned int command, unsigned int arg_count, 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 385779e..9da6955 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc @@ -94,7 +94,7 @@ void GLES2DecoderTestBase::SetUp() { shared_memory_offset_; shared_memory_id_ = kSharedMemoryId; - context_.reset(GLContext::CreateOffscreenGLContext(NULL)); + context_.reset(gfx::GLContext::CreateOffscreenGLContext(NULL)); decoder_.reset(GLES2Decoder::Create(&group_)); decoder_->Initialize(context_.get(), gfx::Size(), NULL, 0); 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 773e285..d12a1a0 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h @@ -5,13 +5,13 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ +#include "gfx/gl/gl_context.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/service/buffer_manager.h" #include "gpu/command_buffer/service/cmd_buffer_engine.h" #include "gpu/command_buffer/service/context_group.h" #include "gpu/command_buffer/service/framebuffer_manager.h" -#include "gpu/command_buffer/service/gl_context.h" #include "gpu/command_buffer/service/gl_mock.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/program_manager.h" @@ -174,7 +174,7 @@ class GLES2DecoderTestBase : public testing::Test { // Use StrictMock to make 100% sure we know how GL will be called. scoped_ptr< ::testing::StrictMock< ::gles2::MockGLInterface> > gl_; - scoped_ptr<GLContext> context_; + scoped_ptr<gfx::GLContext> context_; scoped_ptr<GLES2Decoder> decoder_; GLuint client_buffer_id_; diff --git a/gpu/command_buffer/service/gpu_processor.cc b/gpu/command_buffer/service/gpu_processor.cc index ab3230b..be0798f 100644 --- a/gpu/command_buffer/service/gpu_processor.cc +++ b/gpu/command_buffer/service/gpu_processor.cc @@ -5,7 +5,7 @@ #include "base/callback.h" #include "base/compiler_specific.h" #include "base/message_loop.h" -#include "gpu/command_buffer/service/gl_context.h" +#include "gfx/gl/gl_context.h" #include "gpu/command_buffer/service/gpu_processor.h" using ::base::SharedMemory; diff --git a/gpu/command_buffer/service/gpu_processor.h b/gpu/command_buffer/service/gpu_processor.h index eb2d52b..47164cd 100644 --- a/gpu/command_buffer/service/gpu_processor.h +++ b/gpu/command_buffer/service/gpu_processor.h @@ -23,9 +23,11 @@ #include "app/surface/accelerated_surface_mac.h" #endif -namespace gpu { - +namespace gfx { class GLContext; +} + +namespace gpu { // This class processes commands in a command buffer. It is event driven and // posts tasks to the current message loop to do additional work. @@ -99,7 +101,7 @@ class GPUProcessor : public CommandBufferEngine { gles2::ContextGroup group_; scoped_ptr<gles2::GLES2Decoder> decoder_; scoped_ptr<CommandParser> parser_; - scoped_ptr<GLContext> context_; + scoped_ptr<gfx::GLContext> context_; #if defined(OS_MACOSX) && !defined(UNIT_TEST) scoped_ptr<AcceleratedSurface> surface_; diff --git a/gpu/command_buffer/service/gpu_processor_linux.cc b/gpu/command_buffer/service/gpu_processor_linux.cc index 39fd234..5c4ef38 100644 --- a/gpu/command_buffer/service/gpu_processor_linux.cc +++ b/gpu/command_buffer/service/gpu_processor_linux.cc @@ -2,7 +2,7 @@ // 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/gl_context.h" +#include "gfx/gl/gl_context.h" #include "gpu/command_buffer/service/gpu_processor.h" using ::base::SharedMemory; @@ -19,7 +19,7 @@ bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, // Get the parent decoder and the GLContext to share IDs with, if any. gles2::GLES2Decoder* parent_decoder = NULL; - GLContext* parent_context = NULL; + gfx::GLContext* parent_context = NULL; void* parent_handle = NULL; if (parent) { parent_decoder = parent->decoder_.get(); @@ -37,9 +37,9 @@ bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, DCHECK(!parent_handle); // TODO(apatrick): support multisampling. - context_.reset(GLContext::CreateViewGLContext(window, false)); + context_.reset(gfx::GLContext::CreateViewGLContext(window, false)); } else { - context_.reset(GLContext::CreateOffscreenGLContext(parent_handle)); + context_.reset(gfx::GLContext::CreateOffscreenGLContext(parent_handle)); } if (!context_.get()) diff --git a/gpu/command_buffer/service/gpu_processor_mac.cc b/gpu/command_buffer/service/gpu_processor_mac.cc index e7a3f6a..01a247c 100644 --- a/gpu/command_buffer/service/gpu_processor_mac.cc +++ b/gpu/command_buffer/service/gpu_processor_mac.cc @@ -2,7 +2,7 @@ // 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/gl_context.h" +#include "gfx/gl/gl_context.h" #include "gpu/command_buffer/service/gpu_processor.h" using ::base::SharedMemory; @@ -19,7 +19,7 @@ bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, // Get the parent decoder and the GLContext to share IDs with, if any. gles2::GLES2Decoder* parent_decoder = NULL; - GLContext* parent_context = NULL; + gfx::GLContext* parent_context = NULL; void* parent_handle = NULL; if (parent) { parent_decoder = parent->decoder_.get(); @@ -32,7 +32,7 @@ bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, DCHECK(parent_handle); } - context_.reset(GLContext::CreateOffscreenGLContext(parent_handle)); + context_.reset(gfx::GLContext::CreateOffscreenGLContext(parent_handle)); if (!context_.get()) return false; diff --git a/gpu/command_buffer/service/gpu_processor_win.cc b/gpu/command_buffer/service/gpu_processor_win.cc index f4e3d54..0f6e044 100644 --- a/gpu/command_buffer/service/gpu_processor_win.cc +++ b/gpu/command_buffer/service/gpu_processor_win.cc @@ -4,7 +4,7 @@ #include <windows.h> -#include "gpu/command_buffer/service/gl_context.h" +#include "gfx/gl/gl_context.h" #include "gpu/command_buffer/service/gpu_processor.h" using ::base::SharedMemory; @@ -21,7 +21,7 @@ bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, // Get the parent decoder and the GLContext to share IDs with, if any. gles2::GLES2Decoder* parent_decoder = NULL; - GLContext* parent_context = NULL; + gfx::GLContext* parent_context = NULL; void* parent_handle = NULL; if (parent) { parent_decoder = parent->decoder_.get(); @@ -39,9 +39,9 @@ bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, DCHECK(!parent_handle); // TODO(apatrick): support multisampling. - context_.reset(GLContext::CreateViewGLContext(window, false)); + context_.reset(gfx::GLContext::CreateViewGLContext(window, false)); } else { - context_.reset(GLContext::CreateOffscreenGLContext(parent_handle)); + context_.reset(gfx::GLContext::CreateOffscreenGLContext(parent_handle)); } if (!context_.get()) diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp index ff3391e..a8b841e 100644 --- a/gpu/gpu.gyp +++ b/gpu/gpu.gyp @@ -22,8 +22,6 @@ 'command_buffer/service/gles2_cmd_validation.cc', 'command_buffer/service/gles2_cmd_validation_autogen.h', 'command_buffer/service/gles2_cmd_validation_implementation_autogen.h', - 'command_buffer/service/gl_context.cc', - 'command_buffer/service/gl_context.h', 'command_buffer/service/gl_utils.h', 'command_buffer/service/gpu_processor.h', 'command_buffer/service/gpu_processor.cc', @@ -278,11 +276,10 @@ 'dependencies': [ 'command_buffer_service_impl', 'gl_libs', + '../gfx/gfx.gyp:gfx_gl', ], 'sources': [ '<@(gpu_service_source_files)', - 'command_buffer/service/gl_context_osmesa.cc', - 'command_buffer/service/gl_context_osmesa.h', ], 'conditions': [ ['OS == "linux"', @@ -290,23 +287,6 @@ 'dependencies': [ '../build/linux/system.gyp:gtk', ], - 'sources': [ - 'command_buffer/service/gl_context_linux.cc', - ], - }, - ], - ['OS == "win"', - { - 'sources': [ - 'command_buffer/service/gl_context_win.cc', - ], - }, - ], - ['OS == "mac"', - { - 'sources': [ - 'command_buffer/service/gl_context_mac.cc', - ], }, ], ], |