| 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 #include "components/mus/public/cpp/context_provider.h" | 5 #include "components/mus/public/cpp/context_provider.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/gles2/gles2_context.h" | 8 #include "mojo/gles2/gles2_context.h" |
| 9 #include "mojo/gpu/mojo_gles2_impl_autogen.h" | 9 #include "mojo/gpu/mojo_gles2_impl_autogen.h" |
| 10 #include "third_party/mojo/src/mojo/public/cpp/environment/environment.h" | 10 #include "mojo/public/cpp/environment/environment.h" |
| 11 | 11 |
| 12 namespace mus { | 12 namespace mus { |
| 13 | 13 |
| 14 ContextProvider::ContextProvider( | 14 ContextProvider::ContextProvider( |
| 15 mojo::ScopedMessagePipeHandle command_buffer_handle) | 15 mojo::ScopedMessagePipeHandle command_buffer_handle) |
| 16 : command_buffer_handle_(command_buffer_handle.Pass()), context_(nullptr) { | 16 : command_buffer_handle_(command_buffer_handle.Pass()), context_(nullptr) { |
| 17 // Enabled the CHROMIUM_image extension to use GpuMemoryBuffers. The | 17 // Enabled the CHROMIUM_image extension to use GpuMemoryBuffers. The |
| 18 // implementation of which is used in CommandBufferDriver. | 18 // implementation of which is used in CommandBufferDriver. |
| 19 capabilities_.gpu.image = true; | 19 capabilities_.gpu.image = true; |
| 20 } | 20 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 ContextProvider::~ContextProvider() { | 58 ContextProvider::~ContextProvider() { |
| 59 context_gl_.reset(); | 59 context_gl_.reset(); |
| 60 if (context_) | 60 if (context_) |
| 61 MojoGLES2DestroyContext(context_); | 61 MojoGLES2DestroyContext(context_); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void ContextProvider::ContextLost() {} | 64 void ContextProvider::ContextLost() {} |
| 65 | 65 |
| 66 } // namespace mus | 66 } // namespace mus |
| OLD | NEW |