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

Side by Side Diff: services/ui/common/server_gpu_memory_buffer_manager.h

Issue 2572703004: exo: Directly create GpuMemoryBufferImpl when a handle is available. (Closed)
Patch Set: null callback 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SERVICES_UI_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ 5 #ifndef SERVICES_UI_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_
6 #define SERVICES_UI_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ 6 #define SERVICES_UI_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 26 matching lines...) Expand all
37 gfx::BufferFormat format, 37 gfx::BufferFormat format,
38 gfx::BufferUsage usage, 38 gfx::BufferUsage usage,
39 gpu::SurfaceHandle surface_handle); 39 gpu::SurfaceHandle surface_handle);
40 40
41 // Overridden from gpu::GpuMemoryBufferManager: 41 // Overridden from gpu::GpuMemoryBufferManager:
42 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( 42 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer(
43 const gfx::Size& size, 43 const gfx::Size& size,
44 gfx::BufferFormat format, 44 gfx::BufferFormat format,
45 gfx::BufferUsage usage, 45 gfx::BufferUsage usage,
46 gpu::SurfaceHandle surface_handle) override; 46 gpu::SurfaceHandle surface_handle) override;
47 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle(
48 const gfx::GpuMemoryBufferHandle& handle,
49 const gfx::Size& size,
50 gfx::BufferFormat format) override;
51 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, 47 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer,
52 const gpu::SyncToken& sync_token) override; 48 const gpu::SyncToken& sync_token) override;
53 49
54 private: 50 private:
55 mojom::GpuService* gpu_service_; 51 mojom::GpuService* gpu_service_;
56 const int client_id_; 52 const int client_id_;
57 int next_gpu_memory_id_ = 1; 53 int next_gpu_memory_id_ = 1;
58 54
59 using NativeBuffers = 55 using NativeBuffers =
60 std::unordered_set<gfx::GpuMemoryBufferId, 56 std::unordered_set<gfx::GpuMemoryBufferId,
61 BASE_HASH_NAMESPACE::hash<gfx::GpuMemoryBufferId>>; 57 BASE_HASH_NAMESPACE::hash<gfx::GpuMemoryBufferId>>;
62 std::unordered_map<int, NativeBuffers> native_buffers_; 58 std::unordered_map<int, NativeBuffers> native_buffers_;
63 59
64 const gpu::GpuMemoryBufferConfigurationSet native_configurations_; 60 const gpu::GpuMemoryBufferConfigurationSet native_configurations_;
65 base::WeakPtrFactory<ServerGpuMemoryBufferManager> weak_factory_; 61 base::WeakPtrFactory<ServerGpuMemoryBufferManager> weak_factory_;
66 62
67 DISALLOW_COPY_AND_ASSIGN(ServerGpuMemoryBufferManager); 63 DISALLOW_COPY_AND_ASSIGN(ServerGpuMemoryBufferManager);
68 }; 64 };
69 65
70 } // namespace ui 66 } // namespace ui
71 67
72 #endif // SERVICES_UI_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ 68 #endif // SERVICES_UI_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_
OLDNEW
« no previous file with comments | « gpu/ipc/client/gpu_memory_buffer_impl.cc ('k') | services/ui/common/server_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698