Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
| index b021d596fcc0da7bce353e086280d1668ee0a0eb..35143358187f196a87d67ecc12d43042fb0479cc 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
| @@ -1051,7 +1051,18 @@ void GraphicsLayer::SetContentsRect(const IntRect& rect) { |
| void GraphicsLayer::SetContentsToImage( |
| Image* image, |
| RespectImageOrientationEnum respect_image_orientation) { |
| - sk_sp<SkImage> sk_image = image ? image->ImageForCurrentFrame() : nullptr; |
| + sk_sp<SkImage> sk_image; |
| + PaintImage::AnimationType animation_type; |
| + PaintImage::CompletionState completion_state; |
| + if (image) { |
| + sk_image = image->ImageForCurrentFrame(); |
|
Khushal
2017/04/26 03:06:42
May be a PaintImageForCurrentFrame on blink::Image
|
| + animation_type = image->MaybeAnimated() |
| + ? PaintImage::AnimationType::ANIMATED |
| + : PaintImage::AnimationType::STATIC; |
| + completion_state = image->CurrentFrameIsComplete() |
| + ? PaintImage::CompletionState::DONE |
| + : PaintImage::CompletionState::PARTIALLY_DONE; |
| + } |
| if (image && sk_image && image->IsBitmapImage()) { |
| if (respect_image_orientation == kRespectImageOrientation) { |
| @@ -1068,7 +1079,8 @@ void GraphicsLayer::SetContentsToImage( |
| Platform::Current()->CompositorSupport()->CreateImageLayer(); |
| RegisterContentsLayer(image_layer_->Layer()); |
| } |
| - image_layer_->SetImage(sk_image.get()); |
| + image_layer_->SetImage( |
| + PaintImage(std::move(sk_image), animation_type, completion_state)); |
| image_layer_->Layer()->SetOpaque(image->CurrentFrameKnownToBeOpaque()); |
| UpdateContentsRect(); |
| } else { |