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

Unified Diff: components/mus/public/cpp/lib/gpu_service.h

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/gpu_service.h
diff --git a/components/mus/public/cpp/lib/gpu_service.h b/components/mus/public/cpp/lib/gpu_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..571a3537c14dd1c9be8b8ab2effff36afb8d5ae1
--- /dev/null
+++ b/components/mus/public/cpp/lib/gpu_service.h
@@ -0,0 +1,55 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_MUS_PUBLIC_CPP_LIB_GPU_SERVICE_H_
+#define COMPONENTS_MUS_PUBLIC_CPP_LIB_GPU_SERVICE_H_
+
+#include <stdint.h>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/synchronization/waitable_event.h"
+#include "base/threading/thread.h"
+#include "gpu/ipc/client/gpu_channel_host.h"
+
+namespace shell {
+class Connector;
+}
+
+namespace mus {
+
+class GpuMemoryBufferManagerMus;
+
+class GpuService : public gpu::GpuChannelHostFactory {
+ public:
+ scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannel(
+ shell::Connector* connector);
+
+ static bool UseChromeGpuCommandBuffer();
+ static GpuService* GetInstance();
+
+ private:
+ friend struct base::DefaultSingletonTraits<GpuService>;
+
+ GpuService();
+ ~GpuService() override;
+
+ // gpu::GpuChannelHostFactory overrides:
+ bool IsMainThread() override;
+ scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override;
+ std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
+ size_t size) override;
+
+ base::MessageLoop* main_message_loop_;
+ base::WaitableEvent shutdown_event_;
+ base::Thread io_thread_;
+ std::unique_ptr<GpuMemoryBufferManagerMus> gpu_memory_buffer_manager_;
+ scoped_refptr<gpu::GpuChannelHost> gpu_channel_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuService);
+};
+
+} // namespace mus
+
+#endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_GPU_SERVICE_CONNECTION_H_
« no previous file with comments | « components/mus/public/cpp/lib/gpu_memory_buffer_manager_mus.cc ('k') | components/mus/public/cpp/lib/gpu_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698