From c3ece1b76700f134467ab47718e06df8cec5cfb1 Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Tue, 11 Oct 2022 09:21:17 +0800 Subject: [PATCH] rm debug log #6136 --- shell/common/rasterizer.cc | 42 +++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index aed6ea6d6342c..056afede064a2 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -504,13 +504,6 @@ RasterStatus Rasterizer::DrawToSurface( return raster_status; } -template -std::string to_string(const T& value) { - std::ostringstream ss; - ss << value; - return ss.str(); -} - void Rasterizer::MaybeSleepBeforeSubmit( FrameTimingsRecorder& frame_timings_recorder) { static const int MAX_HISTORY = 5; @@ -547,22 +540,23 @@ void Rasterizer::MaybeSleepBeforeSubmit( fml::TimeDelta sleep_duration = wakeup_time - now; - std::ostringstream info; - info << "should_sleep=" << should_sleep // - << ", curr_latency=" << curr_latency // - << ", vsync_target_time" - << vsync_target_time.ToEpochDelta().ToMicroseconds() // - << ", now" << now.ToEpochDelta().ToMicroseconds() // - << ", wakeup_time" << wakeup_time.ToEpochDelta().ToMicroseconds() // - << ", sleep_duration" << sleep_duration.ToMicroseconds() // - << ", history_larger_latency_count=" << history_larger_latency_count // - << ", history_latencies="; - for (int history_latency : history_latencies_) { - info << history_latency << ","; - } - info << ", "; - TRACE_EVENT1("flutter", "Rasterizer::MaybeSleepBeforeSubmit", "info", - info.str().c_str()); + // std::ostringstream info; + // info << "should_sleep=" << should_sleep // + // << ", curr_latency=" << curr_latency // + // << ", vsync_target_time" + // << vsync_target_time.ToEpochDelta().ToMicroseconds() // + // << ", now" << now.ToEpochDelta().ToMicroseconds() // + // << ", wakeup_time" << wakeup_time.ToEpochDelta().ToMicroseconds() // + // << ", sleep_duration" << sleep_duration.ToMicroseconds() // + // << ", history_larger_latency_count=" << history_larger_latency_count + // // + // << ", history_latencies="; + // for (int history_latency : history_latencies_) { + // info << history_latency << ","; + // } + // info << ", "; + // TRACE_EVENT1("flutter", "Rasterizer::MaybeSleepBeforeSubmit", "info", + // info.str().c_str()); { history_latencies_.push_back(curr_latency); @@ -572,6 +566,8 @@ void Rasterizer::MaybeSleepBeforeSubmit( } if (should_sleep) { + TRACE_EVENT0("flutter", "SleepBeforeSubmit"); + // TODO may use signals etc, instead of sleeping std::this_thread::sleep_for( std::chrono::microseconds(sleep_duration.ToMicroseconds()));