Index: ui/views/mus/surface_binding.cc |
diff --git a/ui/views/mus/surface_binding.cc b/ui/views/mus/surface_binding.cc |
index 3385914341a0e776853ba471d3c6b1482f59693a..86738c0a93e89be02162f8e933852e60cba025b7 100644 |
--- a/ui/views/mus/surface_binding.cc |
+++ b/ui/views/mus/surface_binding.cc |
@@ -24,9 +24,7 @@ |
#include "components/mus/public/cpp/surfaces/surfaces_type_converters.h" |
#include "components/mus/public/cpp/window.h" |
#include "components/mus/public/cpp/window_tree_connection.h" |
-#include "components/mus/public/interfaces/gpu.mojom.h" |
#include "mojo/public/cpp/bindings/binding.h" |
-#include "services/shell/public/cpp/connector.h" |
#include "ui/views/mus/window_tree_host_mus.h" |
namespace views { |
@@ -58,17 +56,12 @@ class SurfaceBinding::PerConnectionState |
mus::WindowTreeConnection* connection); |
~PerConnectionState(); |
- void Init(); |
- |
static base::LazyInstance< |
base::ThreadLocalPointer<ConnectionToStateMap>>::Leaky window_states; |
shell::Connector* connector_; |
mus::WindowTreeConnection* connection_; |
- // Set of state needed to create an OutputSurface. |
- mus::mojom::GpuPtr gpu_; |
- |
DISALLOW_COPY_AND_ASSIGN(PerConnectionState); |
}; |
@@ -86,10 +79,8 @@ SurfaceBinding::PerConnectionState* SurfaceBinding::PerConnectionState::Get( |
window_map = new ConnectionToStateMap; |
window_states.Pointer()->Set(window_map); |
} |
- if (!(*window_map)[connection]) { |
+ if (!(*window_map)[connection]) |
(*window_map)[connection] = new PerConnectionState(connector, connection); |
- (*window_map)[connection]->Init(); |
- } |
return (*window_map)[connection]; |
} |
@@ -97,15 +88,8 @@ std::unique_ptr<cc::OutputSurface> |
SurfaceBinding::PerConnectionState::CreateOutputSurface( |
mus::Window* window, |
mus::mojom::SurfaceType surface_type) { |
- if (gpu_.encountered_error()) |
- return nullptr; |
- // TODO(sky): figure out lifetime here. Do I need to worry about the return |
- // value outliving this? |
- mus::mojom::CommandBufferPtr cb; |
- gpu_->CreateOffscreenGLES2Context(GetProxy(&cb)); |
- |
scoped_refptr<cc::ContextProvider> context_provider( |
- new mus::ContextProvider(cb.PassInterface().PassHandle())); |
+ new mus::ContextProvider(connector_)); |
return base::WrapUnique(new mus::OutputSurface( |
context_provider, window->RequestSurface(surface_type))); |
} |
@@ -126,16 +110,6 @@ SurfaceBinding::PerConnectionState::~PerConnectionState() { |
} |
} |
-void SurfaceBinding::PerConnectionState::Init() { |
- connector_->ConnectToInterface("mojo:mus", &gpu_); |
- |
- // TODO(sad): If connection is lost (e.g. if gpu crashes), then the |
- // connections need to be restored. https://crbug.com/613366 |
- // TODO(rockot|yzshen): It is necessary to install a connection-error handler, |
- // even if the handler doesn't actually do anything. https://crbug.com/613371 |
- gpu_.set_connection_error_handler([]{}); |
-} |
- |
// SurfaceBinding -------------------------------------------------------------- |
SurfaceBinding::SurfaceBinding(shell::Connector* connector, |