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

Unified Diff: chrome/browser/android/compositor/layer/contextual_search_layer.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
« no previous file with comments | « cc/ipc/struct_traits_unittest.cc ('k') | chrome/browser/bitmap_fetcher/bitmap_fetcher_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/compositor/layer/contextual_search_layer.cc
diff --git a/chrome/browser/android/compositor/layer/contextual_search_layer.cc b/chrome/browser/android/compositor/layer/contextual_search_layer.cc
index a13183dc8d194b39895fa30d3d3e76b3c47478de..fbc3c75d5b7d0c650b851b2dbc2e0a4c2862284d 100644
--- a/chrome/browser/android/compositor/layer/contextual_search_layer.cc
+++ b/chrome/browser/android/compositor/layer/contextual_search_layer.cc
@@ -704,7 +704,10 @@ void ContextualSearchLayer::SetThumbnail(const SkBitmap* thumbnail) {
if (thumbnail->isImmutable()) {
thumbnail_copy = *thumbnail;
} else {
- thumbnail->copyTo(&thumbnail_copy);
+ if (thumbnail_copy.tryAllocPixels(thumbnail->info())) {
+ thumbnail->readPixels(thumbnail_copy.info(), thumbnail_copy.getPixels(),
+ thumbnail_copy.rowBytes(), 0, 0);
+ }
thumbnail_copy.setImmutable();
}
« no previous file with comments | « cc/ipc/struct_traits_unittest.cc ('k') | chrome/browser/bitmap_fetcher/bitmap_fetcher_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698