diff options
-rw-r--r-- | cc/cc_tests.gyp | 1 | ||||
-rw-r--r-- | cc/output/context_provider.h | 6 | ||||
-rw-r--r-- | cc/output/gl_renderer.h | 1 | ||||
-rw-r--r-- | cc/test/DEPS | 2 | ||||
-rw-r--r-- | cc/test/test_context_provider.cc | 8 | ||||
-rw-r--r-- | cc/test/test_context_provider.h | 3 | ||||
-rw-r--r-- | content/common/gpu/client/context_provider_command_buffer.cc | 8 | ||||
-rw-r--r-- | content/common/gpu/client/context_provider_command_buffer.h | 1 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation.h | 2 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_interface.cc | 19 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_interface.h | 9 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_interface_stub.h | 1 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_trace_implementation.h | 3 | ||||
-rw-r--r-- | gpu/gpu.gyp | 4 | ||||
-rw-r--r-- | gpu/gpu_common.gypi | 1 | ||||
-rw-r--r-- | webkit/common/gpu/context_provider_in_process.cc | 8 | ||||
-rw-r--r-- | webkit/common/gpu/context_provider_in_process.h | 1 | ||||
-rw-r--r-- | webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc | 5 | ||||
-rw-r--r-- | webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h | 2 |
19 files changed, 54 insertions, 31 deletions
diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp index 9d03b2c..c632e7f 100644 --- a/cc/cc_tests.gyp +++ b/cc/cc_tests.gyp @@ -320,6 +320,7 @@ 'dependencies': [ '../base/base.gyp:base', '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', + '../gpu/gpu.gyp:gpu_unittest_utils', '../skia/skia.gyp:skia', '../testing/gmock.gyp:gmock', '../testing/gtest.gyp:gtest', diff --git a/cc/output/context_provider.h b/cc/output/context_provider.h index 72a627cb..8649421 100644 --- a/cc/output/context_provider.h +++ b/cc/output/context_provider.h @@ -12,7 +12,10 @@ class GrContext; namespace blink { class WebGraphicsContext3D; } -namespace gpu { class ContextSupport; } +namespace gpu { +class ContextSupport; +namespace gles2 { class GLES2Interface; } +} namespace cc { struct ManagedMemoryPolicy; @@ -26,6 +29,7 @@ class ContextProvider : public base::RefCountedThreadSafe<ContextProvider> { virtual bool BindToCurrentThread() = 0; virtual blink::WebGraphicsContext3D* Context3d() = 0; + virtual gpu::gles2::GLES2Interface* ContextGL() = 0; virtual gpu::ContextSupport* ContextSupport() = 0; virtual class GrContext* GrContext() = 0; diff --git a/cc/output/gl_renderer.h b/cc/output/gl_renderer.h index b716ad5..8d95262 100644 --- a/cc/output/gl_renderer.h +++ b/cc/output/gl_renderer.h @@ -27,6 +27,7 @@ namespace blink { class WebGraphicsContext3D; } namespace cc { +class ContextProvider; class GLRendererShaderTest; class OutputSurface; class PictureDrawQuad; diff --git a/cc/test/DEPS b/cc/test/DEPS index 8a37ff9e..8f04cc2 100644 --- a/cc/test/DEPS +++ b/cc/test/DEPS @@ -1,5 +1,5 @@ include_rules = [ - "+ui/gl/", + "+gpu/command_buffer/client/gles2_interface_stub.h", # TODO(jamesr): Remove once cc depends on GLES2Interface instead of WGC3D "+webkit/common/gpu", ] diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc index af1e12d..8484b38 100644 --- a/cc/test/test_context_provider.cc +++ b/cc/test/test_context_provider.cc @@ -120,6 +120,14 @@ blink::WebGraphicsContext3D* TestContextProvider::Context3d() { return context3d_.get(); } +gpu::gles2::GLES2Interface* TestContextProvider::ContextGL() { + DCHECK(context3d_); + DCHECK(bound_); + DCHECK(context_thread_checker_.CalledOnValidThread()); + + return &context_gl_stub_; +} + gpu::ContextSupport* TestContextProvider::ContextSupport() { DCHECK(bound_); DCHECK(context_thread_checker_.CalledOnValidThread()); diff --git a/cc/test/test_context_provider.h b/cc/test/test_context_provider.h index c708180..81167c6 100644 --- a/cc/test/test_context_provider.h +++ b/cc/test/test_context_provider.h @@ -11,6 +11,7 @@ #include "base/threading/thread_checker.h" #include "cc/output/context_provider.h" #include "cc/test/test_context_support.h" +#include "gpu/command_buffer/client/gles2_interface_stub.h" namespace blink { class WebGraphicsContext3D; } @@ -29,6 +30,7 @@ class TestContextProvider : public cc::ContextProvider { virtual bool BindToCurrentThread() OVERRIDE; virtual Capabilities ContextCapabilities() OVERRIDE; virtual blink::WebGraphicsContext3D* Context3d() OVERRIDE; + virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; virtual gpu::ContextSupport* ContextSupport() OVERRIDE; virtual class GrContext* GrContext() OVERRIDE; virtual bool IsContextLost() OVERRIDE; @@ -62,6 +64,7 @@ class TestContextProvider : public cc::ContextProvider { TestContextSupport support_; scoped_ptr<TestWebGraphicsContext3D> context3d_; + gpu::gles2::GLES2InterfaceStub context_gl_stub_; bool bound_; base::ThreadChecker main_thread_checker_; diff --git a/content/common/gpu/client/context_provider_command_buffer.cc b/content/common/gpu/client/context_provider_command_buffer.cc index b769cb4..5ee350e 100644 --- a/content/common/gpu/client/context_provider_command_buffer.cc +++ b/content/common/gpu/client/context_provider_command_buffer.cc @@ -134,6 +134,14 @@ ContextProviderCommandBuffer::Context3d() { return context3d_.get(); } +gpu::gles2::GLES2Interface* ContextProviderCommandBuffer::ContextGL() { + DCHECK(context3d_); + DCHECK(lost_context_callback_proxy_); // Is bound to thread. + DCHECK(context_thread_checker_.CalledOnValidThread()); + + return context3d_->GetImplementation(); +} + gpu::ContextSupport* ContextProviderCommandBuffer::ContextSupport() { return context3d_->GetContextSupport(); } diff --git a/content/common/gpu/client/context_provider_command_buffer.h b/content/common/gpu/client/context_provider_command_buffer.h index e0c6816..314a90c 100644 --- a/content/common/gpu/client/context_provider_command_buffer.h +++ b/content/common/gpu/client/context_provider_command_buffer.h @@ -32,6 +32,7 @@ class CONTENT_EXPORT ContextProviderCommandBuffer virtual bool BindToCurrentThread() OVERRIDE; virtual WebGraphicsContext3DCommandBufferImpl* Context3d() OVERRIDE; + virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; virtual gpu::ContextSupport* ContextSupport() OVERRIDE; virtual class GrContext* GrContext() OVERRIDE; virtual Capabilities ContextCapabilities() OVERRIDE; diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h index 0f47a78..c32f407 100644 --- a/gpu/command_buffer/client/gles2_implementation.h +++ b/gpu/command_buffer/client/gles2_implementation.h @@ -117,7 +117,7 @@ class VertexArrayObjectManager; // GLES2CmdHelper but that entails changing your code to use and deal with // shared memory and synchronization issues. class GLES2_IMPL_EXPORT GLES2Implementation - : public GLES2Interface, + : NON_EXPORTED_BASE(public GLES2Interface), NON_EXPORTED_BASE(public ContextSupport) { public: enum MappedMemoryLimit { diff --git a/gpu/command_buffer/client/gles2_interface.cc b/gpu/command_buffer/client/gles2_interface.cc deleted file mode 100644 index a94f167..0000000 --- a/gpu/command_buffer/client/gles2_interface.cc +++ /dev/null @@ -1,19 +0,0 @@ -// 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.h" - -namespace gpu { -namespace gles2 { - -GLES2Interface::GLES2Interface() { -} - -GLES2Interface::~GLES2Interface() { -} - -} // namespace gles2 -} // namespace gpu - - diff --git a/gpu/command_buffer/client/gles2_interface.h b/gpu/command_buffer/client/gles2_interface.h index d1659bf..ca05308 100644 --- a/gpu/command_buffer/client/gles2_interface.h +++ b/gpu/command_buffer/client/gles2_interface.h @@ -6,16 +6,17 @@ #define GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_H_ #include <GLES2/gl2.h> -#include "gles2_impl_export.h" + +#include "base/compiler_specific.h" namespace gpu { namespace gles2 { // This class is the interface for all client side GL functions. -class GLES2_IMPL_EXPORT GLES2Interface { +class GLES2Interface { public: - GLES2Interface(); - virtual ~GLES2Interface(); + 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 diff --git a/gpu/command_buffer/client/gles2_interface_stub.h b/gpu/command_buffer/client/gles2_interface_stub.h index 8c724fd..cf3fb41 100644 --- a/gpu/command_buffer/client/gles2_interface_stub.h +++ b/gpu/command_buffer/client/gles2_interface_stub.h @@ -5,7 +5,6 @@ #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_H_ #define GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_H_ -#include "base/compiler_specific.h" #include "gpu/command_buffer/client/gles2_interface.h" namespace gpu { diff --git a/gpu/command_buffer/client/gles2_trace_implementation.h b/gpu/command_buffer/client/gles2_trace_implementation.h index 4ca5b65..c215231 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation.h +++ b/gpu/command_buffer/client/gles2_trace_implementation.h @@ -13,7 +13,8 @@ namespace gpu { namespace gles2 { // GLES2TraceImplementation is calls TRACE for every GL call. -class GLES2_IMPL_EXPORT GLES2TraceImplementation : public GLES2Interface { +class GLES2_IMPL_EXPORT GLES2TraceImplementation + : NON_EXPORTED_BASE(public GLES2Interface) { public: explicit GLES2TraceImplementation(GLES2Interface* gl); virtual ~GLES2TraceImplementation(); diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp index 72c2757..fdb2372 100644 --- a/gpu/gpu.gyp +++ b/gpu/gpu.gyp @@ -176,8 +176,6 @@ 'command_buffer/client/client_test_helper.h', 'command_buffer/client/cmd_buffer_helper_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/mapped_memory_unittest.cc', 'command_buffer/client/query_tracker_unittest.cc', @@ -349,6 +347,8 @@ 'sources': [ 'command_buffer/service/gles2_cmd_decoder_mock.cc', 'command_buffer/service/error_state_mock.cc', + 'command_buffer/client/gles2_interface_stub.cc', + 'command_buffer/client/gles2_interface_stub.h', ], }, ], diff --git a/gpu/gpu_common.gypi b/gpu/gpu_common.gypi index 015d9c6..68808f2 100644 --- a/gpu/gpu_common.gypi +++ b/gpu/gpu_common.gypi @@ -31,7 +31,6 @@ '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/gles2_trace_implementation_autogen.h', 'command_buffer/client/gles2_trace_implementation.cc', 'command_buffer/client/gles2_trace_implementation.h', diff --git a/webkit/common/gpu/context_provider_in_process.cc b/webkit/common/gpu/context_provider_in_process.cc index d38b3a0..c9098a7 100644 --- a/webkit/common/gpu/context_provider_in_process.cc +++ b/webkit/common/gpu/context_provider_in_process.cc @@ -149,6 +149,14 @@ blink::WebGraphicsContext3D* ContextProviderInProcess::Context3d() { return context3d_.get(); } +::gpu::gles2::GLES2Interface* ContextProviderInProcess::ContextGL() { + DCHECK(context3d_); + DCHECK(lost_context_callback_proxy_); // Is bound to thread. + DCHECK(context_thread_checker_.CalledOnValidThread()); + + return context3d_->GetGLInterface(); +} + ::gpu::ContextSupport* ContextProviderInProcess::ContextSupport() { DCHECK(lost_context_callback_proxy_); // Is bound to thread. DCHECK(context_thread_checker_.CalledOnValidThread()); diff --git a/webkit/common/gpu/context_provider_in_process.h b/webkit/common/gpu/context_provider_in_process.h index 2dbb7a6..c4156e6 100644 --- a/webkit/common/gpu/context_provider_in_process.h +++ b/webkit/common/gpu/context_provider_in_process.h @@ -33,6 +33,7 @@ class WEBKIT_GPU_EXPORT ContextProviderInProcess virtual bool BindToCurrentThread() OVERRIDE; virtual Capabilities ContextCapabilities() OVERRIDE; virtual blink::WebGraphicsContext3D* Context3d() OVERRIDE; + virtual ::gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; virtual ::gpu::ContextSupport* ContextSupport() OVERRIDE; virtual class GrContext* GrContext() OVERRIDE; virtual bool IsContextLost() OVERRIDE; diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index dc5598b..395ef63 100644 --- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc +++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc @@ -1136,6 +1136,11 @@ GrGLInterface* WebGraphicsContext3DInProcessCommandBufferImpl:: return CreateCommandBufferSkiaGLBinding(); } +::gpu::gles2::GLES2Interface* +WebGraphicsContext3DInProcessCommandBufferImpl::GetGLInterface() { + return gl_; +} + ::gpu::ContextSupport* WebGraphicsContext3DInProcessCommandBufferImpl::GetContextSupport() { return gl_; diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h index 76d1715..4525ebb 100644 --- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h +++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h @@ -18,6 +18,7 @@ namespace gpu { class ContextSupport; namespace gles2 { +class GLES2Interface; class GLES2Implementation; } } @@ -553,6 +554,7 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl virtual GrGLInterface* createGrGLInterface(); + ::gpu::gles2::GLES2Interface* GetGLInterface(); ::gpu::ContextSupport* GetContextSupport(); ::gpu::gles2::GLES2Implementation* GetImplementation() { |