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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.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: content/renderer/pepper/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 592133d4f5756491bb5a4f73d0e54de432c56972..df7a58ab864664cede0609dce124770c812998a4 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -2808,7 +2808,9 @@ PP_Bool PepperPluginInstanceImpl::SetCursor(PP_Instance instance,
SkBitmap bitmap(image_data->GetMappedBitmap());
// Make a deep copy, so that the cursor remains valid even after the original
// image data gets freed.
- if (!bitmap.copyTo(&custom_cursor->custom_image.GetSkBitmap())) {
+ SkBitmap& dst = custom_cursor->custom_image.GetSkBitmap();
+ if (!dst.tryAllocPixels(bitmap.info()) ||
+ !bitmap.readPixels(dst.info(), dst.getPixels(), dst.rowBytes(), 0, 0)) {
return PP_FALSE;
}

Powered by Google App Engine
This is Rietveld 408576698