OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ |
6 #define COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 20 matching lines...) Expand all Loading... |
31 gpu::Capabilities ContextCapabilities() override; | 31 gpu::Capabilities ContextCapabilities() override; |
32 void DeleteCachedResources() override {} | 32 void DeleteCachedResources() override {} |
33 void SetLostContextCallback( | 33 void SetLostContextCallback( |
34 const LostContextCallback& lost_context_callback) override {} | 34 const LostContextCallback& lost_context_callback) override {} |
35 | 35 |
36 protected: | 36 protected: |
37 friend class base::RefCountedThreadSafe<ContextProvider>; | 37 friend class base::RefCountedThreadSafe<ContextProvider>; |
38 ~ContextProvider() override; | 38 ~ContextProvider() override; |
39 | 39 |
40 private: | 40 private: |
41 static void ContextLostThunk(void* closure) { | |
42 static_cast<ContextProvider*>(closure)->ContextLost(); | |
43 } | |
44 void ContextLost(); | |
45 | |
46 mojo::ScopedMessagePipeHandle command_buffer_handle_; | 41 mojo::ScopedMessagePipeHandle command_buffer_handle_; |
47 std::unique_ptr<GLES2Context> context_; | 42 std::unique_ptr<GLES2Context> context_; |
48 | 43 |
49 DISALLOW_COPY_AND_ASSIGN(ContextProvider); | 44 DISALLOW_COPY_AND_ASSIGN(ContextProvider); |
50 }; | 45 }; |
51 | 46 |
52 } // namespace mus | 47 } // namespace mus |
53 | 48 |
54 #endif // COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ | 49 #endif // COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ |
OLD | NEW |