Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Unified Diff: components/mus/public/cpp/lib/context_provider.cc

Issue 1976703003: Impl mus::mojom::GpuService to enable using Chrome IPC version gpu CmdBuf in mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/mus/public/cpp/lib/context_provider.cc
diff --git a/components/mus/public/cpp/lib/context_provider.cc b/components/mus/public/cpp/lib/context_provider.cc
index 4ee50263c9c5e79092fcbd798e7597cb05222a64..02717112dd75eff69a77d8350d5c61a666119ac1 100644
--- a/components/mus/public/cpp/lib/context_provider.cc
+++ b/components/mus/public/cpp/lib/context_provider.cc
@@ -8,23 +8,20 @@
#include "base/logging.h"
#include "components/mus/public/cpp/gles2_context.h"
+#include "services/shell/public/cpp/connector.h"
namespace mus {
-ContextProvider::ContextProvider(
- mojo::ScopedMessagePipeHandle command_buffer_handle)
- : command_buffer_handle_(std::move(command_buffer_handle)),
- context_(nullptr) {
-}
+ContextProvider::ContextProvider(shell::Connector* connector)
+ : connector_(connector->Clone()) {}
bool ContextProvider::BindToCurrentThread() {
- mojom::CommandBufferPtr command_buffer_ptr;
- command_buffer_ptr.Bind(mojo::InterfacePtrInfo<mus::mojom::CommandBuffer>(
- std::move(command_buffer_handle_), 0u));
- std::unique_ptr<GLES2Context> context(
- new GLES2Context(std::vector<int32_t>(), std::move(command_buffer_ptr)));
- if (context->Initialize())
- context_ = std::move(context);
+ 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_;
}
« no previous file with comments | « components/mus/public/cpp/lib/command_buffer_client_impl.cc ('k') | components/mus/public/cpp/lib/gles2_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698