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

Unified Diff: content/shell/test_runner/pixel_dump.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 | « content/renderer/pepper/pepper_plugin_instance_impl.cc ('k') | headless/lib/browser/headless_clipboard.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/test_runner/pixel_dump.cc
diff --git a/content/shell/test_runner/pixel_dump.cc b/content/shell/test_runner/pixel_dump.cc
index 123030fed6bc974b2c6f953d71e4a560010601f9..12eb7414ddcc87aa8d310a6a84fbf041880cfabc 100644
--- a/content/shell/test_runner/pixel_dump.cc
+++ b/content/shell/test_runner/pixel_dump.cc
@@ -131,7 +131,10 @@ void CaptureCallback::DidCompositeAndReadback(const SkBitmap& bitmap) {
return;
}
if (main_bitmap_.isNull()) {
- bitmap.deepCopyTo(&main_bitmap_);
+ if (main_bitmap_.tryAllocPixels(bitmap.info())) {
+ bitmap.readPixels(main_bitmap_.info(), main_bitmap_.getPixels(),
+ main_bitmap_.rowBytes(), 0, 0);
+ }
return;
}
SkCanvas canvas(main_bitmap_);
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.cc ('k') | headless/lib/browser/headless_clipboard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698