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

Unified Diff: ui/gfx/mojo/buffer_types_traits.cc

Issue 2479043002: mus: Get the gpu memory buffer from the window server. (Closed)
Patch Set: . Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« services/ui/ws/gpu_service_proxy.cc ('K') | « services/ui/ws/gpu_service_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/mojo/buffer_types_traits.cc
diff --git a/ui/gfx/mojo/buffer_types_traits.cc b/ui/gfx/mojo/buffer_types_traits.cc
index 122d844079e0c056813829de1698a055219e8cec..42fa1b824e1e36effc1df93e5b53eb260e1c651e 100644
--- a/ui/gfx/mojo/buffer_types_traits.cc
+++ b/ui/gfx/mojo/buffer_types_traits.cc
@@ -63,17 +63,16 @@ bool StructTraits<
mojo::ScopedHandle StructTraits<gfx::mojom::GpuMemoryBufferHandleDataView,
gfx::GpuMemoryBufferHandle>::
shared_memory_handle(const gfx::GpuMemoryBufferHandle& handle) {
+ if (handle.is_null())
+ return mojo::ScopedHandle();
base::PlatformFile platform_file = base::kInvalidPlatformFile;
#if defined(OS_WIN)
platform_file = handle.handle.GetHandle();
#elif defined(OS_MACOSX) || defined(OS_IOS)
NOTIMPLEMENTED();
#else
- DCHECK(handle.handle.auto_close || handle.handle.fd == -1);
platform_file = handle.handle.fd;
#endif
- if (platform_file == base::kInvalidPlatformFile)
- return mojo::ScopedHandle();
return mojo::WrapPlatformFile(platform_file);
}
« services/ui/ws/gpu_service_proxy.cc ('K') | « services/ui/ws/gpu_service_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698