OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_H_ |
6 #define SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 18 matching lines...) Expand all Loading... |
29 gfx::BufferFormat format, | 29 gfx::BufferFormat format, |
30 gfx::BufferUsage usage); | 30 gfx::BufferUsage usage); |
31 static MojoGpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer); | 31 static MojoGpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer); |
32 | 32 |
33 const unsigned char* GetMemory() const; | 33 const unsigned char* GetMemory() const; |
34 | 34 |
35 // Overridden from gfx::GpuMemoryBuffer: | 35 // Overridden from gfx::GpuMemoryBuffer: |
36 bool Map() override; | 36 bool Map() override; |
37 void* memory(size_t plane) override; | 37 void* memory(size_t plane) override; |
38 void Unmap() override; | 38 void Unmap() override; |
39 int stride(size_t plane) const override; | 39 uint32_t stride(size_t plane) const override; |
40 gfx::GpuMemoryBufferHandle GetHandle() const override; | 40 gfx::GpuMemoryBufferHandle GetHandle() const override; |
41 | 41 |
42 // Overridden from gfx::GpuMemoryBufferImpl | 42 // Overridden from gfx::GpuMemoryBufferImpl |
43 gfx::GpuMemoryBufferType GetBufferType() const override; | 43 gfx::GpuMemoryBufferType GetBufferType() const override; |
44 | 44 |
45 private: | 45 private: |
46 MojoGpuMemoryBufferImpl(const gfx::Size& size, | 46 MojoGpuMemoryBufferImpl(const gfx::Size& size, |
47 gfx::BufferFormat format, | 47 gfx::BufferFormat format, |
48 std::unique_ptr<base::SharedMemory> shared_memory, | 48 std::unique_ptr<base::SharedMemory> shared_memory, |
49 uint32_t offset, | 49 uint32_t offset, |
50 int32_t stride); | 50 uint32_t stride); |
51 | 51 |
52 std::unique_ptr<base::SharedMemory> shared_memory_; | 52 std::unique_ptr<base::SharedMemory> shared_memory_; |
53 const uint32_t offset_; | 53 const uint32_t offset_; |
54 const int32_t stride_; | 54 const uint32_t stride_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(MojoGpuMemoryBufferImpl); | 56 DISALLOW_COPY_AND_ASSIGN(MojoGpuMemoryBufferImpl); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace ui | 59 } // namespace ui |
60 | 60 |
61 #endif // SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_H_ | 61 #endif // SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_H_ |
OLD | NEW |