| 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/aura/surface_binding.h" | 5 #include "mojo/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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } | 174 } |
| 175 | 175 |
| 176 scoped_ptr<cc::OutputSurface> | 176 scoped_ptr<cc::OutputSurface> |
| 177 SurfaceBinding::PerViewManagerState::CreateOutputSurface(View* view) { | 177 SurfaceBinding::PerViewManagerState::CreateOutputSurface(View* view) { |
| 178 // TODO(sky): figure out lifetime here. Do I need to worry about the return | 178 // TODO(sky): figure out lifetime here. Do I need to worry about the return |
| 179 // value outliving this? | 179 // value outliving this? |
| 180 CommandBufferPtr cb; | 180 CommandBufferPtr cb; |
| 181 gpu_->CreateOffscreenGLES2Context(GetProxy(&cb)); | 181 gpu_->CreateOffscreenGLES2Context(GetProxy(&cb)); |
| 182 scoped_refptr<cc::ContextProvider> context_provider( | 182 scoped_refptr<cc::ContextProvider> context_provider( |
| 183 new ContextProviderMojo(cb.PassMessagePipe())); | 183 new ContextProviderMojo(cb.PassMessagePipe())); |
| 184 return scoped_ptr<cc::OutputSurface>(new OutputSurfaceImpl( | 184 return make_scoped_ptr(new OutputSurfaceImpl( |
| 185 view, context_provider, surface_.get(), surface_id_allocator_.get())); | 185 view, context_provider, surface_.get(), surface_id_allocator_.get())); |
| 186 } | 186 } |
| 187 | 187 |
| 188 SurfaceBinding::PerViewManagerState::PerViewManagerState( | 188 SurfaceBinding::PerViewManagerState::PerViewManagerState( |
| 189 Shell* shell, | 189 Shell* shell, |
| 190 ViewManager* view_manager) | 190 ViewManager* view_manager) |
| 191 : shell_(shell), view_manager_(view_manager) { | 191 : shell_(shell), view_manager_(view_manager) { |
| 192 } | 192 } |
| 193 | 193 |
| 194 SurfaceBinding::PerViewManagerState::~PerViewManagerState() { | 194 SurfaceBinding::PerViewManagerState::~PerViewManagerState() { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } | 243 } |
| 244 | 244 |
| 245 SurfaceBinding::~SurfaceBinding() { | 245 SurfaceBinding::~SurfaceBinding() { |
| 246 } | 246 } |
| 247 | 247 |
| 248 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { | 248 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { |
| 249 return state_->CreateOutputSurface(view_); | 249 return state_->CreateOutputSurface(view_); |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace mojo | 252 } // namespace mojo |
| OLD | NEW |