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

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl_android.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/common/gpu/client/gpu_memory_buffer_impl_android.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_android.cc b/content/common/gpu/client/gpu_memory_buffer_impl_android.cc
index 799eff5334711476e1fb640307e8e607bd30343c..30532405f7327748ec2a0e0ea9443f4c4c748c7f 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_android.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_android.cc
@@ -10,21 +10,21 @@
namespace content {
// static
-scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::Create(
- const gfx::Size& size,
- unsigned internalformat,
- unsigned usage) {
+void GpuMemoryBufferImpl::Create(const gfx::Size& size,
+ unsigned internalformat,
+ unsigned usage,
+ const CreationCallback& callback) {
if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
size, internalformat, usage)) {
scoped_ptr<GpuMemoryBufferImplSharedMemory> buffer(
new GpuMemoryBufferImplSharedMemory(size, internalformat));
- if (!buffer->Initialize())
- return scoped_ptr<GpuMemoryBufferImpl>();
-
- return buffer.PassAs<GpuMemoryBufferImpl>();
+ if (buffer->Initialize()) {
reveman 2014/09/09 17:18:26 I think we should replace the Initialize conventio
alexst (slow to review) 2014/09/09 21:53:57 Done.
+ callback.Run(buffer.PassAs<GpuMemoryBufferImpl>());
+ return;
+ }
}
- return scoped_ptr<GpuMemoryBufferImpl>();
+ callback.Run(scoped_ptr<GpuMemoryBufferImpl>());
}
// static

Powered by Google App Engine
This is Rietveld 408576698