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

Unified Diff: ui/base/test/test_clipboard.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 | « ui/base/clipboard/clipboard_aura.cc ('k') | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/test/test_clipboard.cc
diff --git a/ui/base/test/test_clipboard.cc b/ui/base/test/test_clipboard.cc
index 1fdb268db56337aa7ed10e611addb761d395ddb7..585a3a6f43f330c85198d4e922e0c2fd17758ccc 100644
--- a/ui/base/test/test_clipboard.cc
+++ b/ui/base/test/test_clipboard.cc
@@ -185,7 +185,10 @@ void TestClipboard::WriteWebSmartPaste() {
void TestClipboard::WriteBitmap(const SkBitmap& bitmap) {
// Create a dummy entry.
GetDefaultStore().data[GetBitmapFormatType()];
- bitmap.copyTo(&GetDefaultStore().image);
+ SkBitmap& dst = GetDefaultStore().image;
+ if (dst.tryAllocPixels(bitmap.info())) {
+ bitmap.readPixels(dst.info(), dst.getPixels(), dst.rowBytes(), 0, 0);
+ }
}
void TestClipboard::WriteData(const FormatType& format,
« no previous file with comments | « ui/base/clipboard/clipboard_aura.cc ('k') | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698