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

Unified Diff: components/mus/public/cpp/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: 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: components/mus/public/cpp/gpu_service.h
diff --git a/components/mus/public/cpp/gpu_service.h b/components/mus/public/cpp/gpu_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..6792e889cee17062d9d06d6295490c548c5f4194
--- /dev/null
+++ b/components/mus/public/cpp/gpu_service.h
@@ -0,0 +1,66 @@
+// 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_GPU_SERVICE_H_
+#define COMPONENTS_MUS_PUBLIC_CPP_GPU_SERVICE_H_
+
+#include <stdint.h>
+#include <vector>
+
+#include "base/callback.h"
+#include "base/lazy_instance.h"
+#include "base/macros.h"
+#include "base/observer_list.h"
+#include "base/synchronization/waitable_event.h"
+#include "base/threading/thread.h"
+#include "components/mus/common/types.h"
+#include "components/mus/public/cpp/mus_public_export.h"
+#include "components/mus/public/interfaces/mus_constants.mojom.h"
+#include "components/mus/public/interfaces/surface_id.mojom.h"
+#include "components/mus/public/interfaces/window_tree.mojom.h"
+#include "gpu/ipc/client/gpu_channel_host.h"
+#include "mojo/public/cpp/bindings/array.h"
+#include "services/shell/public/interfaces/interface_provider.mojom.h"
+#include "ui/gfx/geometry/insets.h"
+#include "ui/gfx/geometry/rect.h"
+
+namespace shell {
+class Connector;
+}
+
+namespace mus {
+
+class GpuMemoryBufferManagerMus;
+
+class MUS_PUBLIC_EXPORT GpuService : public gpu::GpuChannelHostFactory {
+ public:
+ GpuService();
+ ~GpuService() override;
+
+ scoped_refptr<gpu::GpuChannelHost> gpu_channel_host() { return gpu_channel_; }
+
+ static bool UseChromeGpuCommandBuffer();
+ static void Initialize(shell::Connector* connector);
+ static GpuService* GetInstance();
+
+ private:
+ void Init(shell::Connector* connector);
+
+ // gpu::GpuChannelHostFactory overrides:
+ bool IsMainThread() override;
+ scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override;
+ std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
+ size_t size) override;
+
+ bool initialized_;
+ 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_;
+};
+
+} // namespace mus
+
+#endif // COMPONENTS_MUS_PUBLIC_CPP_GPU_SERVICE_CONNECTION_H_

Powered by Google App Engine
This is Rietveld 408576698