|
42 | 42 |
|
43 | 43 | DBG_TIMING(
|
44 | 44 | #define gettid() syscall(SYS_gettid)
|
45 |
| -static uint64_t t00; |
46 |
| -) |
| 45 | + static uint64_t t00;) |
47 | 46 |
|
48 | 47 | namespace flutter {
|
49 | 48 |
|
@@ -355,10 +354,10 @@ const struct wp_presentation_feedback_listener WaylandDisplay::kPresentationFeed
|
355 | 354 | }
|
356 | 355 |
|
357 | 356 | DBG_TIMING({
|
358 |
| - static auto t0 = FlutterEngineGetCurrentTime(); |
359 |
| - const auto t1 = FlutterEngineGetCurrentTime(); |
| 357 | + static auto t0 = FlutterEngineGetCurrentTime(); |
| 358 | + const auto t1 = FlutterEngineGetCurrentTime(); |
360 | 359 | // dbgI("[%09.4f][%ld] presented: %09lldns flags:%08x p2p-diff:%5lldus rerfresh:%u\n", (t1-t00)/1e9, gettid(), (new_last_frame_ns-t00), flags, (new_last_frame_ns - wd->vsync.last_frame_)/1000, refresh);
|
361 |
| - dbgI("[%09.4f][%ld] presented %09.4f f:%08x dc:%.5f df:%.5f r:%u\n", (t1-t00)/1e9, gettid(), (new_last_frame_ns-t00)/1e9, flags, (t1 - t0)/1e9, (new_last_frame_ns - wd->vsync.last_frame_)/1e9, refresh); |
| 360 | + dbgI("[%09.4f][%ld] presented %09.4f f:%08x dc:%.5f df:%.5f r:%u\n", (t1 - t00) / 1e9, gettid(), (new_last_frame_ns - t00) / 1e9, flags, (t1 - t0) / 1e9, (new_last_frame_ns - wd->vsync.last_frame_) / 1e9, refresh); |
362 | 361 | t0 = t1;
|
363 | 362 | })
|
364 | 363 |
|
@@ -517,7 +516,7 @@ WaylandDisplay::WaylandDisplay(size_t width, size_t height, const std::string &b
|
517 | 516 | return;
|
518 | 517 | }
|
519 | 518 |
|
520 |
| - DBG_TIMING({t00 = FlutterEngineGetCurrentTime();}); |
| 519 | + DBG_TIMING({ t00 = FlutterEngineGetCurrentTime(); }); |
521 | 520 | valid_ = true;
|
522 | 521 | }
|
523 | 522 |
|
@@ -550,23 +549,15 @@ bool WaylandDisplay::SetupEngine(const std::string &bundle_path, const std::vect
|
550 | 549 | config.open_gl.present = [](void *data) -> bool {
|
551 | 550 | WaylandDisplay *const wd = get_wayland_display(data);
|
552 | 551 |
|
553 |
| - DBG_TIMING( |
554 |
| - static auto tprev = FlutterEngineGetCurrentTime(); |
555 |
| - auto tb = FlutterEngineGetCurrentTime(); |
556 |
| - dbgI("[%09.4f][%ld] >>> swap buffer [%09.4f]\n", (tb-t00)/1e9, gettid(), (tb-tprev)/1e9); |
557 |
| - ); |
| 552 | + DBG_TIMING(static auto tprev = FlutterEngineGetCurrentTime(); auto tb = FlutterEngineGetCurrentTime(); dbgI("[%09.4f][%ld] >>> swap buffer [%09.4f]\n", (tb - t00) / 1e9, gettid(), (tb - tprev) / 1e9);); |
558 | 553 |
|
559 | 554 | if (eglSwapBuffers(wd->egl_display_, wd->egl_surface_) != EGL_TRUE) {
|
560 | 555 | LogLastEGLError();
|
561 | 556 | dbgE("Could not swap the EGL buffer\n");
|
562 | 557 | return false;
|
563 | 558 | }
|
564 | 559 |
|
565 |
| - DBG_TIMING( |
566 |
| - auto ta = FlutterEngineGetCurrentTime(); |
567 |
| - dbgI("[%09.4f][%ld] <<< swap buffer [dur:%09.4f]\n", (ta-t00)/1e9, gettid(), (ta-tb)/1e9); |
568 |
| - tprev = tb; |
569 |
| - ); |
| 560 | + DBG_TIMING(auto ta = FlutterEngineGetCurrentTime(); dbgI("[%09.4f][%ld] <<< swap buffer [dur:%09.4f]\n", (ta - t00) / 1e9, gettid(), (ta - tb) / 1e9); tprev = tb;); |
570 | 561 |
|
571 | 562 | return true;
|
572 | 563 | };
|
@@ -624,7 +615,7 @@ bool WaylandDisplay::SetupEngine(const std::string &bundle_path, const std::vect
|
624 | 615 |
|
625 | 616 | DBG_TIMING({
|
626 | 617 | auto tx = FlutterEngineGetCurrentTime();
|
627 |
| - dbgI("[%09.4f][%ld] vsync callback [%jx]\n", (tx-t00)/1e9, gettid(), static_cast<uintmax_t>(baton)); |
| 618 | + dbgI("[%09.4f][%ld] vsync callback [%jx]\n", (tx - t00) / 1e9, gettid(), static_cast<uintmax_t>(baton)); |
628 | 619 | });
|
629 | 620 |
|
630 | 621 | if (wd->vsync.baton_ != 0) {
|
@@ -810,10 +801,9 @@ ssize_t WaylandDisplay::vSyncHandler() {
|
810 | 801 | intptr_t baton = std::atomic_exchange(&vsync.baton_, 0);
|
811 | 802 |
|
812 | 803 | DBG_TIMING({
|
813 |
| - auto tx = FlutterEngineGetCurrentTime(); |
814 |
| - dbgI("[%09.4f][%ld] flutterEngineOnVsync [%jx] (t:%09.4f d:%09.4f vb:%09.4f c:%09.4f f:%09.4f)\n", |
815 |
| - (tx-t00)/1e9, gettid(), static_cast<uintmax_t>(baton), (t_now_ns-t00)/1e9, (t_now_ns-vsync.last_frame_)/1e9, |
816 |
| - vsync.vblank_time_ns_/1e9, (current_ns-t00)/1e9, (finish_time_ns-t00)/1e9); |
| 804 | + auto tx = FlutterEngineGetCurrentTime(); |
| 805 | + dbgI("[%09.4f][%ld] flutterEngineOnVsync [%jx] (t:%09.4f d:%09.4f vb:%09.4f c:%09.4f f:%09.4f)\n", (tx - t00) / 1e9, gettid(), static_cast<uintmax_t>(baton), (t_now_ns - t00) / 1e9, (t_now_ns - vsync.last_frame_) / 1e9, |
| 806 | + vsync.vblank_time_ns_ / 1e9, (current_ns - t00) / 1e9, (finish_time_ns - t00) / 1e9); |
817 | 807 | });
|
818 | 808 |
|
819 | 809 | const auto status = FlutterEngineOnVsync(engine_, baton, current_ns, finish_time_ns);
|
@@ -946,7 +936,7 @@ bool WaylandDisplay::Run() {
|
946 | 936 | if (vsync.presentation_clk_id_ != UINT32_MAX && presentation_ != nullptr) {
|
947 | 937 | DBG_TIMING({
|
948 | 938 | auto tx = FlutterEngineGetCurrentTime();
|
949 |
| - dbgI("[%09.4f][%ld] add listener\n", (tx-t00)/1e9, gettid()); |
| 939 | + dbgI("[%09.4f][%ld] add listener\n", (tx - t00) / 1e9, gettid()); |
950 | 940 | });
|
951 | 941 | wp_presentation_feedback_add_listener(::wp_presentation_feedback(presentation_, surface_), &kPresentationFeedbackListener, this);
|
952 | 942 | wl_display_dispatch_pending(display_);
|
|
0 commit comments