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

Unified Diff: services/ui/common/mus_gpu_memory_buffer_manager.h

Issue 2503113002: mus: Get GpuMemoryBuffer from gpu process when possible. (Closed)
Patch Set: . Created 4 years 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 | « no previous file | services/ui/common/mus_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/common/mus_gpu_memory_buffer_manager.h
diff --git a/services/ui/common/mus_gpu_memory_buffer_manager.h b/services/ui/common/mus_gpu_memory_buffer_manager.h
index 768e1c971939ff7825a77ad1a440e8db4b21cb85..d5ad4b7a2dd771f9e1ab8e881974acd1c292735a 100644
--- a/services/ui/common/mus_gpu_memory_buffer_manager.h
+++ b/services/ui/common/mus_gpu_memory_buffer_manager.h
@@ -24,6 +24,20 @@ class MusGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager,
int client_id);
~MusGpuMemoryBufferManager() override;
+ void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
+ int client_id,
+ const gpu::SyncToken& sync_token);
+
+ void DestroyAllGpuMemoryBufferForClient(int client_id);
+
+ gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferHandle(
+ gfx::GpuMemoryBufferId id,
+ int client_id,
+ const gfx::Size& size,
+ gfx::BufferFormat format,
+ gfx::BufferUsage usage,
+ gpu::SurfaceHandle surface_handle);
+
// Overridden from gpu::GpuMemoryBufferManager:
std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer(
const gfx::Size& size,
@@ -38,15 +52,15 @@ class MusGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager,
const gpu::SyncToken& sync_token) override;
private:
- void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
- int client_id,
- bool is_native,
- const gpu::SyncToken& sync_token);
-
mojom::GpuServiceInternal* gpu_service_;
-
const int client_id_;
int next_gpu_memory_id_ = 1;
+
+ using NativeBuffers =
+ std::unordered_set<gfx::GpuMemoryBufferId,
+ BASE_HASH_NAMESPACE::hash<gfx::GpuMemoryBufferId>>;
+ std::unordered_map<int, NativeBuffers> native_buffers_;
+
base::WeakPtrFactory<MusGpuMemoryBufferManager> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(MusGpuMemoryBufferManager);
« no previous file with comments | « no previous file | services/ui/common/mus_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698