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

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

Issue 2855503003: Replace uses of legacy SkBitmap::copyTo() API (Closed)
Patch Set: Remove braces 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..c289a5cceca753294867608604d8b5a4c30e3ab4 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 image_info = info.makeColorType(kN32_SkColorType);
+ return out->tryAllocPixels(image_info) &&
+ bitmap.readPixels(image_info, out->getPixels(), out->rowBytes(), 0, 0);
}
} // namespace mojo
« no previous file with comments | « chrome/renderer/chrome_render_frame_observer.cc ('k') | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698