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

Side by Side Diff: cc/test/test_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ 5 #ifndef CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_
6 #define CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ 6 #define CC_TEST_TEST_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 11 matching lines...) Expand all
22 int GetClientId() { return client_id_; } 22 int GetClientId() { return client_id_; }
23 23
24 void OnGpuMemoryBufferDestroyed(gfx::GpuMemoryBufferId gpu_memory_buffer_id); 24 void OnGpuMemoryBufferDestroyed(gfx::GpuMemoryBufferId gpu_memory_buffer_id);
25 25
26 // Overridden from gpu::GpuMemoryBufferManager: 26 // Overridden from gpu::GpuMemoryBufferManager:
27 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( 27 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer(
28 const gfx::Size& size, 28 const gfx::Size& size,
29 gfx::BufferFormat format, 29 gfx::BufferFormat format,
30 gfx::BufferUsage usage, 30 gfx::BufferUsage usage,
31 gpu::SurfaceHandle surface_handle) override; 31 gpu::SurfaceHandle surface_handle) override;
32 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle(
33 const gfx::GpuMemoryBufferHandle& handle,
34 const gfx::Size& size,
35 gfx::BufferFormat format) override;
36 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, 32 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer,
37 const gpu::SyncToken& sync_token) override; 33 const gpu::SyncToken& sync_token) override;
38 34
39 private: 35 private:
40 // Buffers allocated by this manager. 36 // Buffers allocated by this manager.
41 int last_gpu_memory_buffer_id_ = 1000; 37 int last_gpu_memory_buffer_id_ = 1000;
42 std::map<int, gfx::GpuMemoryBuffer*> buffers_; 38 std::map<int, gfx::GpuMemoryBuffer*> buffers_;
43 39
44 // Parent information for child managers. 40 // Parent information for child managers.
45 int client_id_ = -1; 41 int client_id_ = -1;
46 TestGpuMemoryBufferManager* parent_gpu_memory_buffer_manager_ = nullptr; 42 TestGpuMemoryBufferManager* parent_gpu_memory_buffer_manager_ = nullptr;
47 43
48 // Child infomration for parent managers. 44 // Child infomration for parent managers.
49 int last_client_id_ = 5000; 45 int last_client_id_ = 5000;
50 std::map<int, TestGpuMemoryBufferManager*> clients_; 46 std::map<int, TestGpuMemoryBufferManager*> clients_;
51 47
52 DISALLOW_COPY_AND_ASSIGN(TestGpuMemoryBufferManager); 48 DISALLOW_COPY_AND_ASSIGN(TestGpuMemoryBufferManager);
53 }; 49 };
54 50
55 } // namespace cc 51 } // namespace cc
56 52
57 #endif // CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ 53 #endif // CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_
OLDNEW
« no previous file with comments | « blimp/client/support/compositor/blimp_gpu_memory_buffer_manager.cc ('k') | cc/test/test_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698