Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: components/arc/bitmap/bitmap_struct_traits.cc

Issue 2855503003: Replace uses of legacy SkBitmap::copyTo() API (Closed)
Patch Set: Fix paren errors Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/arc/bitmap/bitmap_struct_traits.cc
diff --git a/components/arc/bitmap/bitmap_struct_traits.cc b/components/arc/bitmap/bitmap_struct_traits.cc
index 51aa30f44f0e41cff2c26d34867abdf878029199..bf613f8805b5800ca739c84bfed8c79cb902106e 100644
--- a/components/arc/bitmap/bitmap_struct_traits.cc
+++ b/components/arc/bitmap/bitmap_struct_traits.cc
@@ -30,7 +30,9 @@ bool StructTraits<arc::mojom::ArcBitmapDataView, SkBitmap>::
}
// Copy the pixels with converting color type.
- return bitmap.copyTo(out, kN32_SkColorType);
+ SkImageInfo infoN32 = info.makeColorType(kN32_SkColorType);
+ return out->tryAllocPixels(infoN32) &&
+ bitmap.readPixels(infoN32, out->getPixels(), out->rowBytes(), 0, 0);
}
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698