Avoid copy of SkImageInfo in HeapAllocator::allocPixelRef

SkBitmap::info() returns and SkMallocPixelRef::MakeAllocate takes
const SkImageInfo& to avoid making copies. Add the '&' to make it
obvious that a copy is not required here, just the reference.

Change-Id: I972ec92abe86451f34ade2a717c052da7d367f9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309723
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
Ben Wagner 2020-08-12 12:03:59 -04:00 committed by Skia Commit-Bot
parent de7d927db3
commit cc8b690b9e

View File

@ -352,7 +352,7 @@ void SkBitmap::notifyPixelsChanged() const {
so that we can freely assign memory allocated by one class to the other.
*/
bool SkBitmap::HeapAllocator::allocPixelRef(SkBitmap* dst) {
const SkImageInfo info = dst->info();
const SkImageInfo& info = dst->info();
if (kUnknown_SkColorType == info.colorType()) {
// SkDebugf("unsupported config for info %d\n", dst->config());
return false;