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

Unified Diff: components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.h

Issue 2942283002: viz: Use a simple GpuMemoryBufferManager implementation. (Closed)
Patch Set: . Created 3 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/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..4be5c8c1bda6d6aa8125dcdf08b3aefd0bb67d7b
--- /dev/null
+++ b/components/viz/service/display_compositor/in_process_gpu_memory_buffer_manager.h
@@ -0,0 +1,47 @@
+// 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"
+
+namespace gpu {
+class GpuChannelManager;
+}
+
+namespace viz {
+
+class InProcessGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager {
+ public:
+ explicit InProcessGpuMemoryBufferManager(
+ gpu::GpuChannelManager* channel_manager);
+
+ ~InProcessGpuMemoryBufferManager() override;
+
+ // gpu::GpuMemoryBufferManager:
+ std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer(
+ 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;
+
+ private:
+ void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
+ int client_id,
+ const gpu::SyncToken& sync_token);
+ 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_

Powered by Google App Engine
This is Rietveld 408576698