| 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 "ui/views/mus/surface_binding.h" | 5 #include "ui/views/mus/surface_binding.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 11 #include "base/threading/thread_local.h" | 12 #include "base/threading/thread_local.h" |
| 12 #include "cc/output/compositor_frame.h" | 13 #include "cc/output/compositor_frame.h" |
| 13 #include "cc/output/output_surface.h" | 14 #include "cc/output/output_surface.h" |
| 14 #include "cc/output/output_surface_client.h" | 15 #include "cc/output/output_surface_client.h" |
| 15 #include "cc/output/software_output_device.h" | 16 #include "cc/output/software_output_device.h" |
| 16 #include "cc/resources/shared_bitmap_manager.h" | 17 #include "cc/resources/shared_bitmap_manager.h" |
| 17 #include "components/mus/public/cpp/context_provider.h" | 18 #include "components/mus/public/cpp/context_provider.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 if (window_map->empty()) { | 122 if (window_map->empty()) { |
| 122 delete window_map; | 123 delete window_map; |
| 123 window_states.Pointer()->Set(nullptr); | 124 window_states.Pointer()->Set(nullptr); |
| 124 } | 125 } |
| 125 } | 126 } |
| 126 | 127 |
| 127 void SurfaceBinding::PerConnectionState::Init() { | 128 void SurfaceBinding::PerConnectionState::Init() { |
| 128 mojo::ServiceProviderPtr service_provider; | 129 mojo::ServiceProviderPtr service_provider; |
| 129 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 130 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
| 130 request->url = mojo::String::From("mojo:mus"); | 131 request->url = mojo::String::From("mojo:mus"); |
| 131 shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), | 132 shell_->ConnectToApplication(std::move(request), GetProxy(&service_provider), |
| 132 nullptr, | 133 nullptr, |
| 133 mojo::CreatePermissiveCapabilityFilter(), | 134 mojo::CreatePermissiveCapabilityFilter(), |
| 134 base::Bind(&OnGotContentHandlerID)); | 135 base::Bind(&OnGotContentHandlerID)); |
| 135 ConnectToService(service_provider.get(), &gpu_); | 136 ConnectToService(service_provider.get(), &gpu_); |
| 136 } | 137 } |
| 137 | 138 |
| 138 // SurfaceBinding -------------------------------------------------------------- | 139 // SurfaceBinding -------------------------------------------------------------- |
| 139 | 140 |
| 140 SurfaceBinding::SurfaceBinding(mojo::Shell* shell, | 141 SurfaceBinding::SurfaceBinding(mojo::Shell* shell, |
| 141 mus::Window* window, | 142 mus::Window* window, |
| 142 mus::mojom::SurfaceType surface_type) | 143 mus::mojom::SurfaceType surface_type) |
| 143 : window_(window), | 144 : window_(window), |
| 144 surface_type_(surface_type), | 145 surface_type_(surface_type), |
| 145 state_(PerConnectionState::Get(shell, window->connection())) {} | 146 state_(PerConnectionState::Get(shell, window->connection())) {} |
| 146 | 147 |
| 147 SurfaceBinding::~SurfaceBinding() {} | 148 SurfaceBinding::~SurfaceBinding() {} |
| 148 | 149 |
| 149 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { | 150 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { |
| 150 return state_->CreateOutputSurface(window_, surface_type_); | 151 return state_->CreateOutputSurface(window_, surface_type_); |
| 151 } | 152 } |
| 152 | 153 |
| 153 } // namespace views | 154 } // namespace views |
| OLD | NEW |