mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
No point in passing by value and moving, just pass a const ref through. Trivial performance improvement.
# Before
```cpp
/// Bind uniform buffer for resource named FragInfo.
static bool BindFragInfo(ResourceBinder& command, BufferView view) {
return command.BindResource(ShaderStage::kFragment, kResourceFragInfo, kMetadataFragInfo, std::move(view));
}
/// Bind combined image sampler for resource named texture_sampler.
static bool BindTextureSampler(ResourceBinder& command, std::shared_ptr<const Texture> texture, std::shared_ptr<const Sampler> sampler) {
return command.BindResource(ShaderStage::kFragment, kResourceTextureSampler, kMetadataTextureSampler, std::move(texture), std::move(sampler));
}
```
# After
```cpp
/// Bind uniform buffer for resource named FragInfo.
static bool BindFragInfo(ResourceBinder& command, const BufferView& view) {
return command.BindResource(ShaderStage::kFragment, kResourceFragInfo, kMetadataFragInfo, view);
}
/// Bind combined image sampler for resource named texture_sampler.
static bool BindTextureSampler(ResourceBinder& command, const std::shared_ptr<const Texture>& texture, const std::shared_ptr<const Sampler>& sampler) {
return command.BindResource(ShaderStage::kFragment, kResourceTextureSampler, kMetadataTextureSampler, texture, sampler);
}
```
Description
Flutter makes it easy and fast to build beautiful apps for mobile and beyond
androidapp-frameworkcross-platformdartdart-platformdesktopflutterflutter-packagefuchsiaioslinux-desktopmacosmaterial-designmobilemobile-developmentskiawebweb-frameworkwindows
2.5 GiB
Languages
Dart
75%
C++
16.5%
Objective-C++
2.9%
Java
2.8%
Objective-C
0.7%
Other
1.9%