| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mandoline/ui/aura/surface_binding.h" | 5 #include "mandoline/ui/aura/surface_binding.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 return (*view_map)[view_manager]; | 167 return (*view_map)[view_manager]; |
| 168 } | 168 } |
| 169 | 169 |
| 170 scoped_ptr<cc::OutputSurface> | 170 scoped_ptr<cc::OutputSurface> |
| 171 SurfaceBinding::PerViewManagerState::CreateOutputSurface(mojo::View* view) { | 171 SurfaceBinding::PerViewManagerState::CreateOutputSurface(mojo::View* view) { |
| 172 // TODO(sky): figure out lifetime here. Do I need to worry about the return | 172 // TODO(sky): figure out lifetime here. Do I need to worry about the return |
| 173 // value outliving this? | 173 // value outliving this? |
| 174 mojo::CommandBufferPtr cb; | 174 mojo::CommandBufferPtr cb; |
| 175 gpu_->CreateOffscreenGLES2Context(GetProxy(&cb)); | 175 gpu_->CreateOffscreenGLES2Context(GetProxy(&cb)); |
| 176 scoped_refptr<cc::ContextProvider> context_provider( | 176 scoped_refptr<cc::ContextProvider> context_provider( |
| 177 new mojo::ContextProviderMojo(cb.PassMessagePipe())); | 177 new mojo::ContextProviderMojo(cb.PassInterface().PassHandle())); |
| 178 return make_scoped_ptr(new OutputSurfaceImpl( | 178 return make_scoped_ptr(new OutputSurfaceImpl( |
| 179 view, context_provider, surface_.get(), id_namespace_, &next_local_id_)); | 179 view, context_provider, surface_.get(), id_namespace_, &next_local_id_)); |
| 180 } | 180 } |
| 181 | 181 |
| 182 SurfaceBinding::PerViewManagerState::PerViewManagerState( | 182 SurfaceBinding::PerViewManagerState::PerViewManagerState( |
| 183 mojo::Shell* shell, | 183 mojo::Shell* shell, |
| 184 mojo::ViewManager* view_manager) | 184 mojo::ViewManager* view_manager) |
| 185 : shell_(shell), | 185 : shell_(shell), |
| 186 view_manager_(view_manager), | 186 view_manager_(view_manager), |
| 187 returner_binding_(this), | 187 returner_binding_(this), |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 244 } |
| 245 | 245 |
| 246 SurfaceBinding::~SurfaceBinding() { | 246 SurfaceBinding::~SurfaceBinding() { |
| 247 } | 247 } |
| 248 | 248 |
| 249 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { | 249 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { |
| 250 return state_->CreateOutputSurface(view_); | 250 return state_->CreateOutputSurface(view_); |
| 251 } | 251 } |
| 252 | 252 |
| 253 } // namespace mandoline | 253 } // namespace mandoline |
| OLD | NEW |