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

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

Issue 1336733002: Re-land: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerTreeHostClientTakeAwayOutputSurface test. Content provider is always destroyed on the clie… Created 5 years, 2 months 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
« no previous file with comments | « ui/compositor/test/in_process_context_factory.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 20 matching lines...) Expand all
31 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 31 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
32 gpu::ImageFactory* image_factory, 32 gpu::ImageFactory* image_factory,
33 gfx::AcceleratedWidget window, 33 gfx::AcceleratedWidget window,
34 const std::string& debug_name); 34 const std::string& debug_name);
35 35
36 // Uses default attributes for creating an offscreen context. 36 // Uses default attributes for creating an offscreen context.
37 static scoped_refptr<InProcessContextProvider> CreateOffscreen( 37 static scoped_refptr<InProcessContextProvider> CreateOffscreen(
38 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 38 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
39 gpu::ImageFactory* image_factory); 39 gpu::ImageFactory* image_factory);
40 40
41 private:
42 InProcessContextProvider(
43 const gpu::gles2::ContextCreationAttribHelper& attribs,
44 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
45 gpu::ImageFactory* image_factory,
46 gfx::AcceleratedWidget window,
47 const std::string& debug_name);
48 ~InProcessContextProvider() override;
49
50 // cc::ContextProvider: 41 // cc::ContextProvider:
51 bool BindToCurrentThread() override; 42 bool BindToCurrentThread() override;
52 void DetachFromThread() override; 43 void DetachFromThread() override;
53 Capabilities ContextCapabilities() override; 44 Capabilities ContextCapabilities() override;
54 gpu::gles2::GLES2Interface* ContextGL() override; 45 gpu::gles2::GLES2Interface* ContextGL() override;
55 gpu::ContextSupport* ContextSupport() override; 46 gpu::ContextSupport* ContextSupport() override;
56 class GrContext* GrContext() override; 47 class GrContext* GrContext() override;
57 void InvalidateGrContext(uint32_t state) override; 48 void InvalidateGrContext(uint32_t state) override;
58 void SetupLock() override; 49 void SetupLock() override;
59 base::Lock* GetLock() override; 50 base::Lock* GetLock() override;
60 void VerifyContexts() override; 51 void VerifyContexts() override;
61 void DeleteCachedResources() override; 52 void DeleteCachedResources() override;
62 bool DestroyedOnMainThread() override; 53 bool DestroyedOnMainThread() override;
63 void SetLostContextCallback( 54 void SetLostContextCallback(
64 const LostContextCallback& lost_context_callback) override; 55 const LostContextCallback& lost_context_callback) override;
65 void SetMemoryPolicyChangedCallback( 56 void SetMemoryPolicyChangedCallback(
66 const MemoryPolicyChangedCallback& memory_policy_changed_callback) 57 const MemoryPolicyChangedCallback& memory_policy_changed_callback)
67 override; 58 override;
68 59
60 private:
61 InProcessContextProvider(
62 const gpu::gles2::ContextCreationAttribHelper& attribs,
63 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
64 gpu::ImageFactory* image_factory,
65 gfx::AcceleratedWidget window,
66 const std::string& debug_name);
67 ~InProcessContextProvider() override;
68
69 void OnLostContext(); 69 void OnLostContext();
70 70
71 base::ThreadChecker main_thread_checker_; 71 base::ThreadChecker main_thread_checker_;
72 base::ThreadChecker context_thread_checker_; 72 base::ThreadChecker context_thread_checker_;
73 73
74 scoped_ptr<gpu::GLInProcessContext> context_; 74 scoped_ptr<gpu::GLInProcessContext> context_;
75 skia::RefPtr<class GrContext> gr_context_; 75 skia::RefPtr<class GrContext> gr_context_;
76 76
77 gpu::gles2::ContextCreationAttribHelper attribs_; 77 gpu::gles2::ContextCreationAttribHelper attribs_;
78 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; 78 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_;
79 gpu::ImageFactory* image_factory_; 79 gpu::ImageFactory* image_factory_;
80 gfx::AcceleratedWidget window_; 80 gfx::AcceleratedWidget window_;
81 std::string debug_name_; 81 std::string debug_name_;
82 cc::ContextProvider::Capabilities capabilities_; 82 cc::ContextProvider::Capabilities capabilities_;
83 83
84 LostContextCallback lost_context_callback_; 84 LostContextCallback lost_context_callback_;
85 85
86 base::Lock destroyed_lock_; 86 base::Lock destroyed_lock_;
87 bool destroyed_; 87 bool destroyed_;
88 88
89 base::Lock context_lock_; 89 base::Lock context_lock_;
90 90
91 DISALLOW_COPY_AND_ASSIGN(InProcessContextProvider); 91 DISALLOW_COPY_AND_ASSIGN(InProcessContextProvider);
92 }; 92 };
93 93
94 } // namespace ui 94 } // namespace ui
95 95
96 #endif // UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_ 96 #endif // UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_PROVIDER_H_
OLDNEW
« no previous file with comments | « ui/compositor/test/in_process_context_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698