OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 5 #ifndef BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
6 #define BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 6 #define BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 Capabilities ContextCapabilities() override; | 28 Capabilities ContextCapabilities() override; |
29 gpu::gles2::GLES2Interface* ContextGL() override; | 29 gpu::gles2::GLES2Interface* ContextGL() override; |
30 gpu::ContextSupport* ContextSupport() override; | 30 gpu::ContextSupport* ContextSupport() override; |
31 class GrContext* GrContext() override; | 31 class GrContext* GrContext() override; |
32 void InvalidateGrContext(uint32_t state) override; | 32 void InvalidateGrContext(uint32_t state) override; |
33 void SetupLock() override; | 33 void SetupLock() override; |
34 base::Lock* GetLock() override; | 34 base::Lock* GetLock() override; |
35 void DeleteCachedResources() override; | 35 void DeleteCachedResources() override; |
36 void SetLostContextCallback( | 36 void SetLostContextCallback( |
37 const LostContextCallback& lost_context_callback) override; | 37 const LostContextCallback& lost_context_callback) override; |
| 38 void SetMemoryPolicyChangedCallback( |
| 39 const MemoryPolicyChangedCallback& memory_policy_changed_callback) |
| 40 override; |
38 | 41 |
39 protected: | 42 protected: |
40 explicit BlimpContextProvider(gfx::AcceleratedWidget widget); | 43 explicit BlimpContextProvider(gfx::AcceleratedWidget widget); |
41 ~BlimpContextProvider() override; | 44 ~BlimpContextProvider() override; |
42 | 45 |
43 private: | 46 private: |
44 void OnLostContext(); | 47 void OnLostContext(); |
45 | 48 |
46 base::ThreadChecker main_thread_checker_; | 49 base::ThreadChecker main_thread_checker_; |
47 base::ThreadChecker context_thread_checker_; | 50 base::ThreadChecker context_thread_checker_; |
48 | 51 |
49 base::Lock context_lock_; | 52 base::Lock context_lock_; |
50 scoped_ptr<gpu::GLInProcessContext> context_; | 53 scoped_ptr<gpu::GLInProcessContext> context_; |
51 skia::RefPtr<class GrContext> gr_context_; | 54 skia::RefPtr<class GrContext> gr_context_; |
52 | 55 |
53 cc::ContextProvider::Capabilities capabilities_; | 56 cc::ContextProvider::Capabilities capabilities_; |
54 | 57 |
55 LostContextCallback lost_context_callback_; | 58 LostContextCallback lost_context_callback_; |
56 | 59 |
57 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); | 60 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); |
58 }; | 61 }; |
59 | 62 |
60 } // namespace blimp | 63 } // namespace blimp |
61 | 64 |
62 #endif // BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 65 #endif // BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
OLD | NEW |