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

Unified Diff: content/renderer/mus/render_widget_mus_connection.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: Update Created 4 years, 7 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
« no previous file with comments | « components/mus/ws/BUILD.gn ('k') | mash/login/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/mus/render_widget_mus_connection.cc
diff --git a/content/renderer/mus/render_widget_mus_connection.cc b/content/renderer/mus/render_widget_mus_connection.cc
index d1821e8bac0acd3a2cc2f58f24cd5d15ba45ce86..14c3f8dd117e1d493328e734621e23d25beeb43a 100644
--- a/content/renderer/mus/render_widget_mus_connection.cc
+++ b/content/renderer/mus/render_widget_mus_connection.cc
@@ -9,6 +9,7 @@
#include "base/lazy_instance.h"
#include "base/macros.h"
#include "components/mus/public/cpp/context_provider.h"
+#include "components/mus/public/cpp/gpu_service.h"
#include "components/mus/public/cpp/output_surface.h"
#include "components/mus/public/interfaces/command_buffer.mojom.h"
#include "components/mus/public/interfaces/compositor_frame.mojom.h"
@@ -49,13 +50,20 @@ std::unique_ptr<cc::OutputSurface>
RenderWidgetMusConnection::CreateOutputSurface() {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(!window_surface_binding_);
- mus::mojom::GpuPtr gpu_service;
- MojoShellConnection::Get()->GetConnector()->ConnectToInterface("mojo:mus",
- &gpu_service);
- mus::mojom::CommandBufferPtr cb;
- gpu_service->CreateOffscreenGLES2Context(GetProxy(&cb));
+ mojo::ScopedMessagePipeHandle scoped_handle;
+ if (mus::GpuService::UseChromeGpuCommandBuffer()) {
piman 2016/05/25 22:53:17 did you mean !mus::GpuService::UseChromeGpuCommand
Peng 2016/05/31 14:24:04 Done.
+ mus::mojom::GpuPtr gpu_service;
+ MojoShellConnection::Get()->GetConnector()->ConnectToInterface(
+ "mojo:mus", &gpu_service);
+ mus::mojom::CommandBufferPtr cb;
+ gpu_service->CreateOffscreenGLES2Context(GetProxy(&cb));
+ scoped_handle = cb.PassInterface().PassHandle();
+ } else {
+ mus::GpuService::Initialize(MojoShellConnection::Get()->GetConnector());
+ }
scoped_refptr<cc::ContextProvider> context_provider(
- new mus::ContextProvider(cb.PassInterface().PassHandle()));
+ new mus::ContextProvider(std::move(scoped_handle)));
+
std::unique_ptr<cc::OutputSurface> surface(new mus::OutputSurface(
context_provider, mus::WindowSurface::Create(&window_surface_binding_)));
if (compositor_mus_connection_) {
« no previous file with comments | « components/mus/ws/BUILD.gn ('k') | mash/login/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698