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

Unified Diff: ui/views/mus/surface_binding.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
Index: ui/views/mus/surface_binding.cc
diff --git a/ui/views/mus/surface_binding.cc b/ui/views/mus/surface_binding.cc
index a3dc98fb7304f2ad4a5c85cb9b99d714bc5ce0fe..72fa2ad86fe50d2723bb65a3bcd0bcfdd34ce17f 100644
--- a/ui/views/mus/surface_binding.cc
+++ b/ui/views/mus/surface_binding.cc
@@ -20,6 +20,7 @@
#include "cc/output/software_output_device.h"
#include "cc/resources/shared_bitmap_manager.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/cpp/window.h"
#include "components/mus/public/cpp/window_tree_connection.h"
@@ -100,13 +101,18 @@ SurfaceBinding::PerConnectionState::CreateOutputSurface(
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));
-
+ mojo::ScopedMessagePipeHandle scoped_handle;
+ if (!mus::GpuService::UseChromeGpuCommandBuffer()) {
+ // 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_handle = cb.PassInterface().PassHandle();
+ } else {
+ mus::GpuService::Initialize(connector_);
+ }
scoped_refptr<cc::ContextProvider> context_provider(
- new mus::ContextProvider(cb.PassInterface().PassHandle()));
+ new mus::ContextProvider(std::move(scoped_handle)));
return base::WrapUnique(new mus::OutputSurface(
context_provider, window->RequestSurface(surface_type)));
}
« content/renderer/mus/render_widget_mus_connection.cc ('K') | « media/gpu/ipc/service/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698