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

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

Issue 1280513002: Add GenericSharedMemoryId and use w/ GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@trackpools
Patch Set: remove "tracing" from name Created 5 years, 4 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 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_io_surface.h" 5 #include "content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/common/mac/io_surface_manager.h" 8 #include "content/common/mac/io_surface_manager.h"
9 #include "ui/gfx/buffer_format_util.h" 9 #include "ui/gfx/buffer_format_util.h"
10 10
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 // static 43 // static
44 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImplIOSurface::CreateFromHandle( 44 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImplIOSurface::CreateFromHandle(
45 const gfx::GpuMemoryBufferHandle& handle, 45 const gfx::GpuMemoryBufferHandle& handle,
46 const gfx::Size& size, 46 const gfx::Size& size,
47 gfx::BufferFormat format, 47 gfx::BufferFormat format,
48 gfx::BufferUsage usage, 48 gfx::BufferUsage usage,
49 const DestructionCallback& callback) { 49 const DestructionCallback& callback) {
50 base::ScopedCFTypeRef<IOSurfaceRef> io_surface( 50 base::ScopedCFTypeRef<IOSurfaceRef> io_surface(
51 IOSurfaceManager::GetInstance()->AcquireIOSurface(handle.id)); 51 IOSurfaceManager::GetInstance()->AcquireIOSurface(handle.id.id));
52 if (!io_surface) 52 if (!io_surface)
53 return nullptr; 53 return nullptr;
54 54
55 return make_scoped_ptr<GpuMemoryBufferImpl>( 55 return make_scoped_ptr<GpuMemoryBufferImpl>(
56 new GpuMemoryBufferImplIOSurface(handle.id, size, format, callback, 56 new GpuMemoryBufferImplIOSurface(handle.id, size, format, callback,
57 io_surface.release(), LockFlags(usage))); 57 io_surface.release(), LockFlags(usage)));
58 } 58 }
59 59
60 bool GpuMemoryBufferImplIOSurface::Map(void** data) { 60 bool GpuMemoryBufferImplIOSurface::Map(void** data) {
61 DCHECK(!mapped_); 61 DCHECK(!mapped_);
(...skipping 19 matching lines...) Expand all
81 } 81 }
82 82
83 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const { 83 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const {
84 gfx::GpuMemoryBufferHandle handle; 84 gfx::GpuMemoryBufferHandle handle;
85 handle.type = gfx::IO_SURFACE_BUFFER; 85 handle.type = gfx::IO_SURFACE_BUFFER;
86 handle.id = id_; 86 handle.id = id_;
87 return handle; 87 return handle;
88 } 88 }
89 89
90 } // namespace content 90 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698