| 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 "mojo/cc/context_provider_mojo.h" | 5 #include "mojo/cc/context_provider_mojo.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/public/cpp/environment/environment.h" | 8 #include "mojo/public/cpp/environment/environment.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 return static_cast<gpu::ContextSupport*>( | 39 return static_cast<gpu::ContextSupport*>( |
| 40 MojoGLES2GetContextSupport(context_)); | 40 MojoGLES2GetContextSupport(context_)); |
| 41 } | 41 } |
| 42 | 42 |
| 43 class GrContext* ContextProviderMojo::GrContext() { return NULL; } | 43 class GrContext* ContextProviderMojo::GrContext() { return NULL; } |
| 44 | 44 |
| 45 cc::ContextProvider::Capabilities ContextProviderMojo::ContextCapabilities() { | 45 cc::ContextProvider::Capabilities ContextProviderMojo::ContextCapabilities() { |
| 46 return capabilities_; | 46 return capabilities_; |
| 47 } | 47 } |
| 48 | 48 |
| 49 void ContextProviderMojo::SetupLock() { |
| 50 } |
| 51 |
| 52 base::Lock* ContextProviderMojo::GetLock() { |
| 53 return &context_lock_; |
| 54 } |
| 55 |
| 49 bool ContextProviderMojo::IsContextLost() { | 56 bool ContextProviderMojo::IsContextLost() { |
| 50 return context_lost_; | 57 return context_lost_; |
| 51 } | 58 } |
| 52 bool ContextProviderMojo::DestroyedOnMainThread() { return !context_; } | 59 bool ContextProviderMojo::DestroyedOnMainThread() { return !context_; } |
| 53 | 60 |
| 54 ContextProviderMojo::~ContextProviderMojo() { | 61 ContextProviderMojo::~ContextProviderMojo() { |
| 55 if (context_) | 62 if (context_) |
| 56 MojoGLES2DestroyContext(context_); | 63 MojoGLES2DestroyContext(context_); |
| 57 } | 64 } |
| 58 | 65 |
| 59 void ContextProviderMojo::ContextLost() { | 66 void ContextProviderMojo::ContextLost() { |
| 60 context_lost_ = true; | 67 context_lost_ = true; |
| 61 } | 68 } |
| 62 | 69 |
| 63 } // namespace mojo | 70 } // namespace mojo |
| OLD | NEW |