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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp

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 | « skia/config/SkUserConfig.h ('k') | ui/base/clipboard/clipboard_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
index a26594466b40fd22c60878b786095b05772c5a92..68aeeb33d8f77851d11fae729285af747b1b1cd3 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
@@ -83,7 +83,10 @@ bool ImageFrame::CopyBitmapData(const ImageFrame& other) {
DCHECK_NE(this, &other);
has_alpha_ = other.has_alpha_;
bitmap_.reset();
- return other.bitmap_.copyTo(&bitmap_, other.bitmap_.colorType());
+ SkImageInfo info = other.bitmap_.info();
+ return bitmap_.tryAllocPixels(info) &&
+ other.bitmap_.readPixels(info, bitmap_.getPixels(), bitmap_.rowBytes(),
+ 0, 0);
}
bool ImageFrame::TakeBitmapDataIfWritable(ImageFrame* other) {
« no previous file with comments | « skia/config/SkUserConfig.h ('k') | ui/base/clipboard/clipboard_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698