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