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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_ozone.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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" 5 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
6 6
7 #include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.h " 7 #include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.h "
8 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" 8 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 // static 12 // static
13 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::Create( 13 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::Create(
14 const gfx::Size& size, 14 const gfx::Size& size,
15 unsigned internalformat, 15 unsigned internalformat,
16 unsigned usage) { 16 unsigned usage) {
17 if (GpuMemoryBufferImplOzoneNativeBuffer::IsConfigurationSupported(
18 internalformat, usage)) {
19 return GpuMemoryBufferImplOzoneNativeBuffer::
20 AllocateOzoneNativeBufferForBrowser(size, internalformat, usage);
reveman 2014/09/04 22:37:24 Please make it: scoped_ptr<GpuMemoryBufferImplOzo
alexst (slow to review) 2014/09/05 02:04:53 I see what you meant now, sounds good. I added us
21 }
17 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( 22 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
18 size, internalformat, usage)) { 23 size, internalformat, usage)) {
19 scoped_ptr<GpuMemoryBufferImplSharedMemory> buffer( 24 scoped_ptr<GpuMemoryBufferImplSharedMemory> buffer(
20 new GpuMemoryBufferImplSharedMemory(size, internalformat)); 25 new GpuMemoryBufferImplSharedMemory(size, internalformat));
21 if (!buffer->Initialize()) 26 if (!buffer->Initialize())
22 return scoped_ptr<GpuMemoryBufferImpl>(); 27 return scoped_ptr<GpuMemoryBufferImpl>();
23 28
24 return buffer.PassAs<GpuMemoryBufferImpl>(); 29 return buffer.PassAs<GpuMemoryBufferImpl>();
25 } 30 }
26 31
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return scoped_ptr<GpuMemoryBufferImpl>(); 84 return scoped_ptr<GpuMemoryBufferImpl>();
80 85
81 return buffer.PassAs<GpuMemoryBufferImpl>(); 86 return buffer.PassAs<GpuMemoryBufferImpl>();
82 } 87 }
83 default: 88 default:
84 return scoped_ptr<GpuMemoryBufferImpl>(); 89 return scoped_ptr<GpuMemoryBufferImpl>();
85 } 90 }
86 } 91 }
87 92
88 } // namespace content 93 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698