Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: ui/compositor/test/in_process_context_provider.h

Issue 2498053004: Add InProcessContextProvider and update InProcessCommandBuffer (Closed)
Patch Set: Revert experiments and fix android_webview Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "gpu/ipc/common/surface_handle.h"
18 #include "ui/gfx/native_widget_types.h" 19 #include "ui/gfx/native_widget_types.h"
19 20
20 namespace gpu { 21 namespace gpu {
21 class GLInProcessContext; 22 class GLInProcessContext;
22 class GpuMemoryBufferManager; 23 class GpuMemoryBufferManager;
23 class ImageFactory; 24 class ImageFactory;
24 } 25 }
25 26
26 namespace skia_bindings { 27 namespace skia_bindings {
27 class GrContextForGLES2Interface; 28 class GrContextForGLES2Interface;
28 } 29 }
29 30
30 namespace ui { 31 namespace ui {
31 32
32 class InProcessContextProvider : public cc::ContextProvider { 33 class InProcessContextProvider : public cc::ContextProvider {
33 public: 34 public:
34 static scoped_refptr<InProcessContextProvider> Create( 35 static scoped_refptr<InProcessContextProvider> Create(
35 const gpu::gles2::ContextCreationAttribHelper& attribs, 36 const gpu::gles2::ContextCreationAttribHelper& attribs,
36 InProcessContextProvider* shared_context, 37 InProcessContextProvider* shared_context,
37 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 38 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
38 gpu::ImageFactory* image_factory, 39 gpu::ImageFactory* image_factory,
39 gfx::AcceleratedWidget window, 40 gpu::SurfaceHandle window,
40 const std::string& debug_name); 41 const std::string& debug_name);
41 42
42 // Uses default attributes for creating an offscreen context. 43 // Uses default attributes for creating an offscreen context.
43 static scoped_refptr<InProcessContextProvider> CreateOffscreen( 44 static scoped_refptr<InProcessContextProvider> CreateOffscreen(
44 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 45 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
45 gpu::ImageFactory* image_factory, 46 gpu::ImageFactory* image_factory,
46 InProcessContextProvider* shared_context); 47 InProcessContextProvider* shared_context);
47 48
48 // cc::ContextProvider implementation. 49 // cc::ContextProvider implementation.
49 bool BindToCurrentThread() override; 50 bool BindToCurrentThread() override;
(...skipping 11 matching lines...) Expand all
61 // Gives the GL internal format that should be used for calling CopyTexImage2D 62 // Gives the GL internal format that should be used for calling CopyTexImage2D
62 // on the default framebuffer. 63 // on the default framebuffer.
63 uint32_t GetCopyTextureInternalFormat(); 64 uint32_t GetCopyTextureInternalFormat();
64 65
65 private: 66 private:
66 InProcessContextProvider( 67 InProcessContextProvider(
67 const gpu::gles2::ContextCreationAttribHelper& attribs, 68 const gpu::gles2::ContextCreationAttribHelper& attribs,
68 InProcessContextProvider* shared_context, 69 InProcessContextProvider* shared_context,
69 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 70 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
70 gpu::ImageFactory* image_factory, 71 gpu::ImageFactory* image_factory,
71 gfx::AcceleratedWidget window, 72 gpu::SurfaceHandle window,
72 const std::string& debug_name); 73 const std::string& debug_name);
73 ~InProcessContextProvider() override; 74 ~InProcessContextProvider() override;
74 75
75 base::ThreadChecker main_thread_checker_; 76 base::ThreadChecker main_thread_checker_;
76 base::ThreadChecker context_thread_checker_; 77 base::ThreadChecker context_thread_checker_;
77 78
78 std::unique_ptr<gpu::GLInProcessContext> context_; 79 std::unique_ptr<gpu::GLInProcessContext> context_;
79 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; 80 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_;
80 std::unique_ptr<cc::ContextCacheController> cache_controller_; 81 std::unique_ptr<cc::ContextCacheController> cache_controller_;
81 82
82 gpu::gles2::ContextCreationAttribHelper attribs_; 83 gpu::gles2::ContextCreationAttribHelper attribs_;
83 InProcessContextProvider* shared_context_; 84 InProcessContextProvider* shared_context_;
84 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; 85 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_;
85 gpu::ImageFactory* image_factory_; 86 gpu::ImageFactory* image_factory_;
86 gfx::AcceleratedWidget window_; 87 gpu::SurfaceHandle window_;
87 std::string debug_name_; 88 std::string debug_name_;
88 89
89 base::Lock context_lock_; 90 base::Lock context_lock_;
90 91
91 DISALLOW_COPY_AND_ASSIGN(InProcessContextProvider); 92 DISALLOW_COPY_AND_ASSIGN(InProcessContextProvider);
92 }; 93 };
93 94
94 } // namespace ui 95 } // namespace ui
95 96
96 #endif // UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ 97 #endif // UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_
OLDNEW
« no previous file with comments | « ui/compositor/test/in_process_context_factory.cc ('k') | ui/compositor/test/in_process_context_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698