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

Unified Diff: services/ui/common/gpu_type_converters.cc

Issue 2295923002: gfx: Struct traits for GpuMemoryBufferId and GpuMemoryBufferType. (Closed)
Patch Set: fix build Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/common/gpu_type_converters.h ('k') | services/ui/common/gpu_type_converters_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/common/gpu_type_converters.cc
diff --git a/services/ui/common/gpu_type_converters.cc b/services/ui/common/gpu_type_converters.cc
index 0fc725d37f0fd10686a0ffd511a237bcc0f42d88..cb16bffe6ec57afc9040e655de5cda7e1f014a54 100644
--- a/services/ui/common/gpu_type_converters.cc
+++ b/services/ui/common/gpu_type_converters.cc
@@ -37,30 +37,14 @@ TypeConverter<gfx::NativePixmapHandle, ui::mojom::NativePixmapHandlePtr>::
#endif
// static
-ui::mojom::GpuMemoryBufferIdPtr
-TypeConverter<ui::mojom::GpuMemoryBufferIdPtr, gfx::GpuMemoryBufferId>::Convert(
- const gfx::GpuMemoryBufferId& id) {
- ui::mojom::GpuMemoryBufferIdPtr result = ui::mojom::GpuMemoryBufferId::New();
- result->id = id.id;
- return result;
-}
-
-// static
-gfx::GpuMemoryBufferId
-TypeConverter<gfx::GpuMemoryBufferId, ui::mojom::GpuMemoryBufferIdPtr>::Convert(
- const ui::mojom::GpuMemoryBufferIdPtr& id) {
- return gfx::GpuMemoryBufferId(id->id);
-}
-
-// static
ui::mojom::GpuMemoryBufferHandlePtr
TypeConverter<ui::mojom::GpuMemoryBufferHandlePtr, gfx::GpuMemoryBufferHandle>::
Convert(const gfx::GpuMemoryBufferHandle& handle) {
DCHECK(handle.type == gfx::SHARED_MEMORY_BUFFER);
ui::mojom::GpuMemoryBufferHandlePtr result =
ui::mojom::GpuMemoryBufferHandle::New();
- result->type = static_cast<ui::mojom::GpuMemoryBufferType>(handle.type);
- result->id = ui::mojom::GpuMemoryBufferId::From(handle.id);
+ result->type = handle.type;
+ result->id = handle.id;
base::PlatformFile platform_file;
#if defined(OS_WIN)
platform_file = handle.handle.GetHandle();
@@ -82,10 +66,10 @@ TypeConverter<ui::mojom::GpuMemoryBufferHandlePtr, gfx::GpuMemoryBufferHandle>::
gfx::GpuMemoryBufferHandle
TypeConverter<gfx::GpuMemoryBufferHandle, ui::mojom::GpuMemoryBufferHandlePtr>::
Convert(const ui::mojom::GpuMemoryBufferHandlePtr& handle) {
- DCHECK(handle->type == ui::mojom::GpuMemoryBufferType::SHARED_MEMORY);
+ DCHECK_EQ(handle->type, gfx::GpuMemoryBufferType::SHARED_MEMORY_BUFFER);
gfx::GpuMemoryBufferHandle result;
- result.type = static_cast<gfx::GpuMemoryBufferType>(handle->type);
- result.id = handle->id.To<gfx::GpuMemoryBufferId>();
+ result.type = handle->type;
+ result.id = handle->id;
base::PlatformFile platform_file;
MojoResult unwrap_result = mojo::UnwrapPlatformFile(
std::move(handle->buffer_handle), &platform_file);
« no previous file with comments | « services/ui/common/gpu_type_converters.h ('k') | services/ui/common/gpu_type_converters_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698