mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Reverts flutter/engine#48318 Initiated by: jonahwilliams This change reverts the following previous change: Original Description: 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); } ```