| 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..7dd4c121ff0475ba2c210f7965ee20ebdd0d606d 100644
|
| --- a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
|
| +++ b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
|
| @@ -83,7 +83,11 @@ 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());
|
| + bool copied = other.bitmap_.copyTo(&bitmap_, other.bitmap_.colorType());
|
| + if (copied)
|
| + status_ = kFrameAllocated;
|
| +
|
| + return copied;
|
| }
|
|
|
| bool ImageFrame::TakeBitmapDataIfWritable(ImageFrame* other) {
|
| @@ -97,6 +101,7 @@ bool ImageFrame::TakeBitmapDataIfWritable(ImageFrame* other) {
|
| bitmap_.reset();
|
| bitmap_.swap(other->bitmap_);
|
| other->status_ = kFrameEmpty;
|
| + status_ = kFrameAllocated;
|
| return true;
|
| }
|
|
|
| @@ -110,7 +115,11 @@ bool ImageFrame::AllocatePixelData(int new_width,
|
| new_width, new_height,
|
| premultiply_alpha_ ? kPremul_SkAlphaType : kUnpremul_SkAlphaType,
|
| std::move(color_space)));
|
| - return bitmap_.tryAllocPixels(allocator_, 0);
|
| + bool allocated = bitmap_.tryAllocPixels(allocator_, 0);
|
| + if (allocated)
|
| + status_ = kFrameAllocated;
|
| +
|
| + return allocated;
|
| }
|
|
|
| bool ImageFrame::HasAlpha() const {
|
|
|