-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Add debug ToString methods to render targets. #41221
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
std::string SPrintF(const char* format, ...) { | ||
std::string ret_val; | ||
va_list list; | ||
va_list list2; | ||
va_start(list, format); | ||
char buffer[64] = {0}; | ||
::vsnprintf(buffer, sizeof(buffer), format, list); | ||
va_copy(list2, list); | ||
if (auto string_length = ::vsnprintf(nullptr, 0, format, list); | ||
string_length >= 0) { | ||
auto buffer = reinterpret_cast<char*>(::malloc(string_length + 1)); | ||
::vsnprintf(buffer, string_length + 1, format, list2); | ||
ret_val = std::string{buffer, static_cast<size_t>(string_length)}; | ||
::free(buffer); | ||
} | ||
va_end(list2); | ||
va_end(list); | ||
return buffer; | ||
return ret_val; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take your word for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you talking about the dubious var name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
auto label is removed for flutter/engine, pr: 41221, due to - The status or check suite Mac mac_unopt has failed. Please fix the issues identified (or deflake) before re-applying this label. |
Also fixes and issue where SPrintF would only consider strings 64 bytes or smaller.
The CI flake has been reported in sheriffs chat. |
…125004) flutter/engine@20034a8...4a603aa 2023-04-17 magder@google.com Remove 'Mac mac_unopt' in favor of Linux (flutter/engine#41226) 2023-04-17 chinmaygarde@google.com [Impeller] Add debug ToString methods to render targets. (flutter/engine#41221) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC jacksongardner@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Also fixes and issue where SPrintF would only consider strings 64 bytes or smaller.