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

Unified Diff: components/mus/gpu/gpu_service_mus.h

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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
« no previous file with comments | « components/mus/gpu/gpu_service_impl.cc ('k') | components/mus/gpu/gpu_service_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/gpu/gpu_service_mus.h
diff --git a/components/mus/gpu/gpu_service_mus.h b/components/mus/gpu/gpu_service_mus.h
deleted file mode 100644
index b6bfd1b69f59036f845de51d5b5968cd72e7c164..0000000000000000000000000000000000000000
--- a/components/mus/gpu/gpu_service_mus.h
+++ /dev/null
@@ -1,173 +0,0 @@
-// 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_GPU_GPU_SERVICE_MUS_H_
-#define COMPONENTS_MUS_GPU_GPU_SERVICE_MUS_H_
-
-#include "base/callback.h"
-#include "base/synchronization/waitable_event.h"
-#include "base/threading/non_thread_safe.h"
-#include "base/threading/thread.h"
-#include "build/build_config.h"
-#include "gpu/command_buffer/service/gpu_preferences.h"
-#include "gpu/config/gpu_info.h"
-#include "gpu/ipc/client/gpu_channel_host.h"
-#include "gpu/ipc/common/surface_handle.h"
-#include "gpu/ipc/service/gpu_channel.h"
-#include "gpu/ipc/service/gpu_channel_manager.h"
-#include "gpu/ipc/service/gpu_channel_manager_delegate.h"
-#include "gpu/ipc/service/gpu_config.h"
-#include "gpu/ipc/service/x_util.h"
-#include "ui/gfx/native_widget_types.h"
-
-namespace base {
-template <typename T>
-struct DefaultSingletonTraits;
-}
-
-namespace IPC {
-struct ChannelHandle;
-}
-
-namespace gpu {
-class GpuChannelHost;
-class GpuMemoryBufferFactory;
-class SyncPointManager;
-}
-
-namespace media {
-class MediaService;
-}
-
-namespace mus {
-
-class MusGpuMemoryBufferManager;
-
-// TODO(fsamuel): GpuServiceMus is intended to be the Gpu thread within Mus.
-// Similar to GpuChildThread, it is a GpuChannelManagerDelegate and will have a
-// GpuChannelManager.
-class GpuServiceMus : public gpu::GpuChannelManagerDelegate,
- public gpu::GpuChannelHostFactory,
- public base::NonThreadSafe {
- public:
- typedef base::Callback<void(int client_id, const IPC::ChannelHandle&)>
- EstablishGpuChannelCallback;
- void EstablishGpuChannel(uint64_t client_tracing_id,
- bool preempts,
- bool allow_view_command_buffers,
- bool allow_real_time_streams,
- const EstablishGpuChannelCallback& callback);
- gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
- gfx::GpuMemoryBufferId id,
- const gfx::Size& size,
- gfx::BufferFormat format,
- gfx::BufferUsage usage,
- int client_id,
- gpu::SurfaceHandle surface_handle);
- gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromeHandle(
- gfx::GpuMemoryBufferHandle buffer_handle,
- gfx::GpuMemoryBufferId id,
- const gfx::Size& size,
- gfx::BufferFormat format,
- int client_id);
- void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
- int client_id,
- const gpu::SyncToken& sync_token);
-
- gpu::GpuChannelManager* gpu_channel_manager() const {
- return gpu_channel_manager_.get();
- }
-
- gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory() const {
- return gpu_memory_buffer_factory_.get();
- }
-
- scoped_refptr<gpu::GpuChannelHost> gpu_channel_local() const {
- return gpu_channel_local_;
- }
-
- const gpu::GPUInfo& gpu_info() const { return gpu_info_; }
-
- // GpuChannelManagerDelegate overrides:
- void DidCreateOffscreenContext(const GURL& active_url) override;
- void DidDestroyChannel(int client_id) override;
- void DidDestroyOffscreenContext(const GURL& active_url) override;
- void DidLoseContext(bool offscreen,
- gpu::error::ContextLostReason reason,
- const GURL& active_url) override;
- void GpuMemoryUmaStats(const gpu::GPUMemoryUmaStats& params) override;
- void StoreShaderToDisk(int client_id,
- const std::string& key,
- const std::string& shader) override;
-#if defined(OS_WIN)
- void SendAcceleratedSurfaceCreatedChildWindow(
- gpu::SurfaceHandle parent_window,
- gpu::SurfaceHandle child_window) override;
-#endif
- void SetActiveURL(const GURL& url) override;
-
- // GpuChannelHostFactory overrides:
- bool IsMainThread() override;
- scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override;
- std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
- size_t size) override;
-
- static GpuServiceMus* GetInstance();
-
- private:
- friend struct base::DefaultSingletonTraits<GpuServiceMus>;
-
- GpuServiceMus();
- ~GpuServiceMus() override;
-
- void Initialize();
- void InitializeOnGpuThread(IPC::ChannelHandle* channel_handle,
- base::WaitableEvent* event);
- void EstablishGpuChannelOnGpuThread(int client_id,
- uint64_t client_tracing_id,
- bool preempts,
- bool allow_view_command_buffers,
- bool allow_real_time_streams,
- IPC::ChannelHandle* channel_handle);
-
- // The next client id.
- int next_client_id_;
-
- // The main thread task runner.
- scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
-
- // An event that will be signalled when we shutdown.
- base::WaitableEvent shutdown_event_;
-
- // The main thread for GpuService.
- base::Thread gpu_thread_;
-
- // The thread that handles IO events for GpuService.
- base::Thread io_thread_;
-
- std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_;
-
- std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_;
-
- std::unique_ptr<media::MediaService> media_service_;
-
- std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory_;
-
- // A GPU memory buffer manager used locally.
- std::unique_ptr<MusGpuMemoryBufferManager> gpu_memory_buffer_manager_local_;
-
- // A GPU channel used locally.
- scoped_refptr<gpu::GpuChannelHost> gpu_channel_local_;
-
- gpu::GpuPreferences gpu_preferences_;
-
- // Information about the GPU, such as device and vendor ID.
- gpu::GPUInfo gpu_info_;
-
- DISALLOW_COPY_AND_ASSIGN(GpuServiceMus);
-};
-
-} // namespace mus
-
-#endif // COMPONENTS_MUS_GPU_GPU_SERVICE_MUS_H_
« no previous file with comments | « components/mus/gpu/gpu_service_impl.cc ('k') | components/mus/gpu/gpu_service_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698