| 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 MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ | 5 #ifndef MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ |
| 6 #define MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ | 6 #define MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 10 #include "cc/output/context_provider.h" | 12 #include "cc/output/context_provider.h" |
| 11 #include "third_party/mojo/src/mojo/public/c/gles2/gles2.h" | 13 #include "third_party/mojo/src/mojo/public/c/gles2/gles2.h" |
| 12 #include "third_party/mojo/src/mojo/public/cpp/system/core.h" | 14 #include "third_party/mojo/src/mojo/public/cpp/system/core.h" |
| 13 | 15 |
| 14 namespace mojo { | 16 namespace mojo { |
| 15 | 17 |
| 16 class ContextProviderMojo : public cc::ContextProvider { | 18 class ContextProviderMojo : public cc::ContextProvider { |
| 17 public: | 19 public: |
| (...skipping 23 matching lines...) Expand all Loading... |
| 41 | 43 |
| 42 private: | 44 private: |
| 43 static void ContextLostThunk(void* closure) { | 45 static void ContextLostThunk(void* closure) { |
| 44 static_cast<ContextProviderMojo*>(closure)->ContextLost(); | 46 static_cast<ContextProviderMojo*>(closure)->ContextLost(); |
| 45 } | 47 } |
| 46 void ContextLost(); | 48 void ContextLost(); |
| 47 | 49 |
| 48 cc::ContextProvider::Capabilities capabilities_; | 50 cc::ContextProvider::Capabilities capabilities_; |
| 49 ScopedMessagePipeHandle command_buffer_handle_; | 51 ScopedMessagePipeHandle command_buffer_handle_; |
| 50 MojoGLES2Context context_; | 52 MojoGLES2Context context_; |
| 53 std::unique_ptr<gpu::gles2::GLES2Interface> context_gl_; |
| 51 bool context_lost_; | 54 bool context_lost_; |
| 52 | 55 |
| 53 base::Lock context_lock_; | 56 base::Lock context_lock_; |
| 54 | 57 |
| 55 DISALLOW_COPY_AND_ASSIGN(ContextProviderMojo); | 58 DISALLOW_COPY_AND_ASSIGN(ContextProviderMojo); |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 } // namespace mojo | 61 } // namespace mojo |
| 59 | 62 |
| 60 #endif // MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ | 63 #endif // MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ |
| OLD | NEW |