OLD | NEW |
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 #include "services/ui/ws/gpu_service_proxy.h" | 5 #include "services/ui/ws/gpu_service_proxy.h" |
6 | 6 |
7 #include "base/memory/shared_memory.h" | 7 #include "base/memory/shared_memory.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 gfx::BufferFormat format, | 83 gfx::BufferFormat format, |
84 gfx::BufferUsage usage, | 84 gfx::BufferUsage usage, |
85 const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) { | 85 const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) { |
86 // TODO(sad): Check to see if native gpu memory buffer can be used first. | 86 // TODO(sad): Check to see if native gpu memory buffer can be used first. |
87 if (!gpu::GpuMemoryBufferImplSharedMemory::IsUsageSupported(usage) || | 87 if (!gpu::GpuMemoryBufferImplSharedMemory::IsUsageSupported(usage) || |
88 !gpu::GpuMemoryBufferImplSharedMemory::IsSizeValidForFormat(size, | 88 !gpu::GpuMemoryBufferImplSharedMemory::IsSizeValidForFormat(size, |
89 format)) { | 89 format)) { |
90 callback.Run(gfx::GpuMemoryBufferHandle()); | 90 callback.Run(gfx::GpuMemoryBufferHandle()); |
91 return; | 91 return; |
92 } | 92 } |
93 callback.Run(gpu::GpuMemoryBufferImplSharedMemory::AllocateGpuMemoryBuffer( | 93 callback.Run(gpu::GpuMemoryBufferImplSharedMemory::CreateGpuMemoryBuffer( |
94 id, size, format)); | 94 id, size, format)); |
95 } | 95 } |
96 | 96 |
97 void GpuServiceProxy::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 97 void GpuServiceProxy::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
98 const gpu::SyncToken& sync_token) { | 98 const gpu::SyncToken& sync_token) { |
99 // NOTIMPLEMENTED(); | 99 // NOTIMPLEMENTED(); |
100 } | 100 } |
101 | 101 |
102 } // namespace ws | 102 } // namespace ws |
103 } // namespace ui | 103 } // namespace ui |
OLD | NEW |