Commit 6f262fdd authored by Robert Sesek's avatar Robert Sesek Committed by Commit Bot

Convert ui/ozone/public/mojom/scenic_gpu_host.mojom to handle<platform>

Bug: 778317
Change-Id: Ia5bd54efcc427b93ebb78f6a4b2f3960f3fae217
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2063911Reviewed-by: default avatarWez <wez@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742759}
parent 3db7e3b0
......@@ -13,7 +13,6 @@
#include "base/threading/thread_task_runner_handle.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "ui/ozone/platform/scenic/scenic_window.h"
#include "ui/ozone/platform/scenic/scenic_window_manager.h"
#include "ui/ozone/public/mojom/scenic_gpu_host.mojom.h"
......@@ -53,15 +52,14 @@ ScenicGpuHost::CreateHostProcessSelfRemote() {
void ScenicGpuHost::AttachSurfaceToWindow(
int32_t window_id,
mojo::ScopedHandle surface_view_holder_token_mojo) {
mojo::PlatformHandle surface_view_holder_token_mojo) {
DCHECK_CALLED_ON_VALID_THREAD(ui_thread_checker_);
ScenicWindow* scenic_window = scenic_window_manager_->GetWindow(window_id);
if (!scenic_window)
return;
fuchsia::ui::views::ViewHolderToken surface_view_holder_token;
surface_view_holder_token.value = zx::eventpair(
mojo::UnwrapPlatformHandle(std::move(surface_view_holder_token_mojo))
.TakeHandle());
surface_view_holder_token.value =
zx::eventpair(surface_view_holder_token_mojo.TakeHandle());
scenic_window->AttachSurfaceView(std::move(surface_view_holder_token));
}
......
......@@ -42,7 +42,7 @@ class ScenicGpuHost : public mojom::ScenicGpuHost,
// mojom::ScenicGpuHost:
void AttachSurfaceToWindow(
int32_t window_id,
mojo::ScopedHandle surface_view_holder_token_mojo) override;
mojo::PlatformHandle surface_view_holder_token_mojo) override;
// GpuPlatformSupportHost:
void OnGpuProcessLaunched(
......
......@@ -8,7 +8,6 @@
#include <lib/ui/scenic/cpp/view_token_pair.h>
#include <lib/zx/eventpair.h>
#include "mojo/public/cpp/system/platform_handle.h"
#include "ui/ozone/platform/scenic/scenic_gpu_host.h"
#include "ui/ozone/platform/scenic/scenic_surface_factory.h"
......@@ -53,7 +52,7 @@ void ScenicSurface::SetTextureToImage(const scenic::Image& image) {
material_.SetTexture(image);
}
mojo::ScopedHandle ScenicSurface::CreateView() {
mojo::PlatformHandle ScenicSurface::CreateView() {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
// Scenic will associate the View and ViewHolder regardless of which it
......@@ -68,8 +67,7 @@ mojo::ScopedHandle ScenicSurface::CreateView() {
/*requested_presentation_time=*/0,
/*requested_prediction_span=*/0,
[](fuchsia::scenic::scheduling::FuturePresentationTimes info) {});
return mojo::WrapPlatformHandle(
mojo::PlatformHandle(std::move(tokens.view_holder_token.value)));
return mojo::PlatformHandle(std::move(tokens.view_holder_token.value));
}
} // namespace ui
......@@ -11,7 +11,7 @@
#include "base/macros.h"
#include "base/threading/thread_checker.h"
#include "mojo/public/cpp/system/handle.h"
#include "mojo/public/cpp/platform/platform_handle.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/ozone/public/platform_window_surface.h"
......@@ -43,7 +43,7 @@ class ScenicSurface : public ui::PlatformWindowSurface {
// Creates a View for this surface, and returns a ViewHolderToken handle
// that can be used to attach it into a scene graph.
mojo::ScopedHandle CreateView();
mojo::PlatformHandle CreateView();
void AssertBelongsToCurrentThread() {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
......
......@@ -229,7 +229,7 @@ void ScenicSurfaceFactory::CreateScenicSessionOnMainThread(
void ScenicSurfaceFactory::AttachSurfaceToWindow(
gfx::AcceleratedWidget window,
mojo::ScopedHandle surface_view_holder_token_mojo) {
mojo::PlatformHandle surface_view_holder_token_mojo) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
gpu_host_->AttachSurfaceToWindow(window,
std::move(surface_view_holder_token_mojo));
......
......@@ -88,8 +88,9 @@ class ScenicSurfaceFactory : public SurfaceFactoryOzone {
fidl::InterfaceHandle<fuchsia::ui::scenic::SessionListener> listener);
// Links a surface to its parent window in the host process.
void AttachSurfaceToWindow(gfx::AcceleratedWidget window,
mojo::ScopedHandle surface_view_holder_token_mojo);
void AttachSurfaceToWindow(
gfx::AcceleratedWidget window,
mojo::PlatformHandle surface_view_holder_token_mojo);
base::flat_map<gfx::AcceleratedWidget, ScenicSurface*> surface_map_
GUARDED_BY(surface_lock_);
......
......@@ -8,5 +8,5 @@ module ui.mojom;
interface ScenicGpuHost {
// Attaches the surface View identified by |view_holder_token| to the scene
// graph for |window_id|.
AttachSurfaceToWindow(int32 window_id, handle view_holder_token);
AttachSurfaceToWindow(int32 window_id, handle<platform> view_holder_token);
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment