summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gfx/gfx.gyp24
-rw-r--r--gpu/command_buffer/service/gl_context.cc (renamed from gfx/gl/gl_context.cc)15
-rw-r--r--gpu/command_buffer/service/gl_context.h (renamed from gfx/gl/gl_context.h)14
-rw-r--r--gpu/command_buffer/service/gl_context_linux.cc (renamed from gfx/gl/gl_context_linux.cc)17
-rw-r--r--gpu/command_buffer/service/gl_context_mac.cc (renamed from gfx/gl/gl_context_mac.cc)15
-rw-r--r--gpu/command_buffer/service/gl_context_osmesa.cc (renamed from gfx/gl/gl_context_osmesa.cc)9
-rw-r--r--gpu/command_buffer/service/gl_context_osmesa.h (renamed from gfx/gl/gl_context_osmesa.h)17
-rw-r--r--gpu/command_buffer/service/gl_context_stub.cc19
-rw-r--r--gpu/command_buffer/service/gl_context_win.cc (renamed from gfx/gl/gl_context_win.cc)18
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc14
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.h10
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_mock.h4
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc2
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h4
-rw-r--r--gpu/command_buffer/service/gpu_processor.cc2
-rw-r--r--gpu/command_buffer/service/gpu_processor.h8
-rw-r--r--gpu/command_buffer/service/gpu_processor_linux.cc8
-rw-r--r--gpu/command_buffer/service/gpu_processor_mac.cc6
-rw-r--r--gpu/command_buffer/service/gpu_processor_win.cc8
-rw-r--r--gpu/gpu.gyp22
20 files changed, 112 insertions, 124 deletions
diff --git a/gfx/gfx.gyp b/gfx/gfx.gyp
index d5a06aa..4b7d612 100644
--- a/gfx/gfx.gyp
+++ b/gfx/gfx.gyp
@@ -130,30 +130,6 @@
}],
],
},
- {
- '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/gfx/gl/gl_context.cc b/gpu/command_buffer/service/gl_context.cc
index cf9b111..e123936 100644
--- a/gfx/gl/gl_context.cc
+++ b/gpu/command_buffer/service/gl_context.cc
@@ -2,12 +2,17 @@
// 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 "gpu/command_buffer/service/gl_context.h"
+#include "gpu/command_buffer/service/gl_utils.h"
+#include "gpu/command_buffer/common/logging.h"
-#include "gfx/gl/gl_context.h"
-#include "base/logging.h"
+namespace gpu {
-namespace gfx {
+GLContext::GLContext() {
+}
+
+GLContext::~GLContext() {
+}
// GLEW initialization is extremely expensive because it looks up
// hundreds of function pointers. Realistically we are not going to
@@ -83,4 +88,4 @@ bool GLContext::InitializeCommon() {
return true;
}
-} // namespace gfx
+} // namespace gpu
diff --git a/gfx/gl/gl_context.h b/gpu/command_buffer/service/gl_context.h
index a115f28..cd41b56 100644
--- a/gfx/gl/gl_context.h
+++ b/gpu/command_buffer/service/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 GFX_GL_GL_CONTEXT_H_
-#define GFX_GL_GL_CONTEXT_H_
+#ifndef GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_H_
+#define GPU_COMMAND_BUFFER_SERVICE_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 gfx {
+namespace gpu {
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 gfx
+} // namespace gpu
-#endif // GFX_GL_GL_CONTEXT_H_
+#endif // GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_H_
diff --git a/gfx/gl/gl_context_linux.cc b/gpu/command_buffer/service/gl_context_linux.cc
index 42bdc37e..1c04d91 100644
--- a/gfx/gl/gl_context_linux.cc
+++ b/gpu/command_buffer/service/gl_context_linux.cc
@@ -5,20 +5,19 @@
// 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 "gfx/gl/gl_context.h"
-#include "gfx/gl/gl_context_osmesa.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"
-namespace gfx {
+namespace gpu {
typedef GLXContext GLContextHandle;
typedef GLXPbuffer PbufferHandle;
@@ -399,4 +398,4 @@ GLContext* GLContext::CreateOffscreenGLContext(void* shared_handle) {
}
}
-} // namespace gfx
+} // namespace gpu
diff --git a/gfx/gl/gl_context_mac.cc b/gpu/command_buffer/service/gl_context_mac.cc
index 65121ca..7fed885 100644
--- a/gfx/gl/gl_context_mac.cc
+++ b/gpu/command_buffer/service/gl_context_mac.cc
@@ -4,17 +4,16 @@
// This file implements the ViewGLContext and PbufferGLContext classes.
-#include <GL/glew.h>
-#include <GL/osmew.h>
-#include <OpenGL/OpenGL.h>
+// Ensure that gl_utils.h is included before any GL headers.
+#include "gpu/command_buffer/service/gl_utils.h"
#include "app/surface/accelerated_surface_mac.h"
-#include "base/logging.h"
#include "base/scoped_ptr.h"
-#include "gfx/gl/gl_context.h"
-#include "gfx/gl/gl_context_osmesa.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"
-namespace gfx {
+namespace gpu {
typedef CGLContextObj GLContextHandle;
typedef CGLPBufferObj PbufferHandle;
@@ -180,4 +179,4 @@ GLContext* GLContext::CreateOffscreenGLContext(void* shared_handle) {
}
}
-} // namespace gfx
+} // namespace gpu
diff --git a/gfx/gl/gl_context_osmesa.cc b/gpu/command_buffer/service/gl_context_osmesa.cc
index 80b1cc9..6ec7489 100644
--- a/gfx/gl/gl_context_osmesa.cc
+++ b/gpu/command_buffer/service/gl_context_osmesa.cc
@@ -2,14 +2,11 @@
// 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 "gfx/gl/gl_context_osmesa.h"
+#include "gpu/command_buffer/service/gl_context_osmesa.h"
-namespace gfx {
+namespace gpu {
OSMesaGLContext::OSMesaGLContext()
#if !defined(UNIT_TEST)
@@ -106,4 +103,4 @@ void OSMesaGLContext::Resize(const gfx::Size& new_size) {
MakeCurrent();
}
-} // namespace gfx
+} // namespace gpu
diff --git a/gfx/gl/gl_context_osmesa.h b/gpu/command_buffer/service/gl_context_osmesa.h
index 1c60433..06b14ca 100644
--- a/gfx/gl/gl_context_osmesa.h
+++ b/gpu/command_buffer/service/gl_context_osmesa.h
@@ -2,16 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef GFX_GL_GL_CONTEXT_OSMESA_H_
-#define GFX_GL_GL_CONTEXT_OSMESA_H_
+#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"
#include "base/scoped_ptr.h"
#include "gfx/size.h"
-#include "gfx/gl/gl_context.h"
-
-typedef struct osmesa_context *OSMesaContext;
+#include "gpu/command_buffer/service/gl_context.h"
-namespace gfx {
+namespace gpu {
// Encapsulates an OSMesa OpenGL context that uses software rendering.
class OSMesaGLContext : public GLContext {
@@ -52,6 +53,6 @@ class OSMesaGLContext : public GLContext {
DISALLOW_COPY_AND_ASSIGN(OSMesaGLContext);
};
-} // namespace gfx
+} // namespace gpu
-#endif // GFX_GL_GL_CONTEXT_OSMESA_H_
+#endif // GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_OSMESA_H_
diff --git a/gpu/command_buffer/service/gl_context_stub.cc b/gpu/command_buffer/service/gl_context_stub.cc
index 5b776db..84e6209 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 "gfx/gl/gl_context.h"
+#include "gpu/command_buffer/service/gl_context.h"
namespace gpu {
// A GLContext that does nothing for unit tests.
-class StubGLContext : public gfx::GLContext {
+class StubGLContext : public GLContext {
public:
// Implement GLContext.
@@ -23,22 +23,17 @@ class StubGLContext : public gfx::GLContext {
virtual void* GetHandle() { return NULL; }
};
-} // namespace gpu
-
-namespace gfx {
-
#if !defined(OS_MACOSX)
-GLContext* GLContext::CreateViewGLContext(PluginWindowHandle /* window */,
+GLContext* GLContext::CreateViewGLContext(gfx::PluginWindowHandle /* window */,
bool /* multisampled */) {
- return new gpu::StubGLContext;
+ return new StubGLContext;
}
#endif // OS_MACOSX
-GLContext* GLContext::CreateOffscreenGLContext(
- void* /* shared_handle */) {
- return new gpu::StubGLContext;
+GLContext* GLContext::CreateOffscreenGLContext(void* /* shared_handle */) {
+ return new StubGLContext;
}
-} // namespace gfx
+} // namespace gpu
diff --git a/gfx/gl/gl_context_win.cc b/gpu/command_buffer/service/gl_context_win.cc
index 2a1d6d0..05cee5b 100644
--- a/gfx/gl/gl_context_win.cc
+++ b/gpu/command_buffer/service/gl_context_win.cc
@@ -4,19 +4,17 @@
// This file implements the NativeViewGLContext and PbufferGLContext classes.
-#include <GL/glew.h>
-#include <GL/osmew.h>
-#include <GL/wglew.h>
-#include <windows.h>
-
#include <algorithm>
-#include "base/logging.h"
+// Ensure that gl_utils.h is included before any GL headers.
+#include "gpu/command_buffer/service/gl_utils.h"
+
#include "base/scoped_ptr.h"
-#include "gfx/gl/gl_context.h"
-#include "gfx/gl/gl_context_osmesa.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"
-namespace gfx {
+namespace gpu {
typedef HGLRC GLContextHandle;
typedef HPBUFFERARB PbufferHandle;
@@ -622,4 +620,4 @@ GLContext* GLContext::CreateOffscreenGLContext(void* shared_handle) {
}
}
-} // namespace gfx
+} // namespace gpu
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 26ab67f..13654c1 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(gfx::GLContext* context,
+ virtual bool Initialize(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 gfx::GLContext* GetGLContext() { return context_; }
+ virtual 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.
- gfx::GLContext* context_;
+ 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<gfx::GLContext> default_context_;
+ scoped_ptr<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(gfx::GLContext* context,
+bool GLES2DecoderImpl::Initialize(GLContext* context,
const gfx::Size& size,
GLES2Decoder* parent,
uint32 parent_client_texture_id) {
@@ -1178,7 +1178,7 @@ bool GLES2DecoderImpl::Initialize(gfx::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(gfx::GLContext::CreateOffscreenGLContext(
+ default_context_.reset(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 4acd379..08e664b 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(gfx::GLContext* context,
+ virtual bool Initialize(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 gfx::GLContext* GetGLContext() = 0;
+ virtual 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 d69d755..e29a1fe8 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(gfx::GLContext* context,
+ MOCK_METHOD4(Initialize, bool(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, gfx::GLContext*());
+ MOCK_METHOD0(GetGLContext, 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 9da6955..385779e 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(gfx::GLContext::CreateOffscreenGLContext(NULL));
+ context_.reset(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 d12a1a0..773e285 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<gfx::GLContext> context_;
+ scoped_ptr<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 be0798f..ab3230b 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 "gfx/gl/gl_context.h"
+#include "gpu/command_buffer/service/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 47164cd..eb2d52b 100644
--- a/gpu/command_buffer/service/gpu_processor.h
+++ b/gpu/command_buffer/service/gpu_processor.h
@@ -23,12 +23,10 @@
#include "app/surface/accelerated_surface_mac.h"
#endif
-namespace gfx {
-class GLContext;
-}
-
namespace gpu {
+class GLContext;
+
// This class processes commands in a command buffer. It is event driven and
// posts tasks to the current message loop to do additional work.
class GPUProcessor : public CommandBufferEngine {
@@ -101,7 +99,7 @@ class GPUProcessor : public CommandBufferEngine {
gles2::ContextGroup group_;
scoped_ptr<gles2::GLES2Decoder> decoder_;
scoped_ptr<CommandParser> parser_;
- scoped_ptr<gfx::GLContext> context_;
+ scoped_ptr<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 5c4ef38..39fd234 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 "gfx/gl/gl_context.h"
+#include "gpu/command_buffer/service/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;
- gfx::GLContext* parent_context = NULL;
+ 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(gfx::GLContext::CreateViewGLContext(window, false));
+ context_.reset(GLContext::CreateViewGLContext(window, false));
} else {
- context_.reset(gfx::GLContext::CreateOffscreenGLContext(parent_handle));
+ context_.reset(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 01a247c..e7a3f6a 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 "gfx/gl/gl_context.h"
+#include "gpu/command_buffer/service/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;
- gfx::GLContext* parent_context = NULL;
+ 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(gfx::GLContext::CreateOffscreenGLContext(parent_handle));
+ context_.reset(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 0f6e044..f4e3d54 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 "gfx/gl/gl_context.h"
+#include "gpu/command_buffer/service/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;
- gfx::GLContext* parent_context = NULL;
+ 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(gfx::GLContext::CreateViewGLContext(window, false));
+ context_.reset(GLContext::CreateViewGLContext(window, false));
} else {
- context_.reset(gfx::GLContext::CreateOffscreenGLContext(parent_handle));
+ context_.reset(GLContext::CreateOffscreenGLContext(parent_handle));
}
if (!context_.get())
diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp
index a8b841e..ff3391e 100644
--- a/gpu/gpu.gyp
+++ b/gpu/gpu.gyp
@@ -22,6 +22,8 @@
'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',
@@ -276,10 +278,11 @@
'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"',
@@ -287,6 +290,23 @@
'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',
+ ],
},
],
],