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_FEATURE_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 5 #ifndef BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
6 #define BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 6 #define BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 30 matching lines...) Expand all Loading... |
41 base::Lock* GetLock() override; | 41 base::Lock* GetLock() override; |
42 void DeleteCachedResources() override; | 42 void DeleteCachedResources() override; |
43 void SetLostContextCallback( | 43 void SetLostContextCallback( |
44 const LostContextCallback& lost_context_callback) override; | 44 const LostContextCallback& lost_context_callback) override; |
45 | 45 |
46 // Gives the GL internal format that should be used for calling CopyTexImage2D | 46 // Gives the GL internal format that should be used for calling CopyTexImage2D |
47 // on the default framebuffer. | 47 // on the default framebuffer. |
48 uint32_t GetCopyTextureInternalFormat(); | 48 uint32_t GetCopyTextureInternalFormat(); |
49 | 49 |
50 protected: | 50 protected: |
51 BlimpContextProvider( | 51 BlimpContextProvider(gfx::AcceleratedWidget widget, |
52 gfx::AcceleratedWidget widget, | 52 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); |
53 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); | |
54 ~BlimpContextProvider() override; | 53 ~BlimpContextProvider() override; |
55 | 54 |
56 private: | 55 private: |
57 void OnLostContext(); | 56 void OnLostContext(); |
58 | 57 |
59 base::ThreadChecker main_thread_checker_; | 58 base::ThreadChecker main_thread_checker_; |
60 base::ThreadChecker context_thread_checker_; | 59 base::ThreadChecker context_thread_checker_; |
61 | 60 |
62 std::unique_ptr<gpu::GLInProcessContext> context_; | 61 std::unique_ptr<gpu::GLInProcessContext> context_; |
63 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; | 62 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |
64 | 63 |
65 LostContextCallback lost_context_callback_; | 64 LostContextCallback lost_context_callback_; |
66 | 65 |
67 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); | 66 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); |
68 }; | 67 }; |
69 | 68 |
70 } // namespace client | 69 } // namespace client |
71 } // namespace blimp | 70 } // namespace blimp |
72 | 71 |
73 #endif // BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 72 #endif // BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
OLD | NEW |