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

Unified Diff: services/ui/gpu/gpu_main.h

Issue 2539893002: Mus: Implement GpuMain mojo interface (Closed)
Patch Set: more cleanup Created 4 years 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: services/ui/gpu/gpu_main.h
diff --git a/services/ui/gpu/gpu_main.h b/services/ui/gpu/gpu_main.h
index b1dde2b2bc92369c8902e4e578b6c5d4ffd759b0..01834789128a21d0a54bf4e821a15d45c4240838 100644
--- a/services/ui/gpu/gpu_main.h
+++ b/services/ui/gpu/gpu_main.h
@@ -6,24 +6,34 @@
#define SERVICES_UI_GPU_GPU_MAIN_H_
#include "base/threading/thread.h"
+#include "gpu/ipc/in_process_command_buffer.h"
#include "gpu/ipc/service/gpu_init.h"
+#include "services/ui/gpu/interfaces/gpu_main.mojom.h"
#include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h"
+#include "services/ui/surfaces/display_compositor.h"
namespace gpu {
class GpuMemoryBufferFactory;
+class ImageFactory;
}
namespace ui {
class GpuServiceInternal;
-class GpuMain : public gpu::GpuSandboxHelper {
+class GpuMain : public gpu::GpuSandboxHelper, public mojom::GpuMain {
public:
- GpuMain();
+ explicit GpuMain(mojom::GpuMainRequest request);
~GpuMain() override;
+ // mojom::GpuMain implementation:
+ void CreateGpuService(mojom::GpuServiceInternalRequest request,
+ const CreateGpuServiceCallback& callback) override;
+ void CreateDisplayCompositor(
+ cc::mojom::DisplayCompositorRequest request,
+ cc::mojom::DisplayCompositorClientPtr client) override;
+
void OnStart();
- void Create(mojom::GpuServiceInternalRequest request);
GpuServiceInternal* gpu_service() { return gpu_service_internal_.get(); }
@@ -32,9 +42,21 @@ class GpuMain : public gpu::GpuSandboxHelper {
scoped_refptr<base::SingleThreadTaskRunner> io_runner,
scoped_refptr<base::SingleThreadTaskRunner> compositor_runner);
+ void CreateDisplayCompositorInternal(
+ cc::mojom::DisplayCompositorRequest request,
+ cc::mojom::DisplayCompositorClientPtrInfo client_info);
+ void CreateDisplayCompositorOnCompositorThread(
+ gpu::ImageFactory* image_factory,
+ mojom::GpuServiceInternalPtrInfo gpu_service_info,
+ cc::mojom::DisplayCompositorRequest request,
+ cc::mojom::DisplayCompositorClientPtrInfo client_info);
+ void CreateGpuServiceOnGpuThread(
+ mojom::GpuServiceInternalRequest request,
+ scoped_refptr<base::SingleThreadTaskRunner> origin_runner,
+ const CreateGpuServiceCallback& callback);
+
void TearDownOnCompositorThread();
void TearDownOnGpuThread();
- void CreateOnGpuThread(mojom::GpuServiceInternalRequest request);
// gpu::GpuSandboxHelper:
void PreSandboxStartup() override;
@@ -43,6 +65,22 @@ class GpuMain : public gpu::GpuSandboxHelper {
std::unique_ptr<gpu::GpuInit> gpu_init_;
std::unique_ptr<GpuServiceInternal> gpu_service_internal_;
+
+ // The message-pipe used by the DisplayCompositor to request gpu memory
+ // buffers.
+ mojom::GpuServiceInternalPtr gpu_internal_;
+
+ // The InCommandCommandBuffer::Service used by the display compositor.
+ scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_command_service_;
+
+ // If the gpu service is not yet ready then we stash pending MessagePipes in
+ // these member variables.
+ cc::mojom::DisplayCompositorRequest pending_display_compositor_request_;
+ cc::mojom::DisplayCompositorClientPtrInfo
+ pending_display_compositor_client_info_;
+
+ std::unique_ptr<DisplayCompositor> display_compositor_;
+
std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory_;
// The main thread for GpuService.
@@ -54,7 +92,7 @@ class GpuMain : public gpu::GpuSandboxHelper {
// The thread used for the display compositor.
base::Thread compositor_thread_;
- base::WeakPtrFactory<GpuMain> weak_factory_;
+ mojo::Binding<mojom::GpuMain> binding_;
DISALLOW_COPY_AND_ASSIGN(GpuMain);
};

Powered by Google App Engine
This is Rietveld 408576698