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

Side by Side Diff: gpu/command_buffer/common/buffer.h

Issue 2912723002: Revert "Bug fix: TranferBufferManager's SharedMemory memory usage reporting was wrong" (Closed)
Patch Set: (rebase) 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 unified diff | Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/common/buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 GPU_COMMAND_BUFFER_COMMON_BUFFER_H_ 5 #ifndef GPU_COMMAND_BUFFER_COMMON_BUFFER_H_
6 #define GPU_COMMAND_BUFFER_COMMON_BUFFER_H_ 6 #define GPU_COMMAND_BUFFER_COMMON_BUFFER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 10 matching lines...) Expand all
21 class SharedMemory; 21 class SharedMemory;
22 class SharedMemoryHandle; 22 class SharedMemoryHandle;
23 23
24 } // namespace base 24 } // namespace base
25 25
26 namespace gpu { 26 namespace gpu {
27 27
28 class GPU_EXPORT BufferBacking { 28 class GPU_EXPORT BufferBacking {
29 public: 29 public:
30 virtual ~BufferBacking() {} 30 virtual ~BufferBacking() {}
31 virtual bool is_shared() const;
32 virtual base::SharedMemoryHandle shared_memory_handle() const; 31 virtual base::SharedMemoryHandle shared_memory_handle() const;
33 virtual void* GetMemory() const = 0; 32 virtual void* GetMemory() const = 0;
34 virtual size_t GetSize() const = 0; 33 virtual size_t GetSize() const = 0;
35 }; 34 };
36 35
37 class GPU_EXPORT SharedMemoryBufferBacking : public BufferBacking { 36 class GPU_EXPORT SharedMemoryBufferBacking : public BufferBacking {
38 public: 37 public:
39 SharedMemoryBufferBacking(std::unique_ptr<base::SharedMemory> shared_memory, 38 SharedMemoryBufferBacking(std::unique_ptr<base::SharedMemory> shared_memory,
40 size_t size); 39 size_t size);
41 ~SharedMemoryBufferBacking() override; 40 ~SharedMemoryBufferBacking() override;
42 bool is_shared() const override;
43 base::SharedMemoryHandle shared_memory_handle() const override; 41 base::SharedMemoryHandle shared_memory_handle() const override;
44 void* GetMemory() const override; 42 void* GetMemory() const override;
45 size_t GetSize() const override; 43 size_t GetSize() const override;
46 base::SharedMemory* shared_memory() { return shared_memory_.get(); } 44 base::SharedMemory* shared_memory() { return shared_memory_.get(); }
47 45
48 private: 46 private:
49 std::unique_ptr<base::SharedMemory> shared_memory_; 47 std::unique_ptr<base::SharedMemory> shared_memory_;
50 size_t size_; 48 size_t size_;
51 DISALLOW_COPY_AND_ASSIGN(SharedMemoryBufferBacking); 49 DISALLOW_COPY_AND_ASSIGN(SharedMemoryBufferBacking);
52 }; 50 };
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 93 }
96 94
97 // Generates GUID which can be used to trace buffer using an Id. 95 // Generates GUID which can be used to trace buffer using an Id.
98 GPU_EXPORT base::trace_event::MemoryAllocatorDumpGuid GetBufferGUIDForTracing( 96 GPU_EXPORT base::trace_event::MemoryAllocatorDumpGuid GetBufferGUIDForTracing(
99 uint64_t tracing_process_id, 97 uint64_t tracing_process_id,
100 int32_t buffer_id); 98 int32_t buffer_id);
101 99
102 } // namespace gpu 100 } // namespace gpu
103 101
104 #endif // GPU_COMMAND_BUFFER_COMMON_BUFFER_H_ 102 #endif // GPU_COMMAND_BUFFER_COMMON_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/common/buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698