-
Notifications
You must be signed in to change notification settings - Fork 6k
[fuchsia] set vsync_offset based on config file #18006
Conversation
In order to better support different products on Fuchsia, we should change performance-sensitive attributes based on config files passed in. This change does so for `vsync_offset`.
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.
Looks good overall left a couple of comments regarding names, style and additional tests.
|
||
class ProductConfigurationTest : public testing::Test {}; | ||
|
||
TEST_F(ProductConfigurationTest, ValidVsyncOffset) { |
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.
can you add the following tests:
- Invalid json string.
- Negative vsync offset.
- Unexpected vsync offset (larger than 1 second for example deserves a warning).
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.
Done
#include "vsync_recorder.h" | ||
|
||
namespace flutter_runner { | ||
|
||
VsyncWaiter::VsyncWaiter(std::string debug_label, | ||
zx_handle_t session_present_handle, | ||
flutter::TaskRunners task_runners) | ||
flutter::TaskRunners task_runners, | ||
ProductConfiguration product_config) |
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 would take a float/double in this constructor. Its generally a good dependency injection practice for consumers of a configuration to take specific parameters.
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.
Sounds good, but why a floating point number and not an integer/fml::TimeDelta?
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.
Changed it to take an fml::TimeDelta since that's the type of vsync_offset_
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 after kaushiks comments are addressed
In order to better support different products on Fuchsia, we should
change performance-sensitive attributes based on config files passed in.
This change does so for
vsync_offset
. If the file does not exist, or we cannotsuccessfully parse it, there is no change in behavior.