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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 540443002: Enable sync allocation of GpuMemoryBuffers from the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting Created 6 years, 3 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
Index: content/browser/gpu/browser_gpu_channel_host_factory.cc
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index b35d64f3255ec73f58561e98a56edc4976159879..560ec7afff7552ec9c7a28ae6db3ab14441d6948 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -492,11 +492,12 @@ void BrowserGpuChannelHostFactory::AllocateGpuMemoryBufferOnIO(
return;
}
- request->result = GpuMemoryBufferImpl::Create(
- gfx::Size(request->width, request->height),
- request->internalformat,
- request->usage).PassAs<gfx::GpuMemoryBuffer>();
- request->event.Signal();
+ GpuMemoryBufferImpl::Create(
+ gfx::Size(request->width, request->height),
+ request->internalformat,
+ request->usage,
+ base::Bind(&BrowserGpuChannelHostFactory::GpuMemoryBufferImplCreatedOnIO,
+ base::Unretained(request)));
}
// static
@@ -504,6 +505,15 @@ void BrowserGpuChannelHostFactory::DeleteGpuMemoryBufferOnIO(
scoped_ptr<gfx::GpuMemoryBuffer> buffer) {
}
+// static
+void BrowserGpuChannelHostFactory::GpuMemoryBufferImplCreatedOnIO(
reveman 2014/09/09 17:18:26 I think this should be named "OnGpuMemoryBufferCre
alexst (slow to review) 2014/09/09 21:53:57 Yeah, the namespace is getting crowded, I'll add G
+ AllocateGpuMemoryBufferRequest* request,
+ scoped_ptr<GpuMemoryBufferImpl> buffer) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
reveman 2014/09/09 17:18:26 nit: blank line after this DCHECK to be consistent
alexst (slow to review) 2014/09/09 21:53:56 Done.
+ request->result = buffer.PassAs<gfx::GpuMemoryBuffer>();
+ request->event.Signal();
+}
+
void BrowserGpuChannelHostFactory::OnGpuMemoryBufferCreated(
uint32 request_id,
const gfx::GpuMemoryBufferHandle& handle) {

Powered by Google App Engine
This is Rietveld 408576698