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

Unified Diff: content/child/child_gpu_memory_buffer_manager.cc

Issue 2383753002: gpu: Add GpuFence framework.
Patch Set: rebase Created 4 years, 1 month 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
Index: content/child/child_gpu_memory_buffer_manager.cc
diff --git a/content/child/child_gpu_memory_buffer_manager.cc b/content/child/child_gpu_memory_buffer_manager.cc
index 2bc4755945117f8a3a484d02c9424ff4466676c0..d7c7f6ec1f27aa182ed192169d0681d34ccea174 100644
--- a/content/child/child_gpu_memory_buffer_manager.cc
+++ b/content/child/child_gpu_memory_buffer_manager.cc
@@ -7,8 +7,10 @@
#include <memory>
#include <utility>
+#include "base/memory/ptr_util.h"
#include "content/common/child_process_messages.h"
#include "content/common/generic_shared_memory_id_generator.h"
+#include "gpu/ipc/client/gpu_fence_impl.h"
#include "gpu/ipc/client/gpu_memory_buffer_impl.h"
namespace content {
@@ -84,4 +86,26 @@ void ChildGpuMemoryBufferManager::SetDestructionSyncToken(
sync_token);
}
+std::unique_ptr<gfx::GpuFence> ChildGpuMemoryBufferManager::CreateGpuFence() {
+ gfx::GpuFenceHandle handle;
+ IPC::Message* message = new ChildProcessHostMsg_SyncCreateGpuFence(&handle);
+ bool success = sender_->Send(message);
+ if (!success)
+ return nullptr;
+ std::unique_ptr<gpu::GpuFenceImpl> fence(new gpu::GpuFenceImpl(handle));
+ return std::move(fence);
+}
+
+std::unique_ptr<gfx::GpuFence>
+ChildGpuMemoryBufferManager::CreateGpuFenceFromHandle(
+ const gfx::GpuFenceHandle& handle) {
+ NOTIMPLEMENTED();
+ return nullptr;
+}
+
+gfx::GpuFence* ChildGpuMemoryBufferManager::GpuFenceFromClientFence(
+ ClientFence fence) {
+ return gpu::GpuFenceImpl::FromClientFence(fence);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698