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

Unified Diff: services/ui/ws/gpu_client.cc

Issue 2941933002: viz: Convert a sync api in ServerGpuMemoryBufferManager into async. (Closed)
Patch Set: fix test build on windows 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/gpu/interfaces/gpu_service.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/gpu_client.cc
diff --git a/services/ui/ws/gpu_client.cc b/services/ui/ws/gpu_client.cc
index f5508b363b525967775f2086c73a128ad7de2bef..72e1e4a28ff05367159525424b33ebf2171a830d 100644
--- a/services/ui/ws/gpu_client.cc
+++ b/services/ui/ws/gpu_client.cc
@@ -7,6 +7,15 @@
#include "components/viz/common/server_gpu_memory_buffer_manager.h"
#include "services/ui/gpu/interfaces/gpu_service.mojom.h"
+namespace {
+
+void RunCallback(const ui::mojom::Gpu::CreateGpuMemoryBufferCallback& callback,
+ const gfx::GpuMemoryBufferHandle& handle) {
+ callback.Run(handle);
+}
+
+} // namespace
+
namespace ui {
namespace ws {
@@ -53,9 +62,9 @@ void GpuClient::CreateGpuMemoryBuffer(
gfx::BufferFormat format,
gfx::BufferUsage usage,
const mojom::Gpu::CreateGpuMemoryBufferCallback& callback) {
- auto handle = gpu_memory_buffer_manager_->CreateGpuMemoryBufferHandle(
- id, client_id_, size, format, usage, gpu::kNullSurfaceHandle);
- callback.Run(handle);
+ gpu_memory_buffer_manager_->AllocateGpuMemoryBuffer(
+ id, client_id_, size, format, usage, gpu::kNullSurfaceHandle,
+ base::BindOnce(&RunCallback, callback));
}
void GpuClient::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
« no previous file with comments | « services/ui/gpu/interfaces/gpu_service.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698