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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 DCHECK(window_map); | 117 DCHECK(window_map); |
118 DCHECK_EQ(this, (*window_map)[connection_]); | 118 DCHECK_EQ(this, (*window_map)[connection_]); |
119 window_map->erase(connection_); | 119 window_map->erase(connection_); |
120 if (window_map->empty()) { | 120 if (window_map->empty()) { |
121 delete window_map; | 121 delete window_map; |
122 window_states.Pointer()->Set(nullptr); | 122 window_states.Pointer()->Set(nullptr); |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
126 void SurfaceBinding::PerConnectionState::Init() { | 126 void SurfaceBinding::PerConnectionState::Init() { |
127 shell_->ConnectToService("mojo:mus", &gpu_); | 127 shell_->ConnectToInterface("mojo:mus", &gpu_); |
128 } | 128 } |
129 | 129 |
130 // SurfaceBinding -------------------------------------------------------------- | 130 // SurfaceBinding -------------------------------------------------------------- |
131 | 131 |
132 SurfaceBinding::SurfaceBinding(mojo::Shell* shell, | 132 SurfaceBinding::SurfaceBinding(mojo::Shell* shell, |
133 mus::Window* window, | 133 mus::Window* window, |
134 mus::mojom::SurfaceType surface_type) | 134 mus::mojom::SurfaceType surface_type) |
135 : window_(window), | 135 : window_(window), |
136 surface_type_(surface_type), | 136 surface_type_(surface_type), |
137 state_(PerConnectionState::Get(shell, window->connection())) {} | 137 state_(PerConnectionState::Get(shell, window->connection())) {} |
138 | 138 |
139 SurfaceBinding::~SurfaceBinding() {} | 139 SurfaceBinding::~SurfaceBinding() {} |
140 | 140 |
141 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { | 141 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { |
142 return state_->CreateOutputSurface(window_, surface_type_); | 142 return state_->CreateOutputSurface(window_, surface_type_); |
143 } | 143 } |
144 | 144 |
145 } // namespace views | 145 } // namespace views |
OLD | NEW |