pw_display: Fix UpdateNearestNeighbor write callback
Change-Id: Ia8953c0ffa40fb094c2cc58c55e6e75a3c2c8f71
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/experimental/+/169790
Reviewed-by: Chris Mumford <cmumford@google.com>
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
diff --git a/applications/terminal_display/main.cc b/applications/terminal_display/main.cc
index 97a9cd2..792c363 100644
--- a/applications/terminal_display/main.cc
+++ b/applications/terminal_display/main.cc
@@ -533,9 +533,10 @@
if (pw::spin_delay::Millis() > frame_start_millis + 1000) {
frames_per_second = frames;
frames = 0;
- PW_LOG_INFO("Time: %lu - FPS: %d",
- static_cast<unsigned long>(pw::spin_delay::Millis()),
- frames_per_second);
+ PW_LOG_INFO("FPS:%d, Draw:%dms, Flush:%dms",
+ frames_per_second,
+ CalcAverageUint32Value(draw_times),
+ CalcAverageUint32Value(flush_times));
int len = std::swprintf(fps_buffer.data(),
fps_buffer.size(),
L"FPS:%d, Draw:%dms, Flush:%dms",
diff --git a/pw_graphics/pw_display/display.cc b/pw_graphics/pw_display/display.cc
index 46c35b1..6264c17 100644
--- a/pw_graphics/pw_display/display.cc
+++ b/pw_graphics/pw_display/display.cc
@@ -102,7 +102,9 @@
return Status::InvalidArgument();
if (framebuffer.size() != size_) {
#if DISPLAY_RESIZE
- return UpdateNearestNeighbor(framebuffer);
+ Status result = UpdateNearestNeighbor(framebuffer);
+ write_cb(std::move(framebuffer), result);
+ return result;
#endif
// Rely on display driver's ability to support size mismatch. It is
// expected to return an error if it cannot.