Chromium Code Reviews| Index: components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.h |
| diff --git a/components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.h b/components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..649451e96b608278b3aa21425e491c54c4c91747 |
| --- /dev/null |
| +++ b/components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.h |
| @@ -0,0 +1,48 @@ |
| +// Copyright 2017 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_VIZ_SERVICE_DISPLAY_COMPOSITOR_IN_PROCESS_GPU_MEMORY_BUFFER_MANAGER_H_ |
| +#define COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_IN_PROCESS_GPU_MEMORY_BUFFER_MANAGER_H_ |
| + |
| +#include "base/memory/weak_ptr.h" |
| +#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
| +#include "gpu/ipc/service/gpu_memory_buffer_factory.h" |
| + |
| +namespace gpu { |
| +class GpuChannelManager; |
| +} |
| + |
| +namespace viz { |
| + |
| +class InProcessGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager { |
| + public: |
| + explicit InProcessGpuMemoryBufferManager( |
| + gpu::GpuChannelManager* channel_manager); |
| + |
| + ~InProcessGpuMemoryBufferManager() override; |
| + |
| + private: |
| + void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| + int client_id, |
| + const gpu::SyncToken& sync_token); |
| + // gpu::GpuMemoryBufferManager: |
| + std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( |
|
reveman
2017/06/20 18:22:07
nit: why not public? it's public to anyone with a
sadrul
2017/06/21 05:57:46
Made these public.
|
| + const gfx::Size& size, |
| + gfx::BufferFormat format, |
| + gfx::BufferUsage usage, |
| + gpu::SurfaceHandle surface_handle) override; |
| + void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, |
| + const gpu::SyncToken& sync_token) override; |
| + |
| + const int client_id_; |
| + int next_gpu_memory_id_ = 1; |
| + gpu::GpuChannelManager* channel_manager_; |
| + base::WeakPtr<InProcessGpuMemoryBufferManager> weak_ptr_; |
| + base::WeakPtrFactory<InProcessGpuMemoryBufferManager> weak_factory_; |
| + DISALLOW_COPY_AND_ASSIGN(InProcessGpuMemoryBufferManager); |
| +}; |
| + |
| +} // namespace viz |
| + |
| +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_COMPOSITOR_IN_PROCESS_GPU_MEMORY_BUFFER_MANAGER_H_ |