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

Side by Side Diff: ui/gfx/gpu_memory_buffer.cc

Issue 2970353002: Add GpuMemoryBuffer support for DXGI handles.
Patch Set: update build config Created 3 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
« no previous file with comments | « ui/gfx/gpu_memory_buffer.h ('k') | ui/gfx/mojo/buffer_types.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/gfx/gpu_memory_buffer.h" 5 #include "ui/gfx/gpu_memory_buffer.h"
6 6
7 #include "ui/gfx/generic_shared_memory_id.h" 7 #include "ui/gfx/generic_shared_memory_id.h"
8 8
9 namespace gfx { 9 namespace gfx {
10 10
(...skipping 13 matching lines...) Expand all
24 case gfx::EMPTY_BUFFER: 24 case gfx::EMPTY_BUFFER:
25 NOTREACHED(); 25 NOTREACHED();
26 return source_handle; 26 return source_handle;
27 case gfx::SHARED_MEMORY_BUFFER: { 27 case gfx::SHARED_MEMORY_BUFFER: {
28 gfx::GpuMemoryBufferHandle handle; 28 gfx::GpuMemoryBufferHandle handle;
29 handle.type = gfx::SHARED_MEMORY_BUFFER; 29 handle.type = gfx::SHARED_MEMORY_BUFFER;
30 handle.id = source_handle.id; 30 handle.id = source_handle.id;
31 handle.handle = base::SharedMemory::DuplicateHandle(source_handle.handle); 31 handle.handle = base::SharedMemory::DuplicateHandle(source_handle.handle);
32 handle.offset = source_handle.offset; 32 handle.offset = source_handle.offset;
33 handle.stride = source_handle.stride; 33 handle.stride = source_handle.stride;
34 #if defined(OS_WIN)
35 handle.array_level = source_handle.array_level;
36 #endif
34 return handle; 37 return handle;
35 } 38 }
36 case gfx::NATIVE_PIXMAP: { 39 case gfx::NATIVE_PIXMAP: {
37 gfx::GpuMemoryBufferHandle handle; 40 gfx::GpuMemoryBufferHandle handle;
38 handle.type = gfx::NATIVE_PIXMAP; 41 handle.type = gfx::NATIVE_PIXMAP;
39 handle.id = source_handle.id; 42 handle.id = source_handle.id;
40 #if defined(OS_LINUX) 43 #if defined(OS_LINUX)
41 handle.native_pixmap_handle = 44 handle.native_pixmap_handle =
42 gfx::CloneHandleForIPC(source_handle.native_pixmap_handle); 45 gfx::CloneHandleForIPC(source_handle.native_pixmap_handle);
43 #endif 46 #endif
44 return handle; 47 return handle;
45 } 48 }
46 case gfx::IO_SURFACE_BUFFER: 49 case gfx::IO_SURFACE_BUFFER:
47 return source_handle; 50 return source_handle;
51 case gfx::DXGI_HANDLE:
52 gfx::GpuMemoryBufferHandle handle;
53 handle.type = gfx::DXGI_HANDLE;
54 handle.id = source_handle.id;
55 handle.handle = base::SharedMemory::DuplicateHandle(source_handle.handle);
56 #if defined(OS_WIN)
57 handle.array_level = source_handle.array_level;
58 #endif
59 return handle;
48 } 60 }
49 return gfx::GpuMemoryBufferHandle(); 61 return gfx::GpuMemoryBufferHandle();
50 } 62 }
51 63
52 base::trace_event::MemoryAllocatorDumpGuid GpuMemoryBuffer::GetGUIDForTracing( 64 base::trace_event::MemoryAllocatorDumpGuid GpuMemoryBuffer::GetGUIDForTracing(
53 uint64_t tracing_process_id) const { 65 uint64_t tracing_process_id) const {
54 return gfx::GetGenericSharedGpuMemoryGUIDForTracing(tracing_process_id, 66 return gfx::GetGenericSharedGpuMemoryGUIDForTracing(tracing_process_id,
55 GetId()); 67 GetId());
56 } 68 }
57 69
58 } // namespace gfx 70 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gpu_memory_buffer.h ('k') | ui/gfx/mojo/buffer_types.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698