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

Unified Diff: content/browser/gpu/browser_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/browser/gpu/browser_gpu_memory_buffer_manager.cc
diff --git a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
index 51aeb5eb39c59bb465d77a6da4b2453df8d4affe..4bb1461fbe2a1a14b138232ef3a25085644a7b55 100644
--- a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
+++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
@@ -20,6 +20,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
#include "gpu/GLES2/gl2extchromium.h"
+#include "gpu/ipc/client/gpu_fence_impl.h"
#include "gpu/ipc/client/gpu_memory_buffer_impl.h"
#include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h"
#include "gpu/ipc/common/gpu_memory_buffer_support.h"
@@ -298,6 +299,22 @@ void BrowserGpuMemoryBufferManager::SetDestructionSyncToken(
sync_token);
}
+std::unique_ptr<gfx::GpuFence> BrowserGpuMemoryBufferManager::CreateGpuFence() {
+ std::unique_ptr<gpu::GpuFenceImpl> fence(new gpu::GpuFenceImpl);
+ return std::move(fence);
+}
+
+std::unique_ptr<gfx::GpuFence>
+BrowserGpuMemoryBufferManager::CreateGpuFenceFromHandle(
+ const gfx::GpuFenceHandle& handle) {
+ return nullptr;
+}
+
+gfx::GpuFence* BrowserGpuMemoryBufferManager::GpuFenceFromClientFence(
+ ClientFence fence) {
+ return gpu::GpuFenceImpl::FromClientFence(fence);
+}
+
bool BrowserGpuMemoryBufferManager::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) {
@@ -351,6 +368,14 @@ void BrowserGpuMemoryBufferManager::ChildProcessDeletedGpuMemoryBuffer(
DestroyGpuMemoryBufferOnIO(id, child_client_id, sync_token);
}
+void BrowserGpuMemoryBufferManager::CreateGpuFenceForChildProcess(
+ base::ProcessHandle child_process_handle,
+ const FenceCreationCallback& callback) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+ callback.Run(gpu::GpuFenceImpl::CreateForChildProcess(child_process_handle));
+}
+
void BrowserGpuMemoryBufferManager::ProcessRemoved(
base::ProcessHandle process_handle,
int client_id) {

Powered by Google App Engine
This is Rietveld 408576698