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