| Index: services/ui/public/cpp/lib/context_provider.cc
|
| diff --git a/services/ui/public/cpp/lib/context_provider.cc b/services/ui/public/cpp/lib/context_provider.cc
|
| index bed839e227e6f76497e15bf6ca8a99bc964dcca3..30c4c8647878d90eca0b0a5f03b0b7b37bf9c352 100644
|
| --- a/services/ui/public/cpp/lib/context_provider.cc
|
| +++ b/services/ui/public/cpp/lib/context_provider.cc
|
| @@ -7,14 +7,21 @@
|
| #include <stdint.h>
|
|
|
| #include "base/logging.h"
|
| +#include "services/shell/public/cpp/connector.h"
|
| #include "services/ui/public/cpp/gles2_context.h"
|
|
|
| namespace ui {
|
|
|
| -ContextProvider::ContextProvider() {}
|
| +ContextProvider::ContextProvider(shell::Connector* connector)
|
| + : connector_(connector->Clone()) {}
|
|
|
| bool ContextProvider::BindToCurrentThread() {
|
| - context_ = GLES2Context::CreateOffscreenContext(std::vector<int32_t>());
|
| + if (connector_) {
|
| + context_ = GLES2Context::CreateOffscreenContext(std::vector<int32_t>(),
|
| + connector_.get());
|
| + // We don't need the connector anymore, so release it.
|
| + connector_.reset();
|
| + }
|
| return !!context_;
|
| }
|
|
|
|
|