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

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

Issue 2281583003: services/ui: Split GpuServiceInternal into gpu vs. ws pieces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DONE_2016.08.24_mus-ws-gpu-refactor
Patch Set: tot merge Created 4 years, 4 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 | « services/ui/gpu/DEPS ('k') | services/ui/gpu/gpu_service_internal.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/gpu/gpu_service_internal.h
diff --git a/services/ui/gpu/gpu_service_internal.h b/services/ui/gpu/gpu_service_internal.h
index a3f3e963d271e29d6660ee7ef8d03f4336e61bc3..a720b06e6013f43c1f1f39d94363ef913e21b25c 100644
--- a/services/ui/gpu/gpu_service_internal.h
+++ b/services/ui/gpu/gpu_service_internal.h
@@ -12,7 +12,6 @@
#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"
@@ -40,14 +39,10 @@ class MediaService;
namespace ui {
-class MusGpuMemoryBufferManager;
-
-// TODO(sad): GpuChannelManagerDelegate implementation should be in the gpu
-// process, and the GpuChannelHostFactory should be in the host process (i.e.
-// the window-server process). So the GpuChannelHostFactory parts of this should
-// be split out.
+// This runs in the GPU process, and communicates with the gpu host (which is
+// the window server) over the mojom APIs. This is responsible for setting up
+// the connection to clients, allocating/free'ing gpu memory etc.
class GpuServiceInternal : public gpu::GpuChannelManagerDelegate,
- public gpu::GpuChannelHostFactory,
public mojom::GpuServiceInternal,
public base::NonThreadSafe {
public:
@@ -56,10 +51,6 @@ class GpuServiceInternal : public gpu::GpuChannelManagerDelegate,
// TODO(sad): This should not be a singleton.
static GpuServiceInternal* GetInstance();
- scoped_refptr<gpu::GpuChannelHost> gpu_channel_local() const {
- return gpu_channel_local_;
- }
-
gpu::GpuChannelManager* gpu_channel_manager() const {
return gpu_channel_manager_.get();
}
@@ -68,6 +59,18 @@ class GpuServiceInternal : public gpu::GpuChannelManagerDelegate,
return gpu_memory_buffer_factory_.get();
}
+ // TODO(sad): These should be mojom API.
+ gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
+ gfx::GpuMemoryBufferId id,
+ const gfx::Size& size,
+ gfx::BufferFormat format,
+ gfx::BufferUsage usage,
+ int client_id,
+ gpu::SurfaceHandle surface_handle);
+ void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
+ int client_id,
+ const gpu::SyncToken& sync_token);
+
private:
friend struct base::DefaultSingletonTraits<GpuServiceInternal>;
@@ -80,22 +83,12 @@ class GpuServiceInternal : public gpu::GpuChannelManagerDelegate,
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::GpuChannelManagerDelegate:
void DidCreateOffscreenContext(const GURL& active_url) override;
@@ -115,21 +108,15 @@ class GpuServiceInternal : public gpu::GpuChannelManagerDelegate,
#endif
void SetActiveURL(const GURL& url) override;
- // gpu::GpuChannelHostFactory:
- bool IsMainThread() override;
- scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override;
- std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
- size_t size) override;
-
// mojom::GpuServiceInternal:
void Initialize(const InitializeCallback& callback) override;
void EstablishGpuChannel(
int32_t client_id,
uint64_t client_tracing_id,
+ bool is_gpu_host,
const EstablishGpuChannelCallback& callback) override;
- void InitializeOnGpuThread(mojo::ScopedMessagePipeHandle* channel_handle,
- base::WaitableEvent* event);
+ void InitializeOnGpuThread(base::WaitableEvent* event);
void EstablishGpuChannelOnGpuThread(
int client_id,
uint64_t client_tracing_id,
@@ -158,12 +145,6 @@ class GpuServiceInternal : public gpu::GpuChannelManagerDelegate,
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.
« no previous file with comments | « services/ui/gpu/DEPS ('k') | services/ui/gpu/gpu_service_internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698