| 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..fd74de305674af77fcf9ce337737986b7c250466 100644
|
| --- a/services/ui/gpu/gpu_service.cc
|
| +++ b/services/ui/gpu/gpu_service.cc
|
| @@ -241,6 +241,37 @@ void GpuService::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
|
| gpu_channel_manager_->DestroyGpuMemoryBuffer(id, client_id, sync_token);
|
| }
|
|
|
| +void GpuService::GetGpuMemoryBufferAttribs(
|
| + const GetGpuMemoryBufferAttribsCallback& callback) {
|
| + if (gpu_memory_buffer_attribs_.size() > 0) {
|
| + callback.Run(gpu_memory_buffer_attribs_);
|
| + return;
|
| + }
|
| +
|
| + for (int i = 0; i < static_cast<int>(gfx::BufferUsage::LAST); i++) {
|
| + gfx::GpuMemoryBufferAttribVector tmp =
|
| + gpu_memory_buffer_factory_->GetGpuMemoryBufferAttribsForUsage(
|
| + static_cast<gfx::BufferUsage>(i));
|
| + if (tmp.size() == 0)
|
| + continue;
|
| +
|
| + gfx::GpuMemoryBufferAttribVector intersection;
|
| + std::sort(tmp.begin(), tmp.end());
|
| +
|
| + if (gpu_memory_buffer_attribs_.size() == 0)
|
| + gpu_memory_buffer_attribs_ = std::move(tmp);
|
| + else {
|
| + std::set_intersection(gpu_memory_buffer_attribs_.begin(),
|
| + gpu_memory_buffer_attribs_.end(),
|
| + tmp.begin(), tmp.end(),
|
| + std::back_inserter(intersection));
|
| + gpu_memory_buffer_attribs_ = std::move(intersection);
|
| + }
|
| + }
|
| +
|
| + callback.Run(gpu_memory_buffer_attribs_);
|
| +}
|
| +
|
| void GpuService::GetVideoMemoryUsageStats(
|
| const GetVideoMemoryUsageStatsCallback& callback) {
|
| if (io_runner_->BelongsToCurrentThread()) {
|
|
|