| 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> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/synchronization/lock.h" | |
| 14 #include "cc/output/context_provider.h" | 13 #include "cc/output/context_provider.h" |
| 15 #include "mojo/public/c/gles2/gles2_types.h" | 14 #include "mojo/public/c/gles2/gles2_types.h" |
| 16 #include "mojo/public/cpp/system/core.h" | 15 #include "mojo/public/cpp/system/core.h" |
| 17 | 16 |
| 18 namespace mus { | 17 namespace mus { |
| 19 | 18 |
| 20 class ContextProvider : public cc::ContextProvider { | 19 class ContextProvider : public cc::ContextProvider { |
| 21 public: | 20 public: |
| 22 explicit ContextProvider(mojo::ScopedMessagePipeHandle command_buffer_handle); | 21 explicit ContextProvider(mojo::ScopedMessagePipeHandle command_buffer_handle); |
| 23 | 22 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 41 private: | 40 private: |
| 42 static void ContextLostThunk(void* closure) { | 41 static void ContextLostThunk(void* closure) { |
| 43 static_cast<ContextProvider*>(closure)->ContextLost(); | 42 static_cast<ContextProvider*>(closure)->ContextLost(); |
| 44 } | 43 } |
| 45 void ContextLost(); | 44 void ContextLost(); |
| 46 | 45 |
| 47 mojo::ScopedMessagePipeHandle command_buffer_handle_; | 46 mojo::ScopedMessagePipeHandle command_buffer_handle_; |
| 48 MojoGLES2Context context_; | 47 MojoGLES2Context context_; |
| 49 std::unique_ptr<gpu::gles2::GLES2Interface> context_gl_; | 48 std::unique_ptr<gpu::gles2::GLES2Interface> context_gl_; |
| 50 | 49 |
| 51 base::Lock context_lock_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(ContextProvider); | 50 DISALLOW_COPY_AND_ASSIGN(ContextProvider); |
| 54 }; | 51 }; |
| 55 | 52 |
| 56 } // namespace mus | 53 } // namespace mus |
| 57 | 54 |
| 58 #endif // COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ | 55 #endif // COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ |
| OLD | NEW |