|
13 | 13 | #include <lib/fdio/directory.h>
|
14 | 14 | #include <lib/fidl/cpp/interface_ptr.h>
|
15 | 15 | #include <lib/fidl/cpp/interface_request.h>
|
| 16 | +#include <lib/ui/scenic/cpp/view_token_pair.h> |
16 | 17 | #include <lib/zx/channel.h>
|
17 | 18 | #include <zircon/status.h>
|
18 | 19 |
|
@@ -76,17 +77,17 @@ bool ScenicWindow::initialize(const std::string &name, size_t width, size_t heig
|
76 | 77 | mShape.SetShape(scenic::Rectangle(&mScenicSession, width, height));
|
77 | 78 | mShape.SetMaterial(mMaterial);
|
78 | 79 |
|
| 80 | + fuchsia::ui::views::ViewToken viewToken; |
| 81 | + fuchsia::ui::views::ViewHolderToken viewHolderToken; |
| 82 | + std::tie(viewToken, viewHolderToken) = scenic::NewViewTokenPair(); |
| 83 | + |
79 | 84 | // Create view.
|
80 |
| - zx::eventpair viewHolderToken; |
81 |
| - zx::eventpair viewToken; |
82 |
| - zx_status_t status = zx::eventpair::create(0 /* options */, &viewToken, &viewHolderToken); |
83 |
| - ASSERT(status == ZX_OK); |
84 | 85 | mView = std::make_unique<scenic::View>(&mScenicSession, std::move(viewToken), name);
|
85 | 86 | mView->AddChild(mShape);
|
86 | 87 | mScenicSession.Present(0, [](fuchsia::images::PresentationInfo info) {});
|
87 | 88 |
|
88 | 89 | // Present view.
|
89 |
| - mPresenter->Present2(std::move(viewHolderToken), nullptr); |
| 90 | + mPresenter->PresentView(std::move(viewHolderToken), nullptr); |
90 | 91 |
|
91 | 92 | mWidth = width;
|
92 | 93 | mHeight = height;
|
|
0 commit comments