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

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

Issue 77023002: gpu: Add IOSurface backed GpuMemoryBuffer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix overflow check Created 7 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
6
7 #include "content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h"
8 #include "content/common/gpu/client/gpu_memory_buffer_impl_shm.h"
9
10 namespace content {
11
12 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::Create(
13 gfx::GpuMemoryBufferHandle handle,
14 gfx::Size size,
15 unsigned internalformat) {
16 switch (handle.type) {
17 case gfx::SHARED_MEMORY_BUFFER: {
18 scoped_ptr<GpuMemoryBufferImplShm> buffer(
19 new GpuMemoryBufferImplShm(size, internalformat));
20 if (!buffer->Initialize(handle))
21 return scoped_ptr<GpuMemoryBufferImpl>();
22
23 return buffer.PassAs<GpuMemoryBufferImpl>();
24 }
25 case gfx::IO_SURFACE_BUFFER: {
26 scoped_ptr<GpuMemoryBufferImplIOSurface> buffer(
27 new GpuMemoryBufferImplIOSurface(size, internalformat));
28 if (!buffer->Initialize(handle))
29 return scoped_ptr<GpuMemoryBufferImpl>();
30
31 return buffer.PassAs<GpuMemoryBufferImpl>();
32 }
33 default:
34 return scoped_ptr<GpuMemoryBufferImpl>();
35 }
36 }
37
38 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_memory_buffer_impl_linux.cc ('k') | content/common/gpu/client/gpu_memory_buffer_impl_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698