Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@liyuqian
Copy link
Contributor

@liyuqian liyuqian added perf: speed Performance issues related to (mostly rendering) speed severe: performance Relates to speed or footprint issues. labels Mar 24, 2020
Copy link
Contributor

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment about the thread used to service this and some very minor nits about naming convention. LGTM otherwise.

const std::string_view ServiceProtocol::kGetDisplayRefreshRateExtensionName =
"_flutter.getDisplayRefreshRate";
const std::string_view ServiceProtocol::kGetSkSLsExtensionName =
"_flutter.getSkSLs";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't forget to document this new method in the wiki entry on engine managed service protocol extensions. https://github.com/flutter/flutter/wiki/Engine-specific-Service-Protocol-extensions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created flutter/flutter#53199 to make sure that I don't forget it.

std::bind(&Shell::OnServiceProtocolGetDisplayRefreshRate, this,
std::placeholders::_1, std::placeholders::_2)};
service_protocol_handlers_[ServiceProtocol::kGetSkSLsExtensionName] = {
task_runners_.GetUITaskRunner(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This doesn't have to be serviced on the UI task runner right (the writes are already atomic)? We can perform these operations on the IO thread. This will give fewer opportunities to block the UI thread. Granted its just debug and profile modes, but still.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, changed it to IO thread.

char* b64_char = static_cast<char*>(b64_data->writable_data());
SkBase64::Encode(sksl.second->data(), sksl.second->size(), b64_char);
b64_char[b64_size] = 0; // make it null terminated for printing
rapidjson::Value shaderValue(b64_char, response.GetAllocator());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Please use engine ivar naming conventions. shader_value, etc..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Missed those ones. Fixed.

"{\"type\":\"GetSkSLs\",\"SkSLs\":{\"II\":\"eQ==\",\"IE\":\"eA==\"}}");

// Cleanup files
fml::FileVisitor recursive_cleanup = [&recursive_cleanup](
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a later patch, we should consider putting this in //flutter/testing or create a fixture that sets up an isolate temp directory per test run that gets automatically cleaned up.

Copy link
Contributor

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, the Fuchsia failures are due to the bot quarantine. Let's ignore those presubmits. But please make sure the non-fuchsia presubmits pass. LGTM.

@liyuqian liyuqian merged commit bb35963 into flutter:master Mar 25, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 25, 2020
@liyuqian liyuqian deleted the sksl_protocol branch March 25, 2020 22:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes perf: speed Performance issues related to (mostly rendering) speed severe: performance Relates to speed or footprint issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create service protocols to read back generated SkSLs

3 participants