| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ | 5 #ifndef UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ |
| 6 #define UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ | 6 #define UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
| 16 #include "cc/output/context_provider.h" | 16 #include "cc/output/context_provider.h" |
| 17 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 17 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 18 #include "skia/ext/refptr.h" | 18 #include "skia/ext/refptr.h" |
| 19 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
| 20 | 20 |
| 21 namespace gpu { | 21 namespace gpu { |
| 22 class GLInProcessContext; | 22 class GLInProcessContext; |
| 23 class GpuMemoryBufferManager; | 23 class GpuMemoryBufferManager; |
| 24 class ImageFactory; | 24 class ImageFactory; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace skia_bindings { |
| 28 class GrContextForGLES2Interface; |
| 29 } |
| 30 |
| 27 namespace ui { | 31 namespace ui { |
| 28 | 32 |
| 29 class InProcessContextProvider : public cc::ContextProvider { | 33 class InProcessContextProvider : public cc::ContextProvider { |
| 30 public: | 34 public: |
| 31 static scoped_refptr<InProcessContextProvider> Create( | 35 static scoped_refptr<InProcessContextProvider> Create( |
| 32 const gpu::gles2::ContextCreationAttribHelper& attribs, | 36 const gpu::gles2::ContextCreationAttribHelper& attribs, |
| 33 InProcessContextProvider* shared_context, | 37 InProcessContextProvider* shared_context, |
| 34 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 38 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 35 gpu::ImageFactory* image_factory, | 39 gpu::ImageFactory* image_factory, |
| 36 gfx::AcceleratedWidget window, | 40 gfx::AcceleratedWidget window, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 63 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 67 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 64 gpu::ImageFactory* image_factory, | 68 gpu::ImageFactory* image_factory, |
| 65 gfx::AcceleratedWidget window, | 69 gfx::AcceleratedWidget window, |
| 66 const std::string& debug_name); | 70 const std::string& debug_name); |
| 67 ~InProcessContextProvider() override; | 71 ~InProcessContextProvider() override; |
| 68 | 72 |
| 69 base::ThreadChecker main_thread_checker_; | 73 base::ThreadChecker main_thread_checker_; |
| 70 base::ThreadChecker context_thread_checker_; | 74 base::ThreadChecker context_thread_checker_; |
| 71 | 75 |
| 72 std::unique_ptr<gpu::GLInProcessContext> context_; | 76 std::unique_ptr<gpu::GLInProcessContext> context_; |
| 73 skia::RefPtr<class GrContext> gr_context_; | 77 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |
| 74 | 78 |
| 75 gpu::gles2::ContextCreationAttribHelper attribs_; | 79 gpu::gles2::ContextCreationAttribHelper attribs_; |
| 76 InProcessContextProvider* shared_context_; | 80 InProcessContextProvider* shared_context_; |
| 77 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 81 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
| 78 gpu::ImageFactory* image_factory_; | 82 gpu::ImageFactory* image_factory_; |
| 79 gfx::AcceleratedWidget window_; | 83 gfx::AcceleratedWidget window_; |
| 80 std::string debug_name_; | 84 std::string debug_name_; |
| 81 cc::ContextProvider::Capabilities capabilities_; | 85 cc::ContextProvider::Capabilities capabilities_; |
| 82 | 86 |
| 83 base::Lock context_lock_; | 87 base::Lock context_lock_; |
| 84 | 88 |
| 85 DISALLOW_COPY_AND_ASSIGN(InProcessContextProvider); | 89 DISALLOW_COPY_AND_ASSIGN(InProcessContextProvider); |
| 86 }; | 90 }; |
| 87 | 91 |
| 88 } // namespace ui | 92 } // namespace ui |
| 89 | 93 |
| 90 #endif // UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ | 94 #endif // UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ |
| OLD | NEW |