| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "cc/output/in_process_context_provider.h" | 5 #include "cc/output/in_process_context_provider.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 gpu::ContextSupport* InProcessContextProvider::ContextSupport() { | 98 gpu::ContextSupport* InProcessContextProvider::ContextSupport() { |
| 99 return context_->GetImplementation(); | 99 return context_->GetImplementation(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 class GrContext* InProcessContextProvider::GrContext() { | 102 class GrContext* InProcessContextProvider::GrContext() { |
| 103 if (gr_context_) | 103 if (gr_context_) |
| 104 return gr_context_->get(); | 104 return gr_context_->get(); |
| 105 | 105 |
| 106 gr_context_.reset(new skia_bindings::GrContextForGLES2Interface(ContextGL())); | 106 gr_context_.reset(new skia_bindings::GrContextForGLES2Interface( |
| 107 ContextGL(), ContextCapabilities())); |
| 107 return gr_context_->get(); | 108 return gr_context_->get(); |
| 108 } | 109 } |
| 109 | 110 |
| 110 ContextCacheController* InProcessContextProvider::CacheController() { | 111 ContextCacheController* InProcessContextProvider::CacheController() { |
| 111 return cache_controller_.get(); | 112 return cache_controller_.get(); |
| 112 } | 113 } |
| 113 | 114 |
| 114 void InProcessContextProvider::InvalidateGrContext(uint32_t state) { | 115 void InProcessContextProvider::InvalidateGrContext(uint32_t state) { |
| 115 if (gr_context_) | 116 if (gr_context_) |
| 116 gr_context_->ResetContext(state); | 117 gr_context_->ResetContext(state); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 145 context_->SetSwapBuffersCompletionCallback(callback); | 146 context_->SetSwapBuffersCompletionCallback(callback); |
| 146 } | 147 } |
| 147 | 148 |
| 148 void InProcessContextProvider::SetUpdateVSyncParametersCallback( | 149 void InProcessContextProvider::SetUpdateVSyncParametersCallback( |
| 149 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& | 150 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& |
| 150 callback) { | 151 callback) { |
| 151 context_->SetUpdateVSyncParametersCallback(callback); | 152 context_->SetUpdateVSyncParametersCallback(callback); |
| 152 } | 153 } |
| 153 | 154 |
| 154 } // namespace cc | 155 } // namespace cc |
| OLD | NEW |