Chromium Code Reviews| Index: services/ui/gpu/gpu_service.cc |
| diff --git a/services/ui/gpu/gpu_service.cc b/services/ui/gpu/gpu_service.cc |
| index 03c8823b173a4a67a5d29dfcc68e03b1f5a9d8e0..d0a2059365743da0c82eb299cf5fb2e216a8209f 100644 |
| --- a/services/ui/gpu/gpu_service.cc |
| +++ b/services/ui/gpu/gpu_service.cc |
| @@ -241,6 +241,33 @@ void GpuService::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| gpu_channel_manager_->DestroyGpuMemoryBuffer(id, client_id, sync_token); |
| } |
| +void GpuService::GetGpuMemoryBufferAttribs( |
| + const GetGpuMemoryBufferAttribsCallback& callback) { |
| + gfx::GpuMemoryBufferAttribVector supported_attribs; |
| + |
| + for (int i = 0; i < static_cast<int>(gfx::BufferUsage::LAST); i++) { |
| + gfx::GpuMemoryBufferAttribVector tmp = |
| + gpu_memory_buffer_factory_->GetSupportedGpuMemoryBufferAttribsForUsage( |
| + static_cast<gfx::BufferUsage>(i)); |
| + if (tmp.size() == 0) |
| + continue; |
| + |
| + gfx::GpuMemoryBufferAttribVector intersection; |
| + std::sort(tmp.begin(), tmp.end()); |
| + |
| + if (supported_attribs.size() == 0) |
| + supported_attribs = std::move(tmp); |
| + else { |
| + std::set_intersection(supported_attribs.begin(), supported_attribs.end(), |
| + tmp.begin(), tmp.end(), |
| + std::back_inserter(intersection)); |
| + supported_attribs = std::move(intersection); |
| + } |
| + } |
| + |
| + callback.Run(supported_attribs); |
|
sadrul
2017/04/19 21:40:23
Do we expect this list to change between requests?
varad
2017/04/21 13:01:32
Done.
|
| +} |
| + |
| void GpuService::GetVideoMemoryUsageStats( |
| const GetVideoMemoryUsageStatsCallback& callback) { |
| if (io_runner_->BelongsToCurrentThread()) { |