Chromium Code Reviews| Index: ui/compositor/test/in_process_context_provider.h |
| diff --git a/webkit/common/gpu/context_provider_in_process.h b/ui/compositor/test/in_process_context_provider.h |
| similarity index 53% |
| copy from webkit/common/gpu/context_provider_in_process.h |
| copy to ui/compositor/test/in_process_context_provider.h |
| index e3c9ea1e34b79770b0e146b9480466bfab811c41..9eb9fdf90c343713c935d90f99c00b15a1e97276 100644 |
| --- a/webkit/common/gpu/context_provider_in_process.h |
| +++ b/ui/compositor/test/in_process_context_provider.h |
| @@ -11,46 +11,44 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/synchronization/lock.h" |
| #include "base/threading/thread_checker.h" |
| -#include "webkit/common/gpu/context_provider_web_context.h" |
| -#include "webkit/common/gpu/webkit_gpu_export.h" |
| +#include "cc/output/context_provider.h" |
| +#include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| +#include "skia/ext/refptr.h" |
| +#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| +#include "ui/gfx/native_widget_types.h" |
| -namespace blink { class WebGraphicsContext3D; } |
| - |
| -namespace gpu_blink { |
| -class WebGraphicsContext3DInProcessCommandBufferImpl; |
| +namespace gpu { |
| +class GLInProcessContext; |
| } |
| -namespace webkit { |
| -namespace gpu { |
| -class GrContextForWebGraphicsContext3D; |
| -class WEBKIT_GPU_EXPORT ContextProviderInProcess |
| - : NON_EXPORTED_BASE(public ContextProviderWebContext) { |
| +namespace ui { |
| + |
| +class InProcessContextProvider : public cc::ContextProvider { |
| public: |
| - static scoped_refptr<ContextProviderInProcess> Create( |
| - scoped_ptr<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl> |
| - context3d, |
| + static scoped_refptr<InProcessContextProvider> Create( |
| + const blink::WebGraphicsContext3D::Attributes& attributes, |
|
piman
2015/01/21 22:37:39
As James mentioned, you can pass in a ContextCreat
tfarina
2015/01/22 00:05:32
Done.
|
| + bool lose_context_when_out_of_memory, |
| + gfx::AcceleratedWidget window, |
| const std::string& debug_name); |
| // Uses default attributes for creating an offscreen context. |
| - static scoped_refptr<ContextProviderInProcess> CreateOffscreen( |
| + static scoped_refptr<InProcessContextProvider> CreateOffscreen( |
| bool lose_context_when_out_of_memory); |
| private: |
| - ContextProviderInProcess( |
| - scoped_ptr<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl> |
| - context3d, |
| + InProcessContextProvider( |
| + const blink::WebGraphicsContext3D::Attributes& attributes, |
| + bool lose_context_when_out_of_memory, |
| + gfx::AcceleratedWidget window, |
| const std::string& debug_name); |
| - ~ContextProviderInProcess() override; |
| - |
| - // ContextProviderWebContext: |
| - blink::WebGraphicsContext3D* WebContext3D() override; |
| + ~InProcessContextProvider() override; |
| // cc::ContextProvider: |
| bool BindToCurrentThread() override; |
| Capabilities ContextCapabilities() override; |
| - ::gpu::gles2::GLES2Interface* ContextGL() override; |
| - ::gpu::ContextSupport* ContextSupport() override; |
| + gpu::gles2::GLES2Interface* ContextGL() override; |
| + gpu::ContextSupport* ContextSupport() override; |
| class GrContext* GrContext() override; |
| bool IsContextLost() override; |
| void VerifyContexts() override; |
| @@ -68,25 +66,24 @@ class WEBKIT_GPU_EXPORT ContextProviderInProcess |
| base::ThreadChecker main_thread_checker_; |
| base::ThreadChecker context_thread_checker_; |
| - scoped_ptr<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl> |
| - context3d_; |
| - scoped_ptr<GrContextForWebGraphicsContext3D> gr_context_; |
| + scoped_ptr<gpu::GLInProcessContext> context_; |
| + skia::RefPtr<class GrContext> gr_context_; |
| - LostContextCallback lost_context_callback_; |
| + gpu::gles2::ContextCreationAttribHelper attributes_; |
| + bool lose_context_when_out_of_memory_; |
| + bool share_resources_; |
| + gfx::AcceleratedWidget window_; |
| base::Lock destroyed_lock_; |
| bool destroyed_; |
| std::string debug_name_; |
| - class LostContextCallbackProxy; |
| - scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
| cc::ContextProvider::Capabilities capabilities_; |
| - DISALLOW_COPY_AND_ASSIGN(ContextProviderInProcess); |
| + DISALLOW_COPY_AND_ASSIGN(InProcessContextProvider); |
| }; |
| -} // namespace gpu |
| -} // namespace webkit |
| +} // namespace ui |
| #endif // WEBKIT_COMMON_GPU_CONTEXT_PROVIDER_IN_PROCESS_H_ |