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

Unified Diff: components/mus/gles2/command_buffer_local.cc

Issue 1995753002: [mojo-edk] Expose portable API for platform handle wrapping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 7 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 | « components/mus/gles2/command_buffer_driver.cc ('k') | components/mus/gpu/gpu_type_converters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/gles2/command_buffer_local.cc
diff --git a/components/mus/gles2/command_buffer_local.cc b/components/mus/gles2/command_buffer_local.cc
index 7d26463dcc4950638b76beb60beb52056a226aa3..971ccec6eb7fb49c2589662779465d63e457b147 100644
--- a/components/mus/gles2/command_buffer_local.cc
+++ b/components/mus/gles2/command_buffer_local.cc
@@ -25,7 +25,7 @@
#include "gpu/command_buffer/service/memory_tracking.h"
#include "gpu/command_buffer/service/shader_translator_cache.h"
#include "gpu/command_buffer/service/transfer_buffer_manager.h"
-#include "mojo/platform_handle/platform_handle_functions.h"
+#include "mojo/public/cpp/system/platform_handle.h"
#include "ui/gfx/buffer_format_util.h"
#include "ui/gfx/vsync_provider.h"
#include "ui/gl/gl_context.h"
@@ -248,23 +248,12 @@ int32_t CommandBufferLocal::CreateImage(ClientBuffer buffer,
base::SharedMemoryHandle dupd_handle =
base::SharedMemory::DuplicateHandle(handle.handle);
#if defined(OS_WIN)
- HANDLE platform_handle = dupd_handle.GetHandle();
+ HANDLE platform_file = dupd_handle.GetHandle();
#else
- int platform_handle = dupd_handle.fd;
+ int platform_file = dupd_handle.fd;
#endif
- MojoHandle mojo_handle = MOJO_HANDLE_INVALID;
- MojoResult create_result =
- MojoCreatePlatformHandleWrapper(platform_handle, &mojo_handle);
- // |MojoCreatePlatformHandleWrapper()| always takes the ownership of the
- // |platform_handle|, so we don't need to close |platform_handle|.
- if (create_result != MOJO_RESULT_OK) {
- NOTIMPLEMENTED();
- return -1;
- }
- mojo::ScopedHandle scoped_handle;
- scoped_handle.reset(mojo::Handle(mojo_handle));
-
+ mojo::ScopedHandle scoped_handle = mojo::WrapPlatformFile(platform_file);
const int32_t format = static_cast<int32_t>(gpu_memory_buffer->GetFormat());
gpu_state_->command_buffer_task_runner()->PostTask(
driver_.get(),
« no previous file with comments | « components/mus/gles2/command_buffer_driver.cc ('k') | components/mus/gpu/gpu_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698