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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_android.cc

Issue 195583003: Add initial GpuMemoryBufferSurfaceTexture implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_shm.h" 7 #include "content/common/gpu/client/gpu_memory_buffer_impl_shm.h"
8 #include "content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.h"
8 9
9 namespace content { 10 namespace content {
10 11
11 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::Create( 12 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::Create(
12 gfx::GpuMemoryBufferHandle handle, 13 gfx::GpuMemoryBufferHandle handle,
13 gfx::Size size, 14 gfx::Size size,
14 unsigned internalformat) { 15 unsigned internalformat) {
15 switch (handle.type) { 16 switch (handle.type) {
16 case gfx::SHARED_MEMORY_BUFFER: { 17 case gfx::SHARED_MEMORY_BUFFER: {
17 scoped_ptr<GpuMemoryBufferImplShm> buffer( 18 scoped_ptr<GpuMemoryBufferImplShm> buffer(
18 new GpuMemoryBufferImplShm(size, internalformat)); 19 new GpuMemoryBufferImplShm(size, internalformat));
19 if (!buffer->Initialize(handle)) 20 if (!buffer->Initialize(handle))
20 return scoped_ptr<GpuMemoryBufferImpl>(); 21 return scoped_ptr<GpuMemoryBufferImpl>();
21 22
22 return buffer.PassAs<GpuMemoryBufferImpl>(); 23 return buffer.PassAs<GpuMemoryBufferImpl>();
23 } 24 }
25 case gfx::SURFACE_TEXTURE_BUFFER: {
26 scoped_ptr<GpuMemoryBufferImplSurfaceTexture> buffer(
27 new GpuMemoryBufferImplSurfaceTexture(size, internalformat));
28 if (!buffer->Initialize(handle))
29 return scoped_ptr<GpuMemoryBufferImpl>();
30
31 return buffer.PassAs<GpuMemoryBufferImpl>();
32 }
24 default: 33 default:
25 return scoped_ptr<GpuMemoryBufferImpl>(); 34 return scoped_ptr<GpuMemoryBufferImpl>();
26 } 35 }
27 } 36 }
28 37
29 } // namespace content 38 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.cc ('k') | content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698